annotate libinterp/dldfcn/__fltk_uigetfile__.cc @ 30888:32d2b6604a9f

doc: Ensure documentation lists output argument when it exists for functions in libinterp/ For new users of Octave it is best to show explicit calling forms in the documentation and to show a return argument when it exists. * __ftp__.cc, __magick_read__.cc, __pchip_deriv__.cc, bitfcns.cc, bsxfun.cc, call-stack.cc, cellfun.cc, chol.cc, conv2.cc, data.cc, debug.cc, defaults.cc, det.cc, dirfns.cc, display.cc, dot.cc, error.cc, event-manager.cc, fft.cc, fft2.cc, fftn.cc, file-io.cc, getgrent.cc, getpwent.cc, getrusage.cc, graphics.cc, hash.cc, help.cc, input.cc, interpreter.cc, kron.cc, load-path.cc, mappers.cc, max.cc, nproc.cc, oct-hist.cc, pager.cc, pinv.cc, psi.cc, rand.cc, settings.cc, sighandlers.cc, stream-euler.cc, strfns.cc, symtab.cc, syscalls.cc, sysdep.cc, time.cc, toplev.cc, utils.cc, variables.cc, __fltk_uigetfile__.cc, audiodevinfo.cc, audioread.cc, fftw.cc, ov-bool-mat.cc, ov-cell.cc, ov-class.cc, ov-classdef.cc, ov-fcn-handle.cc, ov-java.cc, ov-struct.cc, ov-typeinfo.cc, ov-usr-fcn.cc, ov.cc, octave.cc, profiler.cc: Add return arguments to @deftypefn macros where they were missing. Attempt to use standard naming convention for return variables. Occasionally improved the docstring itself by re-wording or adding code examples.
author Rik <rik@octave.org>
date Mon, 04 Apr 2022 10:31:48 -0700
parents 796f54d4ddbf
children e88a07dec498
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
27923
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
1 ////////////////////////////////////////////////////////////////////////
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
2 //
30564
796f54d4ddbf update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents: 30196
diff changeset
3 // Copyright (C) 2010-2022 The Octave Project Developers
27923
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
4 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
5 // See the file COPYRIGHT.md in the top-level directory of this
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
6 // distribution or <https://octave.org/copyright/>.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
7 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
8 // This file is part of Octave.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
9 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
10 // Octave is free software: you can redistribute it and/or modify it
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
11 // under the terms of the GNU General Public License as published by
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
12 // the Free Software Foundation, either version 3 of the License, or
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
13 // (at your option) any later version.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
14 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
15 // Octave is distributed in the hope that it will be useful, but
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
16 // WITHOUT ANY WARRANTY; without even the implied warranty of
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
18 // GNU General Public License for more details.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
19 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
20 // You should have received a copy of the GNU General Public License
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
21 // along with Octave; see the file COPYING. If not, see
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
22 // <https://www.gnu.org/licenses/>.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
23 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
24 ////////////////////////////////////////////////////////////////////////
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
25
21724
aba2e6293dd8 use "#if ..." consistently instead of "#ifdef" and "#ifndef"
John W. Eaton <jwe@octave.org>
parents: 21691
diff changeset
26 #if defined (HAVE_CONFIG_H)
21301
40de9f8f23a6 Use '#include "config.h"' rather than <config.h>.
Rik <rik@octave.org>
parents: 21200
diff changeset
27 # include "config.h"
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
28 #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
29
21724
aba2e6293dd8 use "#if ..." consistently instead of "#ifdef" and "#ifndef"
John W. Eaton <jwe@octave.org>
parents: 21691
diff changeset
30 #if defined (HAVE_FLTK)
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
31
30196
813b7827c5f8 Remove "position" argument from file dialog functions (bug #60980).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29961
diff changeset
32 # if defined (WIN32)
813b7827c5f8 Remove "position" argument from file dialog functions (bug #60980).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29961
diff changeset
33 # define WIN32_LEAN_AND_MEAN
813b7827c5f8 Remove "position" argument from file dialog functions (bug #60980).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29961
diff changeset
34 # endif
13721
ca90a6d59ab6 Prevent auto-inclusion of winsock.h in WIN32.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 12805
diff changeset
35
30196
813b7827c5f8 Remove "position" argument from file dialog functions (bug #60980).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29961
diff changeset
36 # include <string>
23024
a6a7b054e4ba Rationalize #includes in libinterp/dldfcn directory.
Rik <rik@octave.org>
parents: 22755
diff changeset
37
30196
813b7827c5f8 Remove "position" argument from file dialog functions (bug #60980).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29961
diff changeset
38 # include <FL/Fl.H>
813b7827c5f8 Remove "position" argument from file dialog functions (bug #60980).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29961
diff changeset
39 # include <FL/Fl_File_Chooser.H>
12205
be90f9e4548e #undef Complex after including FLTK headers
John W. Eaton <jwe@octave.org>
parents: 12193
diff changeset
40
be90f9e4548e #undef Complex after including FLTK headers
John W. Eaton <jwe@octave.org>
parents: 12193
diff changeset
41 // 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
42 // 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
43 // 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
44 // headers which may require Octave's Complex typedef.
30196
813b7827c5f8 Remove "position" argument from file dialog functions (bug #60980).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29961
diff changeset
45 # undef Complex
12205
be90f9e4548e #undef Complex after including FLTK headers
John W. Eaton <jwe@octave.org>
parents: 12193
diff changeset
46
15507
b9b9795a7cd9 build: Build FLTK-associated DOCSTRINGS even when HAVE_FLTK is 0 (bug #37541).
Rik <rik@octave.org>
parents: 15195
diff changeset
47 #endif
b9b9795a7cd9 build: Build FLTK-associated DOCSTRINGS even when HAVE_FLTK is 0 (bug #37541).
Rik <rik@octave.org>
parents: 15195
diff changeset
48
23024
a6a7b054e4ba Rationalize #includes in libinterp/dldfcn directory.
Rik <rik@octave.org>
parents: 22755
diff changeset
49 #include "dMatrix.h"
a6a7b054e4ba Rationalize #includes in libinterp/dldfcn directory.
Rik <rik@octave.org>
parents: 22755
diff changeset
50 #include "file-ops.h"
a6a7b054e4ba Rationalize #includes in libinterp/dldfcn directory.
Rik <rik@octave.org>
parents: 22755
diff changeset
51
a6a7b054e4ba Rationalize #includes in libinterp/dldfcn directory.
Rik <rik@octave.org>
parents: 22755
diff changeset
52 #include "Cell.h"
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
53 #include "defun-dld.h"
21126
ba0a4b4f021d include errwarn.h in files that use err_disabled_feature conditionally
John W. Eaton <jwe@octave.org>
parents: 21109
diff changeset
54 #include "errwarn.h"
23024
a6a7b054e4ba Rationalize #includes in libinterp/dldfcn directory.
Rik <rik@octave.org>
parents: 22755
diff changeset
55 #include "ov.h"
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
56
29958
32c3a5805893 move DEFUN and DEFMETHOD functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 29572
diff changeset
57 OCTAVE_NAMESPACE_BEGIN
32c3a5805893 move DEFUN and DEFMETHOD functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 29572
diff changeset
58
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
59 DEFUN_DLD (__fltk_uigetfile__, args, ,
21966
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21733
diff changeset
60 doc: /* -*- texinfo -*-
30888
32d2b6604a9f doc: Ensure documentation lists output argument when it exists for functions in libinterp/
Rik <rik@octave.org>
parents: 30564
diff changeset
61 @deftypefn {} {[@var{fname}, @var{fpath}, @var{fltidx}] =} __fltk_uigetfile__ (@dots{})
21966
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21733
diff changeset
62 Undocumented internal function.
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21733
diff changeset
63 @end deftypefn */)
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
64 {
21724
aba2e6293dd8 use "#if ..." consistently instead of "#ifdef" and "#ifndef"
John W. Eaton <jwe@octave.org>
parents: 21691
diff changeset
65 #if defined (HAVE_FLTK)
21691
263d18409fdf Eliminate unused variable warnings for conditionally compiled code.
John W. Eaton <jwe@octave.org>
parents: 21301
diff changeset
66
12206
6212f303243e __fltk_uigetfile__.cc: style fixes
John W. Eaton <jwe@octave.org>
parents: 12205
diff changeset
67 // Expected argument list:
6212f303243e __fltk_uigetfile__.cc: style fixes
John W. Eaton <jwe@octave.org>
parents: 12205
diff changeset
68 //
6212f303243e __fltk_uigetfile__.cc: style fixes
John W. Eaton <jwe@octave.org>
parents: 12205
diff changeset
69 // args(0) ... FileFilter in fltk format
6212f303243e __fltk_uigetfile__.cc: style fixes
John W. Eaton <jwe@octave.org>
parents: 12205
diff changeset
70 // args(1) ... Title
6212f303243e __fltk_uigetfile__.cc: style fixes
John W. Eaton <jwe@octave.org>
parents: 12205
diff changeset
71 // args(2) ... Default Filename
30196
813b7827c5f8 Remove "position" argument from file dialog functions (bug #60980).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29961
diff changeset
72 // args(3) ... 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
73
12206
6212f303243e __fltk_uigetfile__.cc: style fixes
John W. Eaton <jwe@octave.org>
parents: 12205
diff changeset
74 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
75
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
76 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
77 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
78 std::string default_name = args(2).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
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 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
81 std::string flabel = "Filename:";
12206
6212f303243e __fltk_uigetfile__.cc: style fixes
John W. Eaton <jwe@octave.org>
parents: 12205
diff changeset
82
30196
813b7827c5f8 Remove "position" argument from file dialog functions (bug #60980).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29961
diff changeset
83 std::string multi = args(3).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
84 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
85 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
86 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
87 {
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
88 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
89 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
90 }
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 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
92 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
93
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 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
95
6212f303243e __fltk_uigetfile__.cc: style fixes
John W. Eaton <jwe@octave.org>
parents: 12205
diff changeset
96 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
97 multi_type, title.c_str ());
6212f303243e __fltk_uigetfile__.cc: style fixes
John W. Eaton <jwe@octave.org>
parents: 12205
diff changeset
98
6212f303243e __fltk_uigetfile__.cc: style fixes
John W. Eaton <jwe@octave.org>
parents: 12205
diff changeset
99 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
100
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
101 if (multi_type == Fl_File_Chooser::CREATE)
12206
6212f303243e __fltk_uigetfile__.cc: style fixes
John W. Eaton <jwe@octave.org>
parents: 12205
diff changeset
102 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
103
12206
6212f303243e __fltk_uigetfile__.cc: style fixes
John W. Eaton <jwe@octave.org>
parents: 12205
diff changeset
104 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
105
12206
6212f303243e __fltk_uigetfile__.cc: style fixes
John W. Eaton <jwe@octave.org>
parents: 12205
diff changeset
106 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
107 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
108
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
109 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
110 {
12206
6212f303243e __fltk_uigetfile__.cc: style fixes
John W. Eaton <jwe@octave.org>
parents: 12205
diff changeset
111 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
112 std::string fname;
12466
67f98480b181 Use / for fltk path processing only
Kai Habel <kai.habel@gmx.de>
parents: 12206
diff changeset
113
23024
a6a7b054e4ba Rationalize #includes in libinterp/dldfcn directory.
Rik <rik@octave.org>
parents: 22755
diff changeset
114 // FLTK uses forward slash even for Windows
12466
67f98480b181 Use / for fltk path processing only
Kai Habel <kai.habel@gmx.de>
parents: 12206
diff changeset
115 std::string sep = "/";
29572
aef11bb4e6d1 use std::size_t and std::ptrdiff_t in C++ code (bug #60471)
John W. Eaton <jwe@octave.org>
parents: 29358
diff changeset
116 std::size_t idx;
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
117
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 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
119 {
12206
6212f303243e __fltk_uigetfile__.cc: style fixes
John W. Eaton <jwe@octave.org>
parents: 12205
diff changeset
120 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
121 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
122 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
123 }
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 {
14854
5ae9f0f77635 maint: Use Octave coding conventions for coddling parenthis is DLD-FUNCTIONS directory
Rik <octave@nomad.inbox5.com>
parents: 14846
diff changeset
126 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
127 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
128 {
12206
6212f303243e __fltk_uigetfile__.cc: style fixes
John W. Eaton <jwe@octave.org>
parents: 12205
diff changeset
129 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
130 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
131 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
132 }
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 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
134 }
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 if (multi_type == Fl_File_Chooser::DIRECTORY)
29961
7d6709900da7 eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents: 29958
diff changeset
137 retval(0) = sys::file_ops::native_separator_path (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
138 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
139 {
29961
7d6709900da7 eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
John W. Eaton <jwe@octave.org>
parents: 29958
diff changeset
140 retval(1) = sys::file_ops::native_separator_path (std::string (fc.directory ()) + sep);
12206
6212f303243e __fltk_uigetfile__.cc: style fixes
John W. Eaton <jwe@octave.org>
parents: 12205
diff changeset
141 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
142 }
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
143 }
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
144
12206
6212f303243e __fltk_uigetfile__.cc: style fixes
John W. Eaton <jwe@octave.org>
parents: 12205
diff changeset
145 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
146 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
147
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
148 return retval;
20825
66cd994d1b79 eliminate return statements after calls to error
John W. Eaton <jwe@octave.org>
parents: 19872
diff changeset
149
15507
b9b9795a7cd9 build: Build FLTK-associated DOCSTRINGS even when HAVE_FLTK is 0 (bug #37541).
Rik <rik@octave.org>
parents: 15195
diff changeset
150 #else
21691
263d18409fdf Eliminate unused variable warnings for conditionally compiled code.
John W. Eaton <jwe@octave.org>
parents: 21301
diff changeset
151
263d18409fdf Eliminate unused variable warnings for conditionally compiled code.
John W. Eaton <jwe@octave.org>
parents: 21301
diff changeset
152 octave_unused_parameter (args);
263d18409fdf Eliminate unused variable warnings for conditionally compiled code.
John W. Eaton <jwe@octave.org>
parents: 21301
diff changeset
153
21109
bd1752782e56 Use err_disabled_feature, warn_disabled_feature throughout code base.
Rik <rik@octave.org>
parents: 20843
diff changeset
154 err_disabled_feature ("__fltk_uigetfile__", "OpenGL and FLTK");
21691
263d18409fdf Eliminate unused variable warnings for conditionally compiled code.
John W. Eaton <jwe@octave.org>
parents: 21301
diff changeset
155
15507
b9b9795a7cd9 build: Build FLTK-associated DOCSTRINGS even when HAVE_FLTK is 0 (bug #37541).
Rik <rik@octave.org>
parents: 15195
diff changeset
156 #endif
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
157 }
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
158
12805
3641167e5b75 codesprint: *.cc helper functions do not need tests
Rik <octave@nomad.inbox5.com>
parents: 12565
diff changeset
159 /*
3641167e5b75 codesprint: *.cc helper functions do not need tests
Rik <octave@nomad.inbox5.com>
parents: 12565
diff changeset
160 ## 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
161 %!assert (1)
3641167e5b75 codesprint: *.cc helper functions do not need tests
Rik <octave@nomad.inbox5.com>
parents: 12565
diff changeset
162 */
29958
32c3a5805893 move DEFUN and DEFMETHOD functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 29572
diff changeset
163
32c3a5805893 move DEFUN and DEFMETHOD functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 29572
diff changeset
164 OCTAVE_NAMESPACE_END