diff options
Diffstat (limited to 'src/Fl_FileChooser.fl')
| -rw-r--r-- | src/Fl_FileChooser.fl | 129 |
1 files changed, 57 insertions, 72 deletions
diff --git a/src/Fl_FileChooser.fl b/src/Fl_FileChooser.fl index 5fa2d22bd..0ac411656 100644 --- a/src/Fl_FileChooser.fl +++ b/src/Fl_FileChooser.fl @@ -1,16 +1,10 @@ -# data file for the FLTK User Interface Designer (FLUID) -version 2.0000 -images_dir ./ -do_not_include_H_from_C -header_name {.H} +# data file for the Fltk User Interface Designer (fluid) +version 1.0100 +header_name {../FL/Fl_FileChooser.H} code_name {.cxx} gridx 5 gridy 5 snap 3 -decl {\#include <fltk/Fl_FileChooser.h>} {} - -decl {\#include <config.h>} {} - class Fl_FileChooser {open } { decl {enum { SINGLE, MULTI, CREATE };} {public @@ -22,74 +16,68 @@ class Fl_FileChooser {open callback {fileList->deselect(); fileName->value(""); window->hide();} open - xywh {269 372 375 315} resizable hotspot + private xywh {208 292 375 315} resizable hotspot code0 {if (title) window->label(title);} code1 {\#include <stdio.h>} code2 {\#include <stdlib.h>} code3 {\#include <string.h>} modal visible } { - Fl_Choice dirMenu { - label {Directory:} - callback {if (dirMenu->value()) - directory(dirMenu->text(dirMenu->value())); -else - directory("");} open - tooltip {Click to access directory tree.} - private xywh {65 10 210 25} - code0 {o->set_flag(FL_ALIGN_LEFT | FL_ALIGN_RIGHT); - o->align(FL_ALIGN_LEFT | FL_ALIGN_RIGHT);} - } {} - Fl_Button upButton { - callback {up();} - tooltip {Click to display parent directory.} - private xywh {280 10 25 25} image not_inlined {up.xbm} labelsize 8 - } - Fl_Button newButton { - callback {newdir();} - tooltip {Click to create a new directory.} - private xywh {310 10 25 25} image not_inlined {new.xbm} labelsize 8 + Fl_Browser fileList { + callback {fileListCB();} selected + private xywh {10 45 355 180} type Hold resizable hotspot + code0 {\#include <FL/Fl_FileBrowser.H>} + class Fl_FileBrowser } Fl_Button {} { - callback {fileList->filter("*");; -rescan();} - tooltip {Click to show all files.} - private xywh {340 10 25 25} align 524304 image not_inlined {allfiles.xbm} labelcolor 4 labelsize 28 + label Cancel + callback {fileList->deselect(); +fileName->value(""); +window->hide();} + private xywh {285 280 80 25} } - Fl_Browser fileList { - callback {fileListCB();} - tooltip {Double-click to change directories.} - private xywh {10 45 355 180} resizable - code0 {\#include "filename.H"} - code1 {\#include <fltk/Fl_FileBrowser.h>} - class Fl_FileBrowser + Fl_Return_Button okButton { + label OK + callback {window->hide();} + private xywh {205 280 75 25} } Fl_Input fileName { label {Filename:} - callback {fileNameCB();} selected - tooltip {Type a filename or directory name here.} + callback {fileNameCB();} private xywh {10 245 355 25} align 5 when 8 code0 {fileName->when(FL_WHEN_CHANGED | FL_WHEN_ENTER_KEY_ALWAYS);} - code1 {\#include <fltk/Fl_FileInput.h>} - class Fl_FileInput } - Fl_Return_Button okButton { - label OK + Fl_Button upButton { + label {up.xbm} + callback {up();} + private xywh {280 10 25 25} labeltype image labelsize 8 + } + Fl_Button newButton { + label {new.xbm} + callback {newdir();} + private xywh {310 10 25 25} labeltype image labelsize 8 + } + Fl_Choice dirMenu { + label {Directory:} callback {char pathname[1024]; +int i; -snprintf(pathname, sizeof(pathname), "%s/%s", - fileList->directory(), fileName->value()); -if (filename_isdir(pathname)) - directory(pathname); -else - window->hide();} - private xywh {240 280 55 25} shortcut 0xff0d - } +pathname[0] = '\\0'; +for (i = 1; i <= dirMenu->value(); i ++) + strcat(pathname, dirMenu->text(i)); +directory(pathname);} open + private xywh {95 10 180 25} + } {} Fl_Button {} { - label Cancel - callback {fileList->deselect(); -fileName->value(""); -window->hide();} - private xywh {300 280 65 25} + label {allfiles.xbm} + callback {const char *f; +if ((f = fl_input("New Filter?", + fileList->filter())) != NULL) +{ + fileList->filter(f); + rescan(); +}} + private xywh {340 10 25 25} labeltype image labelsize 28 labelcolor 4 align 16 + code0 {\#include <FL/fl_ask.H>} } } code {window->size_range(345, 270, 345); @@ -149,33 +137,30 @@ rescan();} {} } decl {void rescan();} {public } - Function {exec()} {return_type void + Function {show()} {return_type void } { - code {window->exec(); + code {window->show(); fileList->deselect();} {} } Function {textcolor(Fl_Color c)} {return_type void } { - code {fileList->textcolor(c); - fileList->text_color(c);} {} + code {fileList->textcolor(c);} {} } Function {textcolor()} {return_type Fl_Color } { - code {return (fileList->textcolor()); - return (fileList->textcolor());} {} + code {return (fileList->textcolor());} {} } - Function {textfont(Fl_Font f)} {return_type void + Function {textfont(uchar f)} {return_type void } { - code {fileList->text_font(f);} {} + code {fileList->textfont(f);} {} } - Function {textfont()} {return_type Fl_Font + Function {textfont()} {return_type uchar } { - code {return (fileList->text_font()); - return (fileList->textfont());} {} + code {return (fileList->textfont());} {} } Function {textsize(uchar s)} {return_type void } { - code {fileList->text_size(s);} {} + code {fileList->textsize(s);} {} } Function {textsize()} {return_type uchar } { |
