diff options
| -rw-r--r-- | FL/Fl_File_Chooser.H | 1 | ||||
| -rw-r--r-- | FL/Fl_Native_File_Chooser_FLTK.H | 2 | ||||
| -rw-r--r-- | src/Fl_File_Chooser2.cxx | 3 | ||||
| -rw-r--r-- | src/Fl_Native_File_Chooser_FLTK.cxx | 9 |
4 files changed, 5 insertions, 10 deletions
diff --git a/FL/Fl_File_Chooser.H b/FL/Fl_File_Chooser.H index af1d86fac..177e88cd7 100644 --- a/FL/Fl_File_Chooser.H +++ b/FL/Fl_File_Chooser.H @@ -222,6 +222,7 @@ private: Fl_Widget* ext_group; public: Fl_Widget* add_extra(Fl_Widget* gr); + Fl_File_Browser *browser(void) {return fileList; }; }; 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); diff --git a/FL/Fl_Native_File_Chooser_FLTK.H b/FL/Fl_Native_File_Chooser_FLTK.H index e3ba3bb1e..2f0bae693 100644 --- a/FL/Fl_Native_File_Chooser_FLTK.H +++ b/FL/Fl_Native_File_Chooser_FLTK.H @@ -135,8 +135,6 @@ public: const char* preset_file() const; const char *errmsg() const; int show(); - // added by MG - Fl_Choice *showChoice; }; // diff --git a/src/Fl_File_Chooser2.cxx b/src/Fl_File_Chooser2.cxx index 5e5f1e3cf..4f89cfa25 100644 --- a/src/Fl_File_Chooser2.cxx +++ b/src/Fl_File_Chooser2.cxx @@ -304,6 +304,9 @@ /** \fn void * Fl_File_Chooser::user_data() const Gets the file chooser user data d */ + + /** \fn Fl_File_Browser* Fl_File_Chooser::browser() + returns a pointer to the underlying Fl_File_Browser object */ // *** END OF OUT OF SOURCE DOC *** // Contents: diff --git a/src/Fl_Native_File_Chooser_FLTK.cxx b/src/Fl_Native_File_Chooser_FLTK.cxx index 357e4b949..ee75d0ebf 100644 --- a/src/Fl_Native_File_Chooser_FLTK.cxx +++ b/src/Fl_Native_File_Chooser_FLTK.cxx @@ -71,16 +71,9 @@ Fl_Native_File_Chooser::Fl_Native_File_Chooser(int val) { Fl_Group::current(w); // adds a "Show hidden files" check button in _file_chooser's window show_hidden = new Fl_Check_Button(b->x() + b->w() + 10, b->y(), 145, b->h(), "Show hidden files"); show_hidden->callback((Fl_Callback*)show_hidden_cb, this); - // This is a hack to bypass the fact that fileList is a private member of _file_chooser. - // Find it as 1st child of 2nd child of _file_chooser's window. - Fl_Group *g = (Fl_Group *)w->array()[1]; - my_fileList = (Fl_File_Browser *)g->array()[0]; + my_fileList = _file_chooser->browser(); _old_dir = 0; // to detect directory changes prev_filtervalue = _file_chooser->filter_value(); // to detect filter changes - // Hack to get _file_chooser's showChoice widget. - // Find it as 1st child of 1st child of _file_chooser's window. - g = (Fl_Group *)w->array()[0]; - showChoice = (Fl_Choice *)g->array()[0]; } /** |
