From e4727142d4c48198e708ba2bd4068daf8062abaf Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Sat, 4 Aug 2001 12:21:34 +0000 Subject: 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 --- src/Fl_FileChooser.fl | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'src/Fl_FileChooser.fl') 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 } code2 {\#include } @@ -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 } 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);} {} } -- cgit v1.2.3