# data file for the Fltk User Interface Designer (fluid) version 1.0100 header_name {../FL/Fl_File_Chooser.H} code_name {.cxx} class Fl_File_Chooser {open } { decl {enum { SINGLE = 0, MULTI = 1, CREATE = 2, DIRECTORY = 4 };} {public } Function {Fl_File_Chooser(const char *d, const char *p, int t, const char *title)} {open } { Fl_Window window { label {Pick a File} callback {fileName->value(directory_); window->hide();} open private xywh {99 225 375 325} resizable code0 {if (title) window->label(title);} code1 {\#include } code2 {\#include } code3 {\#include } modal visible } { Fl_Choice dirMenu { label {Directory:} callback {char pathname[1024]; int i; pathname[0] = '\\0'; 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(filter_label, fileList->filter())) != NULL) { fileList->filter(f); rescan(); }} private tooltip {Change the filename filter.} image {allfiles.xbm} xywh {340 10 25 25} labelsize 28 labelcolor 4 align 16 code0 {\#include } } Fl_Browser fileList { callback {fileListCB();} private xywh {10 45 355 180} type Hold resizable hotspot code0 {\#include } class Fl_File_Browser } Fl_File_Input fileName { label {Filename:} callback {fileNameCB();} private xywh {10 245 355 35} 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 290 75 25} code0 {\#include } code1 {okButton->label(fl_ok);} } Fl_Button {} { label Cancel callback {fileName->value(directory_); window->hide();} private xywh {285 290 80 25} code0 {o->label(fl_cancel);} } } code {window->size_range(375, 315, 375); fileList->filter(p); type(t); value(d); callback_ = 0; data_ = 0;} {} } decl {void (*callback_)(Fl_File_Chooser*, void *);} {} decl {void *data_;} {} decl {char directory_[1024];} {} decl {int type_;} {} decl {void fileListCB();} {} decl {void fileNameCB();} {} decl {void newdir();} {} decl {void up();} {} Function {callback(void (*cb)(Fl_File_Chooser *, void *), void *d)} {return_type void } { code {callback_ = cb; data_ = d;} {} } Function {color(Fl_Color c)} {} { code {fileList->color(c);} {} } Function {color()} {return_type Fl_Color } { code {return (fileList->color());} {} } decl {int count();} {public } decl {void directory(const char *d);} {public } Function {directory()} {return_type {char *} } { code {return directory_;} {} } Function {filter(const char *p)} {return_type void } { code {fileList->filter(p); rescan();} {} } Function {filter()} {return_type {const char *} } { code {return (fileList->filter());} {} } Function {hide()} {return_type void } { code {window->hide();} {} } Function {iconsize(uchar s)} {return_type void } { code {fileList->iconsize(s);} {} } Function {iconsize()} {return_type uchar } { code {return (fileList->iconsize());} {} } Function {label(const char *l)} {return_type void } { code {window->label(l);} {} } Function {label()} {return_type {const char *} } { code {return (window->label());} {} } decl {void rescan();} {public } Function {show()} {open return_type void } { code {window->hotspot(fileList); window->show(); fileName->take_focus();} {} } Function {shown()} {return_type int } { code {return window->shown();} {} } Function {textcolor(Fl_Color c)} {return_type void } { code {fileList->textcolor(c);} {} } Function {textcolor()} {return_type Fl_Color } { code {return (fileList->textcolor());} {} } Function {textfont(uchar f)} {return_type void } { code {fileList->textfont(f);} {} } Function {textfont()} {return_type uchar } { code {return (fileList->textfont());} {} } Function {textsize(uchar s)} {return_type void } { code {fileList->textsize(s);} {} } Function {textsize()} {return_type uchar } { code {return (fileList->textsize());} {} } Function {type(int t)} {return_type void } { code {type_ = t; if (t & MULTI) fileList->type(FL_MULTI_BROWSER); else fileList->type(FL_HOLD_BROWSER); if (t & CREATE) newButton->deactivate(); else newButton->activate(); if (t & DIRECTORY) fileList->filetype(Fl_File_Browser::DIRECTORIES); else fileList->filetype(Fl_File_Browser::FILES);} {} } Function {type()} {return_type int } { code {return (type_);} {} } decl {const char *value(int f = 1);} {public } decl {void value(const char *filename);} {public } Function {visible()} {return_type int } { code {return window->visible();} {} } decl {static const char *directory_label;} {public } decl {static const char *filename_label;} {public } decl {static const char *filter_label;} {public } } decl {FL_EXPORT char *fl_dir_chooser(const char *message,const char *fname,int relative=0);} {public } decl {FL_EXPORT char *fl_file_chooser(const char *message,const char *pat,const char *fname,int relative=0);} {selected public } decl {FL_EXPORT void fl_file_chooser_callback(void (*cb)(const char*));} {public }