1 # data file for the Fltk User Interface Designer (fluid)
3 header_name {../FL/Fl_File_Chooser.H}
6 // "$Id: Fl_File_Chooser.fl 8786 2011-06-07 11:41:36Z manolo $"
8 // Fl_File_Chooser dialog for the Fast Light Tool Kit (FLTK).
10 // Copyright 1998-2011 by Bill Spitzak and others.
12 // This library is free software; you can redistribute it and/or
13 // modify it under the terms of the GNU Library General Public
14 // License as published by the Free Software Foundation; either
15 // version 2 of the License, or (at your option) any later version.
17 // This library is distributed in the hope that it will be useful,
18 // but WITHOUT ANY WARRANTY; without even the implied warranty of
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 // Library General Public License for more details.
22 // You should have received a copy of the GNU Library General Public
23 // License along with this library; if not, write to the Free Software
24 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
27 // Please report all bugs and problems on the following page:
29 // http://www.fltk.org/str.php
31 } {in_source in_header
34 decl {\#include <FL/fl_draw.H>} {}
36 class FL_EXPORT Fl_File_Chooser {open
38 decl {enum { SINGLE = 0, MULTI = 1, CREATE = 2, DIRECTORY = 4 };} {public
40 decl {static Fl_Preferences prefs_;} {}
41 decl {void (*callback_)(Fl_File_Chooser*, void *);} {}
42 decl {void *data_;} {}
43 decl {char directory_[FL_PATH_MAX];} {}
44 decl {char pattern_[FL_PATH_MAX];} {}
45 decl {char preview_text_[2048];} {}
47 decl {void favoritesButtonCB();} {}
48 decl {void favoritesCB(Fl_Widget *w);} {}
49 decl {void fileListCB();} {}
50 decl {void fileNameCB();} {}
51 decl {void newdir();} {}
52 decl {static void previewCB(Fl_File_Chooser *fc);} {}
53 decl {void showChoiceCB();} {}
54 decl {void update_favorites();} {}
55 decl {void update_preview();} {}
56 Function {Fl_File_Chooser(const char *d, const char *p, int t, const char *title)} {} {
57 code {Fl_Group *prev_current = Fl_Group::current();} {}
60 callback {fileName->value("");
62 Fl::remove_timeout((Fl_Timeout_Handler)previewCB, this);
64 private xywh {507 327 490 380} type Double resizable
65 code0 {if (title) window->label(title);}
66 code1 {\#include <stdio.h>}
67 code2 {\#include <stdlib.h>}
68 code3 {\#include <string.h>} modal visible
71 private xywh {10 10 470 25}
73 Fl_Choice showChoice {
75 callback {showChoiceCB();} open
76 private xywh {65 10 215 25} down_box BORDER_BOX labelfont 1 resizable
77 code0 {showChoice->label(show_label);}
79 Fl_Menu_Button favoritesButton {
81 callback {favoritesButtonCB();} open
82 private xywh {290 10 155 25} down_box BORDER_BOX align 20
83 code0 {favoritesButton->label(favorites_label);}
87 image {new.xbm} xywh {455 10 25 25} labelsize 8
88 code0 {\#include <FL/Fl_Preferences.H>}
89 code1 {o->tooltip(new_directory_tooltip);}
93 callback {update_preview();}
94 private xywh {10 45 470 225} resizable
96 Fl_File_Browser fileList {
97 callback {fileListCB();}
98 private xywh {10 45 295 225} type Hold hotspot
99 code0 {\#include <FL/Fl_File_Browser.H>}
103 private xywh {305 45 175 225} box DOWN_BOX labelsize 100 align 80
107 private xywh {10 275 470 95}
110 private xywh {10 275 470 20}
112 Fl_Check_Button previewButton {
114 callback {preview(previewButton->value());}
115 xywh {10 275 73 20} down_box DOWN_BOX shortcut 0x80070 value 1
116 code0 {previewButton->label(preview_label);}
118 Fl_Check_Button showHiddenButton {
119 label {Show hidden files}
120 callback {showHidden(showHiddenButton->value());}
121 xywh {115 275 165 20} down_box DOWN_BOX
122 code0 {showHiddenButton->label(hidden_label);}
125 private xywh {115 275 365 20} resizable
128 Fl_File_Input fileName {
129 callback {fileNameCB();}
130 private xywh {115 300 365 35} labelfont 1 when 8 resizable
131 code0 {fileName->when(FL_WHEN_CHANGED | FL_WHEN_ENTER_KEY);}
135 private xywh {10 310 105 25} labelfont 1 align 24
136 code0 {o->label(filename_label);}
139 private xywh {10 345 470 25}
141 Fl_Return_Button okButton {
143 callback {window->hide();
145 // Do any callback that is registered...
147 (*callback_)(this, data_);}
148 private xywh {313 345 85 25}
149 code0 {\#include <FL/fl_ask.H>}
150 code1 {okButton->label(fl_ok);}
152 Fl_Button cancelButton {
154 callback {fileName->value("");
155 fileList->deselect();
156 Fl::remove_timeout((Fl_Timeout_Handler)previewCB, this);
158 private xywh {408 345 72 25}
159 code0 {o->label(fl_cancel);}
162 private xywh {10 345 30 25} resizable
167 Fl_Window favWindow {
168 label {Manage Favorites}
169 private xywh {413 100 355 150} type Double resizable
170 code0 {favWindow->label(manage_favorites_label);} modal size_range {181 150 0 0} visible
172 Fl_File_Browser favList {
173 callback {favoritesCB(favList);}
174 private xywh {10 10 300 95} type Hold resizable
179 Fl_Button favUpButton {
181 callback {favoritesCB(favUpButton);}
182 private xywh {320 10 25 25}
184 Fl_Button favDeleteButton {
186 callback {favoritesCB(favDeleteButton);}
187 private xywh {320 45 25 25} labelfont 1 resizable
189 Fl_Button favDownButton {
191 callback {favoritesCB(favDownButton);}
192 private xywh {320 80 25 25}
198 Fl_Button favCancelButton {
200 callback {favWindow->hide();}
201 private xywh {273 115 72 25}
202 code0 {favCancelButton->label(fl_cancel);}
204 Fl_Return_Button favOkButton {
206 callback {favoritesCB(favOkButton);}
207 private xywh {181 115 79 25}
208 code0 {\#include <FL/fl_ask.H>}
209 code1 {favOkButton->label(save_label);}
212 xywh {10 115 161 25} resizable
219 window->size_range(window->w(), window->h(), Fl::w(), Fl::h());
226 prefs_.get("preview", e, 1);
228 Fl_Group::current(prev_current);} {}
229 code {ext_group=(Fl_Widget*)0;} {}
231 Function {~Fl_File_Chooser()} {open
233 code {Fl::remove_timeout((Fl_Timeout_Handler)previewCB, this);
234 if(ext_group)window->remove(ext_group);
236 delete favWindow;} {}
238 Function {callback(void (*cb)(Fl_File_Chooser *, void *), void *d = 0)} {return_type void
240 code {callback_ = cb;
243 Function {color(Fl_Color c)} {} {
244 code {fileList->color(c);} {}
246 Function {color()} {return_type Fl_Color
248 code {return (fileList->color());} {}
250 decl {int count();} {public
252 decl {void directory(const char *d);} {public
254 Function {directory()} {return_type {char *}
256 code {return directory_;} {}
258 decl {void filter(const char *p);} {public
260 Function {filter()} {return_type {const char *}
262 code {return (fileList->filter());} {}
264 Function {filter_value()} {return_type int
266 code {return showChoice->value();} {}
268 Function {filter_value(int f)} {return_type void
270 code {showChoice->value(f);
273 Function {hide()} {return_type void
275 code {window->hide();} {}
277 Function {iconsize(uchar s)} {return_type void
279 code {fileList->iconsize(s);} {}
281 Function {iconsize()} {return_type uchar
283 code {return (fileList->iconsize());} {}
285 Function {label(const char *l)} {return_type void
287 code {window->label(l);} {}
289 Function {label()} {return_type {const char *}
291 code {return (window->label());} {}
293 Function {ok_label(const char *l)} {return_type void
295 code {okButton->label(l);
297 okButton->measure_label(w, h);
298 okButton->resize(cancelButton->x() - 50 - w, cancelButton->y(),
300 okButton->parent()->init_sizes();} {}
302 Function {ok_label()} {return_type {const char *}
304 code {return (okButton->label());} {}
306 decl {void preview(int e);} {public
308 decl {int preview() const { return previewButton->value(); }} {public
310 decl {void showHidden(int e);} {private
312 decl {void remove_hidden_files();} {private
314 decl {void rescan();} {public
316 decl {void rescan_keep_filename();} {public
318 decl {void show();} {public
320 Function {shown()} {return_type int
322 code {return window->shown();} {}
324 Function {textcolor(Fl_Color c)} {return_type void
326 code {fileList->textcolor(c);} {}
328 Function {textcolor()} {return_type Fl_Color
330 code {return (fileList->textcolor());} {}
332 Function {textfont(Fl_Font f)} {return_type void
334 code {fileList->textfont(f);} {}
336 Function {textfont()} {selected return_type Fl_Font
338 code {return (fileList->textfont());} {}
340 Function {textsize(Fl_Fontsize s)} {return_type void
342 code {fileList->textsize(s);} {}
344 Function {textsize()} {return_type Fl_Fontsize
346 code {return (fileList->textsize());} {}
348 Function {type(int t)} {return_type void
352 fileList->type(FL_MULTI_BROWSER);
354 fileList->type(FL_HOLD_BROWSER);
356 newButton->activate();
358 newButton->deactivate();
360 fileList->filetype(Fl_File_Browser::DIRECTORIES);
362 fileList->filetype(Fl_File_Browser::FILES);} {}
364 Function {type()} {return_type int
366 code {return (type_);} {}
368 Function {user_data() const} {return_type {void *}
370 code {return (data_);} {}
372 Function {user_data(void *d)} {return_type void
376 decl {const char *value(int f = 1);} {public
378 decl {void value(const char *filename);} {public
380 Function {visible()} {return_type int
382 code {return window->visible();} {}
384 decl {static const char *add_favorites_label;} {
385 comment {[standard text may be customized at run-time]} public
387 decl {static const char *all_files_label;} {
388 comment {[standard text may be customized at run-time]} public
390 decl {static const char *custom_filter_label;} {
391 comment {[standard text may be customized at run-time]} public
393 decl {static const char *existing_file_label;} {
394 comment {[standard text may be customized at run-time]} public
396 decl {static const char *favorites_label;} {
397 comment {[standard text may be customized at run-time]} public
399 decl {static const char *filename_label;} {
400 comment {[standard text may be customized at run-time]} public
402 decl {static const char *filesystems_label;} {
403 comment {[standard text may be customized at run-time]} public
405 decl {static const char *manage_favorites_label;} {
406 comment {[standard text may be customized at run-time]} public
408 decl {static const char *new_directory_label;} {
409 comment {[standard text may be customized at run-time]} public
411 decl {static const char *new_directory_tooltip;} {
412 comment {[standard text may be customized at run-time]} public
414 decl {static const char *preview_label;} {
415 comment {[standard text may be customized at run-time]} public
417 decl {static const char *save_label;} {
418 comment {[standard text may be customized at run-time]} public
420 decl {static const char *show_label;} {
421 comment {[standard text may be customized at run-time]} public
423 decl {static const char *hidden_label;} {
424 comment {[standard text may be customized at run-time]} public
426 decl {static Fl_File_Sort_F *sort;} {
427 comment {the sort function that is used when loading
428 the contents of a directory.} public
430 decl {Fl_Widget* ext_group;} {}
431 Function {add_extra(Fl_Widget* gr)} {open return_type {Fl_Widget*}
433 code {Fl_Widget* ret=ext_group;} {}
434 codeblock {if (gr==ext_group)} {open
436 code {return ret;} {}
438 codeblock {if (ext_group)} {open
440 code {int sh=ext_group->h()+4;
441 Fl_Widget* svres=window->resizable();
442 window->resizable(NULL);
443 window->size(window->w(),window->h()-sh);
444 window->remove(ext_group);
446 window->resizable(svres);} {}
448 codeblock {if (gr)} {open
450 code {int nh=window->h()+gr->h()+4;
451 Fl_Widget* svres=window->resizable();
452 window->resizable(NULL);
453 window->size(window->w(),nh);
454 gr->position(2,okButton->y()+okButton->h()+2);
457 window->resizable(svres);} {}
459 code {return ret;} {}
463 decl {FL_EXPORT char *fl_dir_chooser(const char *message,const char *fname,int relative=0);} {public
466 decl {FL_EXPORT char *fl_file_chooser(const char *message,const char *pat,const char *fname,int relative=0);} {public
469 decl {FL_EXPORT void fl_file_chooser_callback(void (*cb)(const char*));} {public
472 decl {FL_EXPORT void fl_file_chooser_ok_label(const char*l);} {public
477 // End of "$Id: Fl_File_Chooser.fl 8786 2011-06-07 11:41:36Z manolo $".
478 //} {in_source in_header