Checked in on Manolo's behalf; FNFC.patch applied from STR#2298

to include a 'Show Hidden Files' checkbox for linux browser.
Small addition to Fl_File_Chooser to support this.



git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7007 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Greg Ercolano 2010-01-14 23:08:06 +00:00
parent 4e08397c94
commit ebfb80908c
4 changed files with 5 additions and 10 deletions

View File

@ -222,6 +222,7 @@ private:
Fl_Widget* ext_group; Fl_Widget* ext_group;
public: public:
Fl_Widget* add_extra(Fl_Widget* gr); 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_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 char *fl_file_chooser(const char *message,const char *pat,const char *fname,int relative=0);

View File

@ -135,8 +135,6 @@ public:
const char* preset_file() const; const char* preset_file() const;
const char *errmsg() const; const char *errmsg() const;
int show(); int show();
// added by MG
Fl_Choice *showChoice;
}; };
// //

View File

@ -304,6 +304,9 @@
/** \fn void * Fl_File_Chooser::user_data() const /** \fn void * Fl_File_Chooser::user_data() const
Gets the file chooser user data d */ 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 *** // *** END OF OUT OF SOURCE DOC ***
// Contents: // Contents:

View File

@ -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 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 = 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); 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. my_fileList = _file_chooser->browser();
// 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];
_old_dir = 0; // to detect directory changes _old_dir = 0; // to detect directory changes
prev_filtervalue = _file_chooser->filter_value(); // to detect filter 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];
} }
/** /**