diff options
Diffstat (limited to 'src/Fl_File_Chooser.fl')
| -rw-r--r-- | src/Fl_File_Chooser.fl | 91 |
1 files changed, 49 insertions, 42 deletions
diff --git a/src/Fl_File_Chooser.fl b/src/Fl_File_Chooser.fl index 456e5af00..f29b6f6c2 100644 --- a/src/Fl_File_Chooser.fl +++ b/src/Fl_File_Chooser.fl @@ -22,45 +22,6 @@ window->hide();} open code2 {\#include <stdlib.h>} code3 {\#include <string.h>} modal visible } { - Fl_Browser fileList { - callback {fileListCB();} - private xywh {10 45 355 180} type Hold resizable hotspot - code0 {\#include <FL/Fl_File_Browser.H>} - class Fl_File_Browser - } - Fl_Button {} { - label Cancel - callback {fileList->deselect(); -fileName->value(""); -window->hide();} - private xywh {285 280 80 25} - code0 {o->label(fl_cancel);} - } - Fl_Return_Button okButton { - label OK - callback {// Do any callback that is registered... -if (callback_) - (*callback_)(this, data_); - -window->hide();} - private xywh {200 280 75 25} - code0 {\#include <FL/fl_ask.H>} - code1 {okButton->label(fl_ok);} - } - Fl_Input fileName { - label {Filename:} - callback {fileNameCB();} - private xywh {10 245 355 25} align 5 when 8 - code0 {fileName->when(FL_WHEN_CHANGED | FL_WHEN_ENTER_KEY_ALWAYS);} - } - Fl_Button upButton { - callback {up();} - private tooltip {Show the parent directory.} image {up.xbm} xywh {280 10 25 25} labelsize 8 - } - Fl_Button newButton { - callback {newdir();} - private tooltip {Create a new directory.} image {new.xbm} xywh {310 10 25 25} labelsize 8 - } Fl_Choice dirMenu { label {Directory:} callback {char pathname[1024]; @@ -71,10 +32,19 @@ for (i = 1; i <= dirMenu->value(); i ++) strcat(pathname, dirMenu->text(i)); directory(pathname);} open private tooltip {Choose a parent directory.} xywh {95 10 180 25} down_box BORDER_BOX + code0 {dirMenu->label(directory_label);} } {} + Fl_Button upButton { + callback {up();} + private tooltip {Show the parent directory.} image {up.xbm} xywh {280 10 25 25} labelsize 8 + } + Fl_Button newButton { + callback {newdir();} + private tooltip {Create a new directory.} image {new.xbm} xywh {310 10 25 25} labelsize 8 + } Fl_Button {} { callback {const char *f; -if ((f = fl_input("New Filter?", +if ((f = fl_input(filter_label, fileList->filter())) != NULL) { fileList->filter(f); @@ -83,6 +53,38 @@ if ((f = fl_input("New Filter?", private tooltip {Change the filename filter.} image {allfiles.xbm} xywh {340 10 25 25} labelsize 28 labelcolor 4 align 16 code0 {\#include <FL/fl_ask.H>} } + Fl_Browser fileList { + callback {fileListCB();} + private xywh {10 45 355 180} type Hold resizable hotspot + code0 {\#include <FL/Fl_File_Browser.H>} + class Fl_File_Browser + } + Fl_Input fileName { + label {Filename:} + callback {fileNameCB();} + private xywh {10 245 355 25} align 5 when 8 + code0 {fileName->when(FL_WHEN_CHANGED | FL_WHEN_ENTER_KEY_ALWAYS);} + code1 {fileName->label(filename_label);} + } + Fl_Return_Button okButton { + label OK + callback {// Do any callback that is registered... +if (callback_) + (*callback_)(this, data_); + +window->hide();} + private xywh {200 280 75 25} + code0 {\#include <FL/fl_ask.H>} + code1 {okButton->label(fl_ok);} + } + Fl_Button {} { + label Cancel + callback {fileList->deselect(); +fileName->value(""); +window->hide();} + private xywh {285 280 80 25} + code0 {o->label(fl_cancel);} + } } code {window->size_range(375, 315, 375); fileList->filter(p); @@ -154,8 +156,7 @@ rescan();} {} } { code {window->hotspot(fileList); window->show(); -fileList->deselect();} {selected - } +fileList->deselect();} {} } Function {shown()} {return_type int } { @@ -213,6 +214,12 @@ else } { code {return window->visible();} {} } + decl {static const char *directory_label = "Directory:";} {public + } + decl {static const char *filename_label = "Filename:";} {public + } + decl {static const char *filter_label = "New Filter?";} {selected public + } } decl {FL_EXPORT char *fl_dir_chooser(const char *message,const char *fname);} {public |
