diff options
| -rw-r--r-- | CHANGES | 4 | ||||
| -rw-r--r-- | FL/Fl_File_Chooser.H | 6 | ||||
| -rw-r--r-- | src/Fl_File_Chooser.cxx | 5 | ||||
| -rw-r--r-- | src/Fl_File_Chooser.fl | 9 |
4 files changed, 15 insertions, 9 deletions
@@ -1,6 +1,10 @@ CHANGES IN FLTK 1.1.0rc3 - Documentation updates. + - The file chooser would return the last selected + file(s) when cancel was pressed. + - The file chooser limited the resizing of the chooser + window unnecessarily. - Fixed WM_PAINT handling under WIN32. - Minor tweeks to MingW and OS/2 config headers. - Fl_Value_Input now correctly determines if step() diff --git a/FL/Fl_File_Chooser.H b/FL/Fl_File_Chooser.H index 18b9a4473..69f8b8d1f 100644 --- a/FL/Fl_File_Chooser.H +++ b/FL/Fl_File_Chooser.H @@ -85,7 +85,7 @@ public: static const char *filter_label; static Fl_File_Sort_F *sort; }; -extern FL_EXPORT char *fl_dir_chooser(const char *message,const char *fname,int relative=0); -extern FL_EXPORT char *fl_file_chooser(const char *message,const char *pat,const char *fname,int relative=0); -extern FL_EXPORT void fl_file_chooser_callback(void (*cb)(const char*)); +FL_EXPORT char *fl_dir_chooser(const char *message,const char *fname,int relative=0); +FL_EXPORT char *fl_file_chooser(const char *message,const char *pat,const char *fname,int relative=0); +FL_EXPORT void fl_file_chooser_callback(void (*cb)(const char*)); #endif diff --git a/src/Fl_File_Chooser.cxx b/src/Fl_File_Chooser.cxx index eaebca5bf..31fd1b70e 100644 --- a/src/Fl_File_Chooser.cxx +++ b/src/Fl_File_Chooser.cxx @@ -4,6 +4,7 @@ inline void Fl_File_Chooser::cb_window_i(Fl_Window*, void*) { fileName->value(directory_); +fileList->deselect(); window->hide(); } void Fl_File_Chooser::cb_window(Fl_Window* o, void* v) { @@ -92,6 +93,7 @@ void Fl_File_Chooser::cb_okButton(Fl_Return_Button* o, void* v) { inline void Fl_File_Chooser::cb_Cancel_i(Fl_Button*, void*) { fileName->value(directory_); +fileList->deselect(); window->hide(); } void Fl_File_Chooser::cb_Cancel(Fl_Button* o, void* v) { @@ -154,8 +156,7 @@ Fl_File_Chooser::Fl_File_Chooser(const char *d, const char *p, int t, const char o->set_modal(); o->end(); } - window->size_range(375, 315, 375); -fileList->filter(p); + fileList->filter(p); type(t); value(d); callback_ = 0; diff --git a/src/Fl_File_Chooser.fl b/src/Fl_File_Chooser.fl index 6be09a616..a219cdfec 100644 --- a/src/Fl_File_Chooser.fl +++ b/src/Fl_File_Chooser.fl @@ -11,7 +11,8 @@ class Fl_File_Chooser {open Fl_Window window { label {Pick a File} callback {fileName->value(directory_); -window->hide();} open +fileList->deselect(); +window->hide();} open selected private xywh {99 225 375 325} resizable code0 {if (title) window->label(title);} code1 {\#include <stdio.h>} @@ -76,13 +77,13 @@ window->hide();} Fl_Button {} { label Cancel callback {fileName->value(directory_); +fileList->deselect(); window->hide();} private xywh {285 290 80 25} code0 {o->label(fl_cancel);} } } - code {window->size_range(375, 315, 375); -fileList->filter(p); + code {fileList->filter(p); type(t); value(d); callback_ = 0; @@ -215,7 +216,7 @@ else } decl {static const char *filter_label;} {public } - decl {static Fl_File_Sort_F *sort;} {selected public + decl {static Fl_File_Sort_F *sort;} {public } } |
