Mercurial > octave
annotate src/DLD-FUNCTIONS/__fltk_uigetfile__.cc @ 14854:5ae9f0f77635
maint: Use Octave coding conventions for coddling parenthis is DLD-FUNCTIONS directory
* __fltk_uigetfile__.cc, __glpk__.cc, __init_fltk__.cc, __magick_read__.cc,
besselj.cc, bsxfun.cc, ccolamd.cc, cellfun.cc, chol.cc, colamd.cc, daspk.cc,
dasrt.cc, dassl.cc, dmperm.cc, fft.cc, filter.cc, find.cc, gcd.cc, kron.cc,
lsode.cc, lu.cc, luinc.cc, quad.cc, quadcc.cc, rand.cc, regexp.cc, schur.cc,
str2double.cc, symbfact.cc, symrcm.cc, tril.cc, urlwrite.cc: Use Octave coding
conventions for coddling parenthis is DLD-FUNCTIONS directory.
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Mon, 09 Jul 2012 13:01:49 -0700 |
parents | 460a3c6d8bf1 |
children |
rev | line source |
---|---|
12183
b4d26c65e7e6
Allow ui file function to work if gnuplot is the selected toolkit and fltk is available
Kai Habel <kai.habel@gmx.de>
parents:
diff
changeset
|
1 /* |
b4d26c65e7e6
Allow ui file function to work if gnuplot is the selected toolkit and fltk is available
Kai Habel <kai.habel@gmx.de>
parents:
diff
changeset
|
2 |
14138
72c96de7a403
maint: update copyright notices for 2012
John W. Eaton <jwe@octave.org>
parents:
13721
diff
changeset
|
3 Copyright (C) 2010-2012 Kai Habel |
12183
b4d26c65e7e6
Allow ui file function to work if gnuplot is the selected toolkit and fltk is available
Kai Habel <kai.habel@gmx.de>
parents:
diff
changeset
|
4 |
b4d26c65e7e6
Allow ui file function to work if gnuplot is the selected toolkit and fltk is available
Kai Habel <kai.habel@gmx.de>
parents:
diff
changeset
|
5 This file is part of Octave. |
b4d26c65e7e6
Allow ui file function to work if gnuplot is the selected toolkit and fltk is available
Kai Habel <kai.habel@gmx.de>
parents:
diff
changeset
|
6 |
b4d26c65e7e6
Allow ui file function to work if gnuplot is the selected toolkit and fltk is available
Kai Habel <kai.habel@gmx.de>
parents:
diff
changeset
|
7 Octave is free software; you can redistribute it and/or modify it |
b4d26c65e7e6
Allow ui file function to work if gnuplot is the selected toolkit and fltk is available
Kai Habel <kai.habel@gmx.de>
parents:
diff
changeset
|
8 under the terms of the GNU General Public License as published by the |
b4d26c65e7e6
Allow ui file function to work if gnuplot is the selected toolkit and fltk is available
Kai Habel <kai.habel@gmx.de>
parents:
diff
changeset
|
9 Free Software Foundation; either version 3 of the License, or (at your |
b4d26c65e7e6
Allow ui file function to work if gnuplot is the selected toolkit and fltk is available
Kai Habel <kai.habel@gmx.de>
parents:
diff
changeset
|
10 option) any later version. |
b4d26c65e7e6
Allow ui file function to work if gnuplot is the selected toolkit and fltk is available
Kai Habel <kai.habel@gmx.de>
parents:
diff
changeset
|
11 |
b4d26c65e7e6
Allow ui file function to work if gnuplot is the selected toolkit and fltk is available
Kai Habel <kai.habel@gmx.de>
parents:
diff
changeset
|
12 Octave is distributed in the hope that it will be useful, but WITHOUT |
b4d26c65e7e6
Allow ui file function to work if gnuplot is the selected toolkit and fltk is available
Kai Habel <kai.habel@gmx.de>
parents:
diff
changeset
|
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
b4d26c65e7e6
Allow ui file function to work if gnuplot is the selected toolkit and fltk is available
Kai Habel <kai.habel@gmx.de>
parents:
diff
changeset
|
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
b4d26c65e7e6
Allow ui file function to work if gnuplot is the selected toolkit and fltk is available
Kai Habel <kai.habel@gmx.de>
parents:
diff
changeset
|
15 for more details. |
b4d26c65e7e6
Allow ui file function to work if gnuplot is the selected toolkit and fltk is available
Kai Habel <kai.habel@gmx.de>
parents:
diff
changeset
|
16 |
b4d26c65e7e6
Allow ui file function to work if gnuplot is the selected toolkit and fltk is available
Kai Habel <kai.habel@gmx.de>
parents:
diff
changeset
|
17 You should have received a copy of the GNU General Public License |
b4d26c65e7e6
Allow ui file function to work if gnuplot is the selected toolkit and fltk is available
Kai Habel <kai.habel@gmx.de>
parents:
diff
changeset
|
18 along with Octave; see the file COPYING. If not, see |
b4d26c65e7e6
Allow ui file function to work if gnuplot is the selected toolkit and fltk is available
Kai Habel <kai.habel@gmx.de>
parents:
diff
changeset
|
19 <http://www.gnu.org/licenses/>. |
b4d26c65e7e6
Allow ui file function to work if gnuplot is the selected toolkit and fltk is available
Kai Habel <kai.habel@gmx.de>
parents:
diff
changeset
|
20 |
b4d26c65e7e6
Allow ui file function to work if gnuplot is the selected toolkit and fltk is available
Kai Habel <kai.habel@gmx.de>
parents:
diff
changeset
|
21 */ |
b4d26c65e7e6
Allow ui file function to work if gnuplot is the selected toolkit and fltk is available
Kai Habel <kai.habel@gmx.de>
parents:
diff
changeset
|
22 |
b4d26c65e7e6
Allow ui file function to work if gnuplot is the selected toolkit and fltk is available
Kai Habel <kai.habel@gmx.de>
parents:
diff
changeset
|
23 #ifdef HAVE_CONFIG_H |
b4d26c65e7e6
Allow ui file function to work if gnuplot is the selected toolkit and fltk is available
Kai Habel <kai.habel@gmx.de>
parents:
diff
changeset
|
24 #include <config.h> |
b4d26c65e7e6
Allow ui file function to work if gnuplot is the selected toolkit and fltk is available
Kai Habel <kai.habel@gmx.de>
parents:
diff
changeset
|
25 #endif |
b4d26c65e7e6
Allow ui file function to work if gnuplot is the selected toolkit and fltk is available
Kai Habel <kai.habel@gmx.de>
parents:
diff
changeset
|
26 |
b4d26c65e7e6
Allow ui file function to work if gnuplot is the selected toolkit and fltk is available
Kai Habel <kai.habel@gmx.de>
parents:
diff
changeset
|
27 #if defined (HAVE_FLTK) |
b4d26c65e7e6
Allow ui file function to work if gnuplot is the selected toolkit and fltk is available
Kai Habel <kai.habel@gmx.de>
parents:
diff
changeset
|
28 |
13721
ca90a6d59ab6
Prevent auto-inclusion of winsock.h in WIN32.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
12805
diff
changeset
|
29 #ifdef WIN32 |
ca90a6d59ab6
Prevent auto-inclusion of winsock.h in WIN32.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
12805
diff
changeset
|
30 #define WIN32_LEAN_AND_MEAN |
ca90a6d59ab6
Prevent auto-inclusion of winsock.h in WIN32.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
12805
diff
changeset
|
31 #endif |
ca90a6d59ab6
Prevent auto-inclusion of winsock.h in WIN32.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
12805
diff
changeset
|
32 |
12183
b4d26c65e7e6
Allow ui file function to work if gnuplot is the selected toolkit and fltk is available
Kai Habel <kai.habel@gmx.de>
parents:
diff
changeset
|
33 #include <FL/Fl.H> |
12565
0f71b9639207
Correct typo in #include path for FLTK header files (bug #32972).
Rik <octave@nomad.inbox5.com>
parents:
12466
diff
changeset
|
34 #include <FL/Fl_File_Chooser.H> |
12205
be90f9e4548e
#undef Complex after including FLTK headers
John W. Eaton <jwe@octave.org>
parents:
12193
diff
changeset
|
35 |
be90f9e4548e
#undef Complex after including FLTK headers
John W. Eaton <jwe@octave.org>
parents:
12193
diff
changeset
|
36 // FLTK headers may include X11/X.h which defines Complex, and that |
be90f9e4548e
#undef Complex after including FLTK headers
John W. Eaton <jwe@octave.org>
parents:
12193
diff
changeset
|
37 // conflicts with Octave's Complex typedef. We don't need the X11 |
be90f9e4548e
#undef Complex after including FLTK headers
John W. Eaton <jwe@octave.org>
parents:
12193
diff
changeset
|
38 // Complex definition in this file, so remove it before including Octave |
be90f9e4548e
#undef Complex after including FLTK headers
John W. Eaton <jwe@octave.org>
parents:
12193
diff
changeset
|
39 // headers which may require Octave's Complex typedef. |
be90f9e4548e
#undef Complex after including FLTK headers
John W. Eaton <jwe@octave.org>
parents:
12193
diff
changeset
|
40 #undef Complex |
be90f9e4548e
#undef Complex after including FLTK headers
John W. Eaton <jwe@octave.org>
parents:
12193
diff
changeset
|
41 |
12183
b4d26c65e7e6
Allow ui file function to work if gnuplot is the selected toolkit and fltk is available
Kai Habel <kai.habel@gmx.de>
parents:
diff
changeset
|
42 #include "defun-dld.h" |
b4d26c65e7e6
Allow ui file function to work if gnuplot is the selected toolkit and fltk is available
Kai Habel <kai.habel@gmx.de>
parents:
diff
changeset
|
43 #include "file-ops.h" |
b4d26c65e7e6
Allow ui file function to work if gnuplot is the selected toolkit and fltk is available
Kai Habel <kai.habel@gmx.de>
parents:
diff
changeset
|
44 |
b4d26c65e7e6
Allow ui file function to work if gnuplot is the selected toolkit and fltk is available
Kai Habel <kai.habel@gmx.de>
parents:
diff
changeset
|
45 DEFUN_DLD (__fltk_uigetfile__, args, , |
b4d26c65e7e6
Allow ui file function to work if gnuplot is the selected toolkit and fltk is available
Kai Habel <kai.habel@gmx.de>
parents:
diff
changeset
|
46 "-*- texinfo -*-\n\ |
b4d26c65e7e6
Allow ui file function to work if gnuplot is the selected toolkit and fltk is available
Kai Habel <kai.habel@gmx.de>
parents:
diff
changeset
|
47 @deftypefn {Built-in Function} {} __fltk_uigetfile__ (@dots{})\n\ |
b4d26c65e7e6
Allow ui file function to work if gnuplot is the selected toolkit and fltk is available
Kai Habel <kai.habel@gmx.de>
parents:
diff
changeset
|
48 Undocumented internal function.\n\ |
b4d26c65e7e6
Allow ui file function to work if gnuplot is the selected toolkit and fltk is available
Kai Habel <kai.habel@gmx.de>
parents:
diff
changeset
|
49 @end deftypefn") |
b4d26c65e7e6
Allow ui file function to work if gnuplot is the selected toolkit and fltk is available
Kai Habel <kai.habel@gmx.de>
parents:
diff
changeset
|
50 { |
12206
6212f303243e
__fltk_uigetfile__.cc: style fixes
John W. Eaton <jwe@octave.org>
parents:
12205
diff
changeset
|
51 // Expected argument list: |
6212f303243e
__fltk_uigetfile__.cc: style fixes
John W. Eaton <jwe@octave.org>
parents:
12205
diff
changeset
|
52 // |
6212f303243e
__fltk_uigetfile__.cc: style fixes
John W. Eaton <jwe@octave.org>
parents:
12205
diff
changeset
|
53 // args(0) ... FileFilter in fltk format |
6212f303243e
__fltk_uigetfile__.cc: style fixes
John W. Eaton <jwe@octave.org>
parents:
12205
diff
changeset
|
54 // args(1) ... Title |
6212f303243e
__fltk_uigetfile__.cc: style fixes
John W. Eaton <jwe@octave.org>
parents:
12205
diff
changeset
|
55 // args(2) ... Default Filename |
6212f303243e
__fltk_uigetfile__.cc: style fixes
John W. Eaton <jwe@octave.org>
parents:
12205
diff
changeset
|
56 // args(3) ... PostionValue [x,y] |
6212f303243e
__fltk_uigetfile__.cc: style fixes
John W. Eaton <jwe@octave.org>
parents:
12205
diff
changeset
|
57 // args(4) ... SelectValue "on"/"off"/"dir"/"create" |
12183
b4d26c65e7e6
Allow ui file function to work if gnuplot is the selected toolkit and fltk is available
Kai Habel <kai.habel@gmx.de>
parents:
diff
changeset
|
58 |
12206
6212f303243e
__fltk_uigetfile__.cc: style fixes
John W. Eaton <jwe@octave.org>
parents:
12205
diff
changeset
|
59 octave_value_list retval (3, octave_value (0)); |
12183
b4d26c65e7e6
Allow ui file function to work if gnuplot is the selected toolkit and fltk is available
Kai Habel <kai.habel@gmx.de>
parents:
diff
changeset
|
60 |
14846
460a3c6d8bf1
maint: Use Octave coding convention for cuddled parenthis in function calls with empty argument lists.
Rik <octave@nomad.inbox5.com>
parents:
14501
diff
changeset
|
61 std::string file_filter = args(0).string_value (); |
460a3c6d8bf1
maint: Use Octave coding convention for cuddled parenthis in function calls with empty argument lists.
Rik <octave@nomad.inbox5.com>
parents:
14501
diff
changeset
|
62 std::string title = args(1).string_value (); |
460a3c6d8bf1
maint: Use Octave coding convention for cuddled parenthis in function calls with empty argument lists.
Rik <octave@nomad.inbox5.com>
parents:
14501
diff
changeset
|
63 std::string default_name = args(2).string_value (); |
460a3c6d8bf1
maint: Use Octave coding convention for cuddled parenthis in function calls with empty argument lists.
Rik <octave@nomad.inbox5.com>
parents:
14501
diff
changeset
|
64 Matrix pos = args(3).matrix_value (); |
12183
b4d26c65e7e6
Allow ui file function to work if gnuplot is the selected toolkit and fltk is available
Kai Habel <kai.habel@gmx.de>
parents:
diff
changeset
|
65 |
b4d26c65e7e6
Allow ui file function to work if gnuplot is the selected toolkit and fltk is available
Kai Habel <kai.habel@gmx.de>
parents:
diff
changeset
|
66 int multi_type = Fl_File_Chooser::SINGLE; |
b4d26c65e7e6
Allow ui file function to work if gnuplot is the selected toolkit and fltk is available
Kai Habel <kai.habel@gmx.de>
parents:
diff
changeset
|
67 std::string flabel = "Filename:"; |
12206
6212f303243e
__fltk_uigetfile__.cc: style fixes
John W. Eaton <jwe@octave.org>
parents:
12205
diff
changeset
|
68 |
14846
460a3c6d8bf1
maint: Use Octave coding convention for cuddled parenthis in function calls with empty argument lists.
Rik <octave@nomad.inbox5.com>
parents:
14501
diff
changeset
|
69 std::string multi = args(4).string_value (); |
12183
b4d26c65e7e6
Allow ui file function to work if gnuplot is the selected toolkit and fltk is available
Kai Habel <kai.habel@gmx.de>
parents:
diff
changeset
|
70 if (multi == "on") |
b4d26c65e7e6
Allow ui file function to work if gnuplot is the selected toolkit and fltk is available
Kai Habel <kai.habel@gmx.de>
parents:
diff
changeset
|
71 multi_type = Fl_File_Chooser::MULTI; |
b4d26c65e7e6
Allow ui file function to work if gnuplot is the selected toolkit and fltk is available
Kai Habel <kai.habel@gmx.de>
parents:
diff
changeset
|
72 else if (multi == "dir") |
b4d26c65e7e6
Allow ui file function to work if gnuplot is the selected toolkit and fltk is available
Kai Habel <kai.habel@gmx.de>
parents:
diff
changeset
|
73 { |
b4d26c65e7e6
Allow ui file function to work if gnuplot is the selected toolkit and fltk is available
Kai Habel <kai.habel@gmx.de>
parents:
diff
changeset
|
74 multi_type = Fl_File_Chooser::DIRECTORY; |
b4d26c65e7e6
Allow ui file function to work if gnuplot is the selected toolkit and fltk is available
Kai Habel <kai.habel@gmx.de>
parents:
diff
changeset
|
75 flabel = "Directory:"; |
b4d26c65e7e6
Allow ui file function to work if gnuplot is the selected toolkit and fltk is available
Kai Habel <kai.habel@gmx.de>
parents:
diff
changeset
|
76 } |
b4d26c65e7e6
Allow ui file function to work if gnuplot is the selected toolkit and fltk is available
Kai Habel <kai.habel@gmx.de>
parents:
diff
changeset
|
77 else if (multi == "create") |
b4d26c65e7e6
Allow ui file function to work if gnuplot is the selected toolkit and fltk is available
Kai Habel <kai.habel@gmx.de>
parents:
diff
changeset
|
78 multi_type = Fl_File_Chooser::CREATE; |
b4d26c65e7e6
Allow ui file function to work if gnuplot is the selected toolkit and fltk is available
Kai Habel <kai.habel@gmx.de>
parents:
diff
changeset
|
79 |
b4d26c65e7e6
Allow ui file function to work if gnuplot is the selected toolkit and fltk is available
Kai Habel <kai.habel@gmx.de>
parents:
diff
changeset
|
80 Fl_File_Chooser::filename_label = flabel.c_str (); |
12206
6212f303243e
__fltk_uigetfile__.cc: style fixes
John W. Eaton <jwe@octave.org>
parents:
12205
diff
changeset
|
81 |
6212f303243e
__fltk_uigetfile__.cc: style fixes
John W. Eaton <jwe@octave.org>
parents:
12205
diff
changeset
|
82 Fl_File_Chooser fc (default_name.c_str (), file_filter.c_str (), |
6212f303243e
__fltk_uigetfile__.cc: style fixes
John W. Eaton <jwe@octave.org>
parents:
12205
diff
changeset
|
83 multi_type, title.c_str ()); |
6212f303243e
__fltk_uigetfile__.cc: style fixes
John W. Eaton <jwe@octave.org>
parents:
12205
diff
changeset
|
84 |
6212f303243e
__fltk_uigetfile__.cc: style fixes
John W. Eaton <jwe@octave.org>
parents:
12205
diff
changeset
|
85 fc.preview (0); |
12183
b4d26c65e7e6
Allow ui file function to work if gnuplot is the selected toolkit and fltk is available
Kai Habel <kai.habel@gmx.de>
parents:
diff
changeset
|
86 |
b4d26c65e7e6
Allow ui file function to work if gnuplot is the selected toolkit and fltk is available
Kai Habel <kai.habel@gmx.de>
parents:
diff
changeset
|
87 if (multi_type == Fl_File_Chooser::CREATE) |
12206
6212f303243e
__fltk_uigetfile__.cc: style fixes
John W. Eaton <jwe@octave.org>
parents:
12205
diff
changeset
|
88 fc.ok_label ("Save"); |
12183
b4d26c65e7e6
Allow ui file function to work if gnuplot is the selected toolkit and fltk is available
Kai Habel <kai.habel@gmx.de>
parents:
diff
changeset
|
89 |
12206
6212f303243e
__fltk_uigetfile__.cc: style fixes
John W. Eaton <jwe@octave.org>
parents:
12205
diff
changeset
|
90 fc.show (); |
12183
b4d26c65e7e6
Allow ui file function to work if gnuplot is the selected toolkit and fltk is available
Kai Habel <kai.habel@gmx.de>
parents:
diff
changeset
|
91 |
12206
6212f303243e
__fltk_uigetfile__.cc: style fixes
John W. Eaton <jwe@octave.org>
parents:
12205
diff
changeset
|
92 while (fc.shown ()) |
12183
b4d26c65e7e6
Allow ui file function to work if gnuplot is the selected toolkit and fltk is available
Kai Habel <kai.habel@gmx.de>
parents:
diff
changeset
|
93 Fl::wait (); |
b4d26c65e7e6
Allow ui file function to work if gnuplot is the selected toolkit and fltk is available
Kai Habel <kai.habel@gmx.de>
parents:
diff
changeset
|
94 |
14846
460a3c6d8bf1
maint: Use Octave coding convention for cuddled parenthis in function calls with empty argument lists.
Rik <octave@nomad.inbox5.com>
parents:
14501
diff
changeset
|
95 if (fc.value ()) |
12183
b4d26c65e7e6
Allow ui file function to work if gnuplot is the selected toolkit and fltk is available
Kai Habel <kai.habel@gmx.de>
parents:
diff
changeset
|
96 { |
12206
6212f303243e
__fltk_uigetfile__.cc: style fixes
John W. Eaton <jwe@octave.org>
parents:
12205
diff
changeset
|
97 int file_count = fc.count (); |
12183
b4d26c65e7e6
Allow ui file function to work if gnuplot is the selected toolkit and fltk is available
Kai Habel <kai.habel@gmx.de>
parents:
diff
changeset
|
98 std::string fname; |
12466
67f98480b181
Use / for fltk path processing only
Kai Habel <kai.habel@gmx.de>
parents:
12206
diff
changeset
|
99 |
67f98480b181
Use / for fltk path processing only
Kai Habel <kai.habel@gmx.de>
parents:
12206
diff
changeset
|
100 //fltk uses forward slash even for windows |
67f98480b181
Use / for fltk path processing only
Kai Habel <kai.habel@gmx.de>
parents:
12206
diff
changeset
|
101 std::string sep = "/"; |
12183
b4d26c65e7e6
Allow ui file function to work if gnuplot is the selected toolkit and fltk is available
Kai Habel <kai.habel@gmx.de>
parents:
diff
changeset
|
102 std::size_t idx; |
b4d26c65e7e6
Allow ui file function to work if gnuplot is the selected toolkit and fltk is available
Kai Habel <kai.habel@gmx.de>
parents:
diff
changeset
|
103 |
b4d26c65e7e6
Allow ui file function to work if gnuplot is the selected toolkit and fltk is available
Kai Habel <kai.habel@gmx.de>
parents:
diff
changeset
|
104 if (file_count == 1 && multi_type != Fl_File_Chooser::DIRECTORY) |
b4d26c65e7e6
Allow ui file function to work if gnuplot is the selected toolkit and fltk is available
Kai Habel <kai.habel@gmx.de>
parents:
diff
changeset
|
105 { |
12206
6212f303243e
__fltk_uigetfile__.cc: style fixes
John W. Eaton <jwe@octave.org>
parents:
12205
diff
changeset
|
106 fname = fc.value (); |
12183
b4d26c65e7e6
Allow ui file function to work if gnuplot is the selected toolkit and fltk is available
Kai Habel <kai.habel@gmx.de>
parents:
diff
changeset
|
107 idx = fname.find_last_of (sep); |
b4d26c65e7e6
Allow ui file function to work if gnuplot is the selected toolkit and fltk is available
Kai Habel <kai.habel@gmx.de>
parents:
diff
changeset
|
108 retval(0) = fname.substr (idx + 1); |
b4d26c65e7e6
Allow ui file function to work if gnuplot is the selected toolkit and fltk is available
Kai Habel <kai.habel@gmx.de>
parents:
diff
changeset
|
109 } |
b4d26c65e7e6
Allow ui file function to work if gnuplot is the selected toolkit and fltk is available
Kai Habel <kai.habel@gmx.de>
parents:
diff
changeset
|
110 else |
b4d26c65e7e6
Allow ui file function to work if gnuplot is the selected toolkit and fltk is available
Kai Habel <kai.habel@gmx.de>
parents:
diff
changeset
|
111 { |
14854
5ae9f0f77635
maint: Use Octave coding conventions for coddling parenthis is DLD-FUNCTIONS directory
Rik <octave@nomad.inbox5.com>
parents:
14846
diff
changeset
|
112 Cell file_cell = Cell (file_count, 1); |
12183
b4d26c65e7e6
Allow ui file function to work if gnuplot is the selected toolkit and fltk is available
Kai Habel <kai.habel@gmx.de>
parents:
diff
changeset
|
113 for (octave_idx_type n = 1; n <= file_count; n++) |
b4d26c65e7e6
Allow ui file function to work if gnuplot is the selected toolkit and fltk is available
Kai Habel <kai.habel@gmx.de>
parents:
diff
changeset
|
114 { |
12206
6212f303243e
__fltk_uigetfile__.cc: style fixes
John W. Eaton <jwe@octave.org>
parents:
12205
diff
changeset
|
115 fname = fc.value (n); |
12183
b4d26c65e7e6
Allow ui file function to work if gnuplot is the selected toolkit and fltk is available
Kai Habel <kai.habel@gmx.de>
parents:
diff
changeset
|
116 idx = fname.find_last_of (sep); |
b4d26c65e7e6
Allow ui file function to work if gnuplot is the selected toolkit and fltk is available
Kai Habel <kai.habel@gmx.de>
parents:
diff
changeset
|
117 file_cell(n - 1) = fname.substr (idx + 1); |
b4d26c65e7e6
Allow ui file function to work if gnuplot is the selected toolkit and fltk is available
Kai Habel <kai.habel@gmx.de>
parents:
diff
changeset
|
118 } |
b4d26c65e7e6
Allow ui file function to work if gnuplot is the selected toolkit and fltk is available
Kai Habel <kai.habel@gmx.de>
parents:
diff
changeset
|
119 retval(0) = file_cell; |
b4d26c65e7e6
Allow ui file function to work if gnuplot is the selected toolkit and fltk is available
Kai Habel <kai.habel@gmx.de>
parents:
diff
changeset
|
120 } |
b4d26c65e7e6
Allow ui file function to work if gnuplot is the selected toolkit and fltk is available
Kai Habel <kai.habel@gmx.de>
parents:
diff
changeset
|
121 |
b4d26c65e7e6
Allow ui file function to work if gnuplot is the selected toolkit and fltk is available
Kai Habel <kai.habel@gmx.de>
parents:
diff
changeset
|
122 if (multi_type == Fl_File_Chooser::DIRECTORY) |
12206
6212f303243e
__fltk_uigetfile__.cc: style fixes
John W. Eaton <jwe@octave.org>
parents:
12205
diff
changeset
|
123 retval(0) = std::string (fc.value ()); |
12183
b4d26c65e7e6
Allow ui file function to work if gnuplot is the selected toolkit and fltk is available
Kai Habel <kai.habel@gmx.de>
parents:
diff
changeset
|
124 else |
b4d26c65e7e6
Allow ui file function to work if gnuplot is the selected toolkit and fltk is available
Kai Habel <kai.habel@gmx.de>
parents:
diff
changeset
|
125 { |
12206
6212f303243e
__fltk_uigetfile__.cc: style fixes
John W. Eaton <jwe@octave.org>
parents:
12205
diff
changeset
|
126 retval(1) = std::string (fc.directory ()) + sep; |
6212f303243e
__fltk_uigetfile__.cc: style fixes
John W. Eaton <jwe@octave.org>
parents:
12205
diff
changeset
|
127 retval(2) = fc.filter_value () + 1; |
12183
b4d26c65e7e6
Allow ui file function to work if gnuplot is the selected toolkit and fltk is available
Kai Habel <kai.habel@gmx.de>
parents:
diff
changeset
|
128 } |
b4d26c65e7e6
Allow ui file function to work if gnuplot is the selected toolkit and fltk is available
Kai Habel <kai.habel@gmx.de>
parents:
diff
changeset
|
129 } |
b4d26c65e7e6
Allow ui file function to work if gnuplot is the selected toolkit and fltk is available
Kai Habel <kai.habel@gmx.de>
parents:
diff
changeset
|
130 |
12206
6212f303243e
__fltk_uigetfile__.cc: style fixes
John W. Eaton <jwe@octave.org>
parents:
12205
diff
changeset
|
131 fc.hide (); |
12183
b4d26c65e7e6
Allow ui file function to work if gnuplot is the selected toolkit and fltk is available
Kai Habel <kai.habel@gmx.de>
parents:
diff
changeset
|
132 Fl::flush (); |
b4d26c65e7e6
Allow ui file function to work if gnuplot is the selected toolkit and fltk is available
Kai Habel <kai.habel@gmx.de>
parents:
diff
changeset
|
133 |
b4d26c65e7e6
Allow ui file function to work if gnuplot is the selected toolkit and fltk is available
Kai Habel <kai.habel@gmx.de>
parents:
diff
changeset
|
134 return retval; |
b4d26c65e7e6
Allow ui file function to work if gnuplot is the selected toolkit and fltk is available
Kai Habel <kai.habel@gmx.de>
parents:
diff
changeset
|
135 } |
b4d26c65e7e6
Allow ui file function to work if gnuplot is the selected toolkit and fltk is available
Kai Habel <kai.habel@gmx.de>
parents:
diff
changeset
|
136 |
12805
3641167e5b75
codesprint: *.cc helper functions do not need tests
Rik <octave@nomad.inbox5.com>
parents:
12565
diff
changeset
|
137 /* |
3641167e5b75
codesprint: *.cc helper functions do not need tests
Rik <octave@nomad.inbox5.com>
parents:
12565
diff
changeset
|
138 ## No test needed for internal helper function. |
3641167e5b75
codesprint: *.cc helper functions do not need tests
Rik <octave@nomad.inbox5.com>
parents:
12565
diff
changeset
|
139 %!assert (1) |
3641167e5b75
codesprint: *.cc helper functions do not need tests
Rik <octave@nomad.inbox5.com>
parents:
12565
diff
changeset
|
140 */ |
3641167e5b75
codesprint: *.cc helper functions do not need tests
Rik <octave@nomad.inbox5.com>
parents:
12565
diff
changeset
|
141 |
12183
b4d26c65e7e6
Allow ui file function to work if gnuplot is the selected toolkit and fltk is available
Kai Habel <kai.habel@gmx.de>
parents:
diff
changeset
|
142 #endif |