]> git.saurik.com Git - wxWidgets.git/commitdiff
Add a property to configure file property dialog kind.
authorVadim Zeitlin <vadim@wxwidgets.org>
Mon, 23 Jan 2012 13:59:52 +0000 (13:59 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Mon, 23 Jan 2012 13:59:52 +0000 (13:59 +0000)
Add wxPG_FILE_DIALOG_STYLE allowing to pass wxFileDialog style that should be
used by the given wxFileProperty. This notably allows to have file properties
accepting not yet existing files, as is needed when using them for the file
names to be saved, not opened.

Closes #13894.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70449 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/propgrid/property.h
interface/wx/propgrid/property.h
src/propgrid/props.cpp

index 865f6c3846ca80dea6217e8f5af3707df447f294..5bae8cc4afc90eb1ad2217833aefa88cd2e9aa3f 100644 (file)
@@ -650,6 +650,11 @@ wxPG_PROP_BEING_DELETED             = 0x00200000
 */
 #define wxPG_FILE_DIALOG_TITLE              wxS("DialogTitle")
 
+/** Specific to wxFileProperty and derivatives, long, default is 0.
+    Sets a specific wxFileDialog style for the file dialog.
+*/
+#define wxPG_FILE_DIALOG_STYLE              wxS("DialogStyle")
+
 /** Specific to wxDirProperty, wxString, default is empty.
     Sets a specific message for the dir dialog.
 */
index 3c329f313464906b9661d27ea1691264d13fb1f8..7ce40e5f90563767534f00af4adef1fb7e3c67c4 100644 (file)
 */
 #define wxPG_FILE_DIALOG_TITLE              wxS("DialogTitle")
 
+/** Specific to wxFileProperty and derivatives, long, default is 0.
+    Sets a specific wxFileDialog style for the file dialog, e.g. ::wxFD_SAVE.
+
+    @since 2.9.4
+*/
+#define wxPG_FILE_DIALOG_STYLE              wxS("DialogStyle")
+
 /** Specific to wxDirProperty, wxString, default is empty.
     Sets a specific message for the dir dialog.
 */
index bde3b65460da67bc8e6dbd1f29a40501029ad7b1..8bb315c708c38c6051083cae8218e5d9d8726eaf 100644 (file)
@@ -1704,7 +1704,7 @@ bool wxPGFileDialogAdapter::DoShowDialog( wxPropertyGrid* propGrid, wxPGProperty
                       property->GetAttribute(wxS("InitialPath"), path),
                       wxEmptyString,
                       property->GetAttribute(wxPG_FILE_WILDCARD, wxALL_FILES),
-                      0,
+                      property->GetAttributeAsLong(wxPG_FILE_DIALOG_STYLE, 0),
                       wxDefaultPosition );
 
     if ( indFilter >= 0 )