Author: dejan
Date: 2007-11-13 14:59:07 -0800 (Tue, 13 Nov 2007)
New Revision: 5969
Log:
Patch from STR#1821, written by Davy Durham applied.
Again, Mr. Durham, thanks for Your cooperation!
Modified:
trunk/fltk/FileChooser.h
trunk/src/FileChooser.cxx
trunk/src/FileChooser2.cxx
Modified: trunk/fltk/FileChooser.h
===================================================================
--- trunk/fltk/FileChooser.h 2007-11-13 22:56:23 UTC (rev 5968)
+++ trunk/fltk/FileChooser.h 2007-11-13 22:59:07 UTC (rev 5969)
@@ -51,6 +51,7 @@
fltk::Choice *showChoice;
inline void cb_showChoice_i(fltk::Choice*, void*);
static void cb_showChoice(fltk::Choice*, void*);
+ int favorites_showing;
fltk::PopupMenu *favoritesButton;
inline void cb_favoritesButton_i(fltk::PopupMenu*, void*);
static void cb_favoritesButton(fltk::PopupMenu*, void*);
@@ -141,6 +142,8 @@
const char *value(int f = 1);
void value(const char *filename);
int visible();
+ void favorites(int e);
+ int favorites() const;
static const char *add_favorites_label;
static const char *all_files_label;
static const char *custom_filter_label;
Modified: trunk/src/FileChooser.cxx
===================================================================
--- trunk/src/FileChooser.cxx 2007-11-13 22:56:23 UTC (rev 5968)
+++ trunk/src/FileChooser.cxx 2007-11-13 22:59:07 UTC (rev 5969)
@@ -160,6 +160,7 @@
o->callback((fltk::Callback*)cb_favoritesButton);
o->align(fltk::ALIGN_CENTER|fltk::ALIGN_INSIDE);
favoritesButton->label(favorites_label);
+ favorites_showing = 1;
}
{fltk::Button* o = newButton = new fltk::Button(390, 0, 25, 25);
o->image(xbmImage_new);
@@ -451,5 +452,15 @@
int FileChooser::visible() {
return window->visible();
}
+
+void FileChooser::favorites(int e) {
+ favorites_showing = e;
+ update_favorites();
+}
+
+int FileChooser::favorites() const {
+ return favorites_showing;
+}
+
FL_API void file_chooser_ok_label(const char*l);
// Code for //\n// End of "$Id: FileChooser.fl 5067 2006-05-0...
Modified: trunk/src/FileChooser2.cxx
===================================================================
--- trunk/src/FileChooser2.cxx 2007-11-13 22:56:23 UTC (rev 5968)
+++ trunk/src/FileChooser2.cxx 2007-11-13 22:59:07 UTC (rev 5969)
@@ -893,6 +893,12 @@
void
FileChooser::update_favorites()
{
+ if(favorites_showing) {
+ favoritesButton->show();
+ } else {
+ favoritesButton->hide();
+ }
+
int i; // Looping var
char pathname[1024], // Pathname
menuname[2048]; // Menu name
_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit