Author: manolo
Date: 2013-02-25 09:29:54 -0800 (Mon, 25 Feb 2013)
New Revision: 9828
Log:
Added option fltk3::NativeFileChooser::USE_FILTER_EXT as done in 1.3
Modified:
branches/branch-3.0/include/fltk3/NativeFileChooser.h
branches/branch-3.0/src/fltk3/cocoaNativeFileChooser.mm
branches/branch-3.0/src/fltk3/x11NativeFileChooser.cxx
Modified: branches/branch-3.0/include/fltk3/NativeFileChooser.h
===================================================================
--- branches/branch-3.0/include/fltk3/NativeFileChooser.h 2013-02-20
10:27:47 UTC (rev 9827)
+++ branches/branch-3.0/include/fltk3/NativeFileChooser.h 2013-02-25
17:29:54 UTC (rev 9828)
@@ -125,7 +125,8 @@
NO_OPTIONS = 0x0000, ///< no options enabled
SAVEAS_CONFIRM = 0x0001, ///< Show native 'Save As' overwrite
confirm dialog (if supported)
NEW_FOLDER = 0x0002, ///< Show 'New Folder' icon (if
supported)
- PREVIEW = 0x0004 ///< enable preview mode
+ PREVIEW = 0x0004, ///< enable preview mode
+ USE_FILTER_EXT = 0x0008 ///< Chooser filter pilots the output
file extension
};
/** Localizable message */
static const char *file_exists_message;
Modified: branches/branch-3.0/src/fltk3/cocoaNativeFileChooser.mm
===================================================================
--- branches/branch-3.0/src/fltk3/cocoaNativeFileChooser.mm 2013-02-20
10:27:47 UTC (rev 9827)
+++ branches/branch-3.0/src/fltk3/cocoaNativeFileChooser.mm 2013-02-25
17:29:54 UTC (rev 9828)
@@ -631,9 +631,11 @@
char *t = prepareMacFilter(_filt_total, _filter, _filt_patt);
popup = createPopupAccessory((NSSavePanel*)_panel, t,
[[(NSSavePanel*)_panel nameFieldLabel] UTF8String], _filt_value);
delete[] t;
- [popup setAction:@selector(changedPopup:)];
- [popup setTarget:saveDelegate];
- [saveDelegate panel:(NSSavePanel*)_panel];
+ if (_options & USE_FILTER_EXT) {
+ [popup setAction:@selector(changedPopup:)];
+ [popup setTarget:saveDelegate];
+ [saveDelegate panel:(NSSavePanel*)_panel];
+ }
[(NSSavePanel*)_panel setCanSelectHiddenExtension:YES];
}
}
Modified: branches/branch-3.0/src/fltk3/x11NativeFileChooser.cxx
===================================================================
--- branches/branch-3.0/src/fltk3/x11NativeFileChooser.cxx 2013-02-20
10:27:47 UTC (rev 9827)
+++ branches/branch-3.0/src/fltk3/x11NativeFileChooser.cxx 2013-02-25
17:29:54 UTC (rev 9828)
@@ -132,6 +132,7 @@
NEW_FOLDER Shows the 'New Folder' button. Ignored
Used Used
PREVIEW Enables the 'Preview' mode by default. Ignored
Ignored Used
SAVEAS_CONFIRM Confirm dialog if BROWSE_SAVE_FILE file exists. Used
Used Used
+ USE_FILTER_EXT Chooser filter pilots the output file extension. Ignored
Used Ignored
\endcode
*/
void fltk3::NativeFileChooser::options(int val) {
_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit