Introduced new Fl_Native_File_Chooser option USE_FILTER_EXT.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9825 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Manolo Gouy
2013-02-19 15:19:58 +00:00
parent 8f8c52939e
commit 3e7386137e
2 changed files with 7 additions and 4 deletions
+2 -1
View File
@@ -116,7 +116,8 @@ public:
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;
+5 -3
View File
@@ -621,9 +621,11 @@ int Fl_Native_File_Chooser::post() {
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];
}
}