source: rtems-graphics-toolkit/fltk-1.1.10/src/Fl_File_Chooser.fl @ 513eea1

Last change on this file since 513eea1 was 513eea1, checked in by Joel Sherrill <joel.sherrill@…>, on 01/09/10 at 22:43:24

2010-01-08 Joel Sherrill <joel.sherrill@…>

fltk 1.1.10. imported

  • ORIGIN: Updated.
  • Property mode set to 100644
File size: 11.9 KB
Line 
1# data file for the Fltk User Interface Designer (fluid)
2version 1.0108
3header_name {../FL/Fl_File_Chooser.H}
4code_name {.cxx}
5comment {//
6// "$Id$"
7//
8// Fl_File_Chooser dialog for the Fast Light Tool Kit (FLTK).
9//
10// Copyright 1998-2005 by Bill Spitzak and others.
11//
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.
16//
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.
21//
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
25// USA.
26//
27// Please report all bugs and problems on the following page:
28//
29//     http://www.fltk.org/str.php
30//
31} {in_source in_header
32}
33
34decl {\#include <FL/fl_draw.H>} {}
35
36class FL_EXPORT Fl_File_Chooser {open
37} {
38  decl {enum { SINGLE = 0, MULTI = 1, CREATE = 2, DIRECTORY = 4 };} {public
39  }
40  decl {static Fl_Preferences prefs_;} {}
41  decl {void (*callback_)(Fl_File_Chooser*, void *);} {}
42  decl {void *data_;} {}
43  decl {char directory_[1024];} {}
44  decl {char pattern_[1024];} {}
45  decl {char preview_text_[2048];} {}
46  decl {int type_;} {}
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)} {open
57  } {
58    code {Fl_Group *prev_current = Fl_Group::current();} {}
59    Fl_Window window {
60      label {Choose File}
61      callback {fileName->value("");
62fileList->deselect();
63Fl::remove_timeout((Fl_Timeout_Handler)previewCB, this);
64window->hide();} open
65      private xywh {388 284 490 380} type Double resizable
66      code0 {if (title) window->label(title);}
67      code1 {\#include <stdio.h>}
68      code2 {\#include <stdlib.h>}
69      code3 {\#include <string.h>} modal visible
70    } {
71      Fl_Group {} {
72        private xywh {10 10 470 25}
73      } {
74        Fl_Choice showChoice {
75          label {Show:}
76          callback {showChoiceCB();} open
77          private xywh {65 10 215 25} down_box BORDER_BOX labelfont 1 resizable
78          code0 {showChoice->label(show_label);}
79        } {}
80        Fl_Menu_Button favoritesButton {
81          label Favorites
82          callback {favoritesButtonCB();} open
83          private xywh {290 10 155 25} down_box BORDER_BOX align 20
84          code0 {favoritesButton->label(favorites_label);}
85        } {}
86        Fl_Button newButton {
87          callback {newdir();}
88          image {new.xbm} xywh {455 10 25 25} labelsize 8
89          code0 {\#include <FL/Fl_Preferences.H>}
90          code1 {o->tooltip(new_directory_tooltip);}
91        }
92      }
93      Fl_Tile {} {
94        callback {update_preview();}
95        private xywh {10 45 470 225} resizable
96      } {
97        Fl_File_Browser fileList {
98          callback {fileListCB();}
99          private xywh {10 45 295 225} type Hold hotspot
100          code0 {\#include <FL/Fl_File_Browser.H>}
101        }
102        Fl_Box previewBox {
103          label {?} selected
104          private xywh {305 45 175 225} box DOWN_BOX labelsize 100 align 80
105        }
106      }
107      Fl_Group {} {open
108        private xywh {10 275 470 95}
109      } {
110        Fl_Group {} {open
111          private xywh {10 275 470 20}
112        } {
113          Fl_Check_Button previewButton {
114            label Preview
115            callback {preview(previewButton->value());}
116            xywh {10 275 73 20} down_box DOWN_BOX shortcut 0x80070 value 1
117            code0 {previewButton->label(preview_label);}
118          }
119          Fl_Box {} {
120            private xywh {115 275 365 20} resizable
121          }
122        }
123        Fl_File_Input fileName {
124          callback {fileNameCB();}
125          private xywh {115 300 365 35} labelfont 1 when 8 resizable
126          code0 {fileName->when(FL_WHEN_CHANGED | FL_WHEN_ENTER_KEY);}
127        }
128        Fl_Box {} {
129          label {Filename:}
130          private xywh {10 310 105 25} labelfont 1 align 24
131          code0 {o->label(filename_label);}
132        }
133        Fl_Group {} {open
134          private xywh {10 345 470 25}
135        } {
136          Fl_Return_Button okButton {
137            label OK
138            callback {window->hide();
139
140// Do any callback that is registered...
141if (callback_)
142  (*callback_)(this, data_);}
143            private xywh {313 345 85 25}
144            code0 {\#include <FL/fl_ask.H>}
145            code1 {okButton->label(fl_ok);}
146          }
147          Fl_Button cancelButton {
148            label Cancel
149            callback {fileName->value("");
150fileList->deselect();
151Fl::remove_timeout((Fl_Timeout_Handler)previewCB, this);
152window->hide();}
153            private xywh {408 345 72 25}
154            code0 {o->label(fl_cancel);}
155          }
156          Fl_Box {} {
157            private xywh {10 345 30 25} resizable
158          }
159        }
160      }
161    }
162    Fl_Window favWindow {
163      label {Manage Favorites}
164      private xywh {413 100 355 150} type Double resizable
165      code0 {favWindow->label(manage_favorites_label);} modal size_range {181 150 0 0} visible
166    } {
167      Fl_File_Browser favList {
168        callback {favoritesCB(favList);}
169        private xywh {10 10 300 95} type Hold resizable
170      }
171      Fl_Group {} {open
172        xywh {320 10 25 95}
173      } {
174        Fl_Button favUpButton {
175          label {@8>}
176          callback {favoritesCB(favUpButton);}
177          private xywh {320 10 25 25}
178        }
179        Fl_Button favDeleteButton {
180          label X
181          callback {favoritesCB(favDeleteButton);}
182          private xywh {320 45 25 25} labelfont 1 resizable
183        }
184        Fl_Button favDownButton {
185          label {@2>}
186          callback {favoritesCB(favDownButton);}
187          private xywh {320 80 25 25}
188        }
189      }
190      Fl_Group {} {open
191        xywh {10 113 335 29}
192      } {
193        Fl_Button favCancelButton {
194          label Cancel
195          callback {favWindow->hide();}
196          private xywh {273 115 72 25}
197          code0 {favCancelButton->label(fl_cancel);}
198        }
199        Fl_Return_Button favOkButton {
200          label Save
201          callback {favoritesCB(favOkButton);}
202          private xywh {181 115 79 25}
203          code0 {\#include <FL/fl_ask.H>}
204          code1 {favOkButton->label(save_label);}
205        }
206        Fl_Box {} {
207          xywh {10 115 161 25} resizable
208        }
209      }
210    }
211    code {callback_ = 0;
212data_ = 0;
213directory_[0] = 0;
214window->size_range(window->w(), window->h(), Fl::w(), Fl::h());
215type(t);
216filter(p);
217update_favorites();
218value(d);
219type(t);
220int e;
221prefs_.get("preview", e, 1);
222preview(e);
223Fl_Group::current(prev_current);} {}
224  }
225  Function {~Fl_File_Chooser()} {} {
226    code {Fl::remove_timeout((Fl_Timeout_Handler)previewCB, this);
227delete window;
228delete favWindow;} {}
229  }
230  Function {callback(void (*cb)(Fl_File_Chooser *, void *), void *d = 0)} {return_type void
231  } {
232    code {callback_ = cb;
233data_     = d;} {}
234  }
235  Function {color(Fl_Color c)} {} {
236    code {fileList->color(c);} {}
237  }
238  Function {color()} {return_type Fl_Color
239  } {
240    code {return (fileList->color());} {}
241  }
242  decl {int count();} {public
243  }
244  decl {void directory(const char *d);} {public
245  }
246  Function {directory()} {return_type {char *}
247  } {
248    code {return directory_;} {}
249  }
250  decl {void filter(const char *p);} {public
251  }
252  Function {filter()} {return_type {const char *}
253  } {
254    code {return (fileList->filter());} {}
255  }
256  Function {filter_value()} {return_type int
257  } {
258    code {return showChoice->value();} {}
259  }
260  Function {filter_value(int f)} {return_type void
261  } {
262    code {showChoice->value(f);
263showChoiceCB();} {}
264  }
265  Function {hide()} {return_type void
266  } {
267    code {window->hide();} {}
268  }
269  Function {iconsize(uchar s)} {return_type void
270  } {
271    code {fileList->iconsize(s);} {}
272  }
273  Function {iconsize()} {return_type uchar
274  } {
275    code {return (fileList->iconsize());} {}
276  }
277  Function {label(const char *l)} {return_type void
278  } {
279    code {window->label(l);} {}
280  }
281  Function {label()} {return_type {const char *}
282  } {
283    code {return (window->label());} {}
284  }
285  Function {ok_label(const char *l)} {return_type void
286  } {
287    code {okButton->label(l);
288int w=0, h=0;
289okButton->measure_label(w, h);
290okButton->resize(cancelButton->x() - 50 - w, cancelButton->y(),
291                 w + 40, 25);
292okButton->parent()->init_sizes();} {}
293  }
294  Function {ok_label()} {return_type {const char *}
295  } {
296    code {return (okButton->label());} {}
297  }
298  decl {void preview(int e);} {public
299  }
300  decl {int preview() const { return previewButton->value(); }} {public
301  }
302  decl {void rescan();} {public
303  }
304  decl {void rescan_keep_filename();} {public
305  }
306  Function {show()} {open return_type void
307  } {
308    code {window->hotspot(fileList);
309window->show();
310Fl::flush();
311fl_cursor(FL_CURSOR_WAIT);
312rescan_keep_filename();
313fl_cursor(FL_CURSOR_DEFAULT);
314fileName->take_focus();} {}
315  }
316  Function {shown()} {return_type int
317  } {
318    code {return window->shown();} {}
319  }
320  Function {textcolor(Fl_Color c)} {return_type void
321  } {
322    code {fileList->textcolor(c);} {}
323  }
324  Function {textcolor()} {return_type Fl_Color
325  } {
326    code {return (fileList->textcolor());} {}
327  }
328  Function {textfont(uchar f)} {return_type void
329  } {
330    code {fileList->textfont(f);} {}
331  }
332  Function {textfont()} {return_type uchar
333  } {
334    code {return (fileList->textfont());} {}
335  }
336  Function {textsize(uchar s)} {return_type void
337  } {
338    code {fileList->textsize(s);} {}
339  }
340  Function {textsize()} {return_type uchar
341  } {
342    code {return (fileList->textsize());} {}
343  }
344  Function {type(int t)} {return_type void
345  } {
346    code {type_ = t;
347if (t & MULTI)
348  fileList->type(FL_MULTI_BROWSER);
349else
350  fileList->type(FL_HOLD_BROWSER);
351if (t & CREATE)
352  newButton->activate();
353else
354  newButton->deactivate();
355if (t & DIRECTORY)
356  fileList->filetype(Fl_File_Browser::DIRECTORIES);
357else
358  fileList->filetype(Fl_File_Browser::FILES);} {}
359  }
360  Function {type()} {return_type int
361  } {
362    code {return (type_);} {}
363  }
364  Function {user_data() const} {return_type {void *}
365  } {
366    code {return (data_);} {}
367  }
368  Function {user_data(void *d)} {return_type void
369  } {
370    code {data_ = d;} {}
371  }
372  decl {const char *value(int f = 1);} {public
373  }
374  decl {void value(const char *filename);} {public
375  }
376  Function {visible()} {return_type int
377  } {
378    code {return window->visible();} {}
379  }
380  decl {static const char *add_favorites_label;} {public
381  }
382  decl {static const char *all_files_label;} {public
383  }
384  decl {static const char *custom_filter_label;} {public
385  }
386  decl {static const char *existing_file_label;} {public
387  }
388  decl {static const char *favorites_label;} {public
389  }
390  decl {static const char *filename_label;} {public
391  }
392  decl {static const char *filesystems_label;} {public
393  }
394  decl {static const char *manage_favorites_label;} {public
395  }
396  decl {static const char *new_directory_label;} {public
397  }
398  decl {static const char *new_directory_tooltip;} {public
399  }
400  decl {static const char *preview_label;} {public
401  }
402  decl {static const char *save_label;} {public
403  }
404  decl {static const char *show_label;} {public
405  }
406  decl {static Fl_File_Sort_F *sort;} {public
407  }
408}
409
410decl {FL_EXPORT char *fl_dir_chooser(const char *message,const char *fname,int relative=0);} {public
411}
412
413decl {FL_EXPORT char *fl_file_chooser(const char *message,const char *pat,const char *fname,int relative=0);} {public
414}
415
416decl {FL_EXPORT void fl_file_chooser_callback(void (*cb)(const char*));} {public
417}
418
419decl {FL_EXPORT void fl_file_chooser_ok_label(const char*l);} {public
420}
421
422comment {
423//
424// End of "$Id$".
425//} {in_source in_header
426}
Note: See TracBrowser for help on using the repository browser.