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.cxx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/Fl_FileChooser.cxx') diff --git a/src/Fl_FileChooser.cxx b/src/Fl_FileChooser.cxx index 08f124ca3..331245cb4 100644 --- a/src/Fl_FileChooser.cxx +++ b/src/Fl_FileChooser.cxx @@ -28,7 +28,11 @@ void Fl_FileChooser::cb_Cancel(Fl_Button* o, void* v) { } inline void Fl_FileChooser::cb_okButton_i(Fl_Return_Button*, void*) { - window->hide(); + // Do any callback that is registered... +if (callback_) + (*callback_)(this, data_); + +window->hide(); } void Fl_FileChooser::cb_okButton(Fl_Return_Button* o, void* v) { ((Fl_FileChooser*)(o->parent()->user_data()))->cb_okButton_i(o,v); @@ -150,6 +154,13 @@ Fl_FileChooser::Fl_FileChooser(const char *d, const char *p, int t, const char * fileList->filter(p); type(t); value(d); +callback_ = 0; +data_ = 0; +} + +void Fl_FileChooser::callback(void (*cb)(Fl_FileChooser *, void *), void *d) { + callback_ = cb; +data_ = d; } void Fl_FileChooser::color(Fl_Color c) { -- cgit v1.2.3