Author: manolo
Date: 2013-02-19 07:19:58 -0800 (Tue, 19 Feb 2013)
New Revision: 9825
Log:
Introduced new Fl_Native_File_Chooser option USE_FILTER_EXT.

Modified:
   branches/branch-1.3/FL/Fl_Native_File_Chooser.H
   branches/branch-1.3/src/Fl_Native_File_Chooser_MAC.mm

Modified: branches/branch-1.3/FL/Fl_Native_File_Chooser.H
===================================================================
--- branches/branch-1.3/FL/Fl_Native_File_Chooser.H     2013-02-14 18:40:04 UTC 
(rev 9824)
+++ branches/branch-1.3/FL/Fl_Native_File_Chooser.H     2013-02-19 15:19:58 UTC 
(rev 9825)
@@ -116,7 +116,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-1.3/src/Fl_Native_File_Chooser_MAC.mm
===================================================================
--- branches/branch-1.3/src/Fl_Native_File_Chooser_MAC.mm       2013-02-14 
18:40:04 UTC (rev 9824)
+++ branches/branch-1.3/src/Fl_Native_File_Chooser_MAC.mm       2013-02-19 
15:19:58 UTC (rev 9825)
@@ -621,9 +621,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];
     }
   }

_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit

Reply via email to