26 #if defined (HAVE_CONFIG_H)
30 #if defined (HAVE_FLTK)
33 # define WIN32_LEAN_AND_MEAN
39 #include <FL/Fl_File_Chooser.H>
63 #if defined (HAVE_FLTK)
75 std::string file_filter = args(0).string_value ();
76 std::string title = args(1).string_value ();
77 std::string default_name = args(2).string_value ();
78 Matrix pos = args(3).matrix_value ();
80 int multi_type = Fl_File_Chooser::SINGLE;
81 std::string flabel =
"Filename:";
83 std::string multi = args(4).string_value ();
85 multi_type = Fl_File_Chooser::MULTI;
86 else if (multi ==
"dir")
88 multi_type = Fl_File_Chooser::DIRECTORY;
89 flabel =
"Directory:";
91 else if (multi ==
"create")
92 multi_type = Fl_File_Chooser::CREATE;
94 Fl_File_Chooser::filename_label = flabel.c_str ();
96 Fl_File_Chooser fc (default_name.c_str (), file_filter.c_str (),
97 multi_type, title.c_str ());
101 if (multi_type == Fl_File_Chooser::CREATE)
102 fc.ok_label (
"Save");
111 int file_count = fc.count ();
115 std::string sep =
"/";
118 if (file_count == 1 && multi_type != Fl_File_Chooser::DIRECTORY)
121 idx = fname.find_last_of (sep);
122 retval(0) = fname.substr (idx + 1);
126 Cell file_cell =
Cell (file_count, 1);
129 fname = fc.value (
n);
130 idx = fname.find_last_of (sep);
131 file_cell(
n - 1) = fname.substr (idx + 1);
136 if (multi_type == Fl_File_Chooser::DIRECTORY)
141 retval(2) = fc.filter_value () + 1;
152 octave_unused_parameter (args);
#define DEFUN_DLD(name, args_name, nargout_name, doc)
Macro to define an at run time dynamically loadable builtin function.
void err_disabled_feature(const std::string &fcn, const std::string &feature, const std::string &pkg)
std::string native_separator_path(const std::string &path)
octave_value::octave_value(const Array< char > &chm, char type) return retval