diff options
| author | Michael R Sweet <michael.r.sweet@gmail.com> | 2001-08-04 12:21:34 +0000 |
|---|---|---|
| committer | Michael R Sweet <michael.r.sweet@gmail.com> | 2001-08-04 12:21:34 +0000 |
| commit | e4727142d4c48198e708ba2bd4068daf8062abaf (patch) | |
| tree | b2394dd6b76d749af4deea2ebaf88e840adfad11 /src/Fl_FileChooser.fl | |
| parent | 00f126367d73a2e860ca22a093a66fd1703f412a (diff) | |
Fl_Text* widgets backported to 1.1 (Carl, please confirm that I haven't
goofed with the layout->resize conversion. Also check fix for mMaxSize
being 0 so I set it to textsize())
contrast,inactive -> fl_contrast, fl_inactive, with defines for old names.
fl_rect() and fl_rectf() with color args.
fl_height, etc. with font,size args.
Send FL_RELEASE and FL_DRAG events to the pushed() widget by default.
Fix file chooser so it doesn't automatically change dirs if the only
matching name is a dir.
Updated Fl_Browser_ and Fl_Scrollbar for better mouse wheel support.
Moved DLL definitions to new Fl_Export.H.
Restore callback functionality in file chooser.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@1550 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_FileChooser.fl')
| -rw-r--r-- | src/Fl_FileChooser.fl | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/src/Fl_FileChooser.fl b/src/Fl_FileChooser.fl index 0074a9c1a..7df77414e 100644 --- a/src/Fl_FileChooser.fl +++ b/src/Fl_FileChooser.fl @@ -16,7 +16,7 @@ class Fl_FileChooser {open callback {fileList->deselect(); fileName->value(""); window->hide();} open - private xywh {208 292 375 315} resizable hotspot + private xywh {250 430 375 315} resizable hotspot code0 {if (title) window->label(title);} code1 {\#include <stdio.h>} code2 {\#include <stdlib.h>} @@ -32,13 +32,17 @@ window->hide();} open label Cancel callback {fileList->deselect(); fileName->value(""); -window->hide();} selected +window->hide();} private xywh {285 280 80 25} code0 {o->label(fl_cancel);} } Fl_Return_Button okButton { label OK - callback {window->hide();} + 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);} @@ -86,14 +90,23 @@ if ((f = fl_input("New Filter?", code {window->size_range(345, 270, 345); fileList->filter(p); type(t); -value(d);} {} +value(d); +callback_ = 0; +data_ = 0;} {} } + decl {void (*callback_)(Fl_FileChooser*, 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_FileChooser *, void *), void *d)} {selected return_type void + } { + code {callback_ = cb; +data_ = d;} {} + } Function {color(Fl_Color c)} {} { code {fileList->color(c);} {} } |
