diff --git a/include/wx/propgrid/props.h b/include/wx/propgrid/props.h index 938de5ae72..ea2dbe33be 100644 --- a/include/wx/propgrid/props.h +++ b/include/wx/propgrid/props.h @@ -589,6 +589,7 @@ protected: wxString m_initialPath; // If set, start the file dialog here wxString m_dlgTitle; // If set, used as title for file dialog int m_indFilter; // index to the selected filter + long m_dlgStyle; // File dialog style }; // ----------------------------------------------------------------------- diff --git a/interface/wx/propgrid/property.h b/interface/wx/propgrid/property.h index 934222321f..53127845d3 100644 --- a/interface/wx/propgrid/property.h +++ b/interface/wx/propgrid/property.h @@ -151,8 +151,9 @@ struct wxPGPaintData */ #define wxPG_FILE_DIALOG_TITLE wxS("DialogTitle") -/** Specific to wxFileProperty and derivatives, @c long, default is 0. - Sets a specific wxFileDialog style for the file dialog, e.g. ::wxFD_SAVE. +/** Built-in attribute specific to wxFileProperty and derivatives, @c long, + default is 0. Sets a specific wxFileDialog style for the file dialog, + e.g. ::wxFD_SAVE. @since 2.9.4 */ @@ -617,6 +618,7 @@ wxPG_PROP_CLASS_SPECIFIC_3 = 0x00400000 given path string. - ::wxPG_FILE_INITIAL_PATH: Sets the initial path of where to look for files. - ::wxPG_FILE_DIALOG_TITLE: Sets a specific title for the dir dialog. + - ::wxPG_FILE_DIALOG_STYLE: Sets a specific wxFileDialog style for the file dialog. @see @ref propgrid_property_attributes @subsection wxEnumProperty diff --git a/interface/wx/propgrid/props.h b/interface/wx/propgrid/props.h index e4be903293..93740e0e14 100644 --- a/interface/wx/propgrid/props.h +++ b/interface/wx/propgrid/props.h @@ -516,6 +516,8 @@ public: given path string. - "InitialPath": Sets the initial path of where to look for files. - "DialogTitle": Sets a specific title for the dir dialog. + - ::wxPG_FILE_DIALOG_STYLE: Sets a specific wxFileDialog style for the file + dialog (since 2.9.4). */ class wxFileProperty : public wxPGProperty { @@ -544,10 +546,11 @@ public: protected: wxString m_wildcard; - wxString m_basePath; // If set, then show path relative to it - wxString m_initialPath; // If set, start the file dialog here - wxString m_dlgTitle; // If set, used as title for file dialog - int m_indFilter; // index to the selected filter + wxString m_basePath; + wxString m_initialPath; + wxString m_dlgTitle; + int m_indFilter; + long m_dlgStyle; }; diff --git a/src/propgrid/props.cpp b/src/propgrid/props.cpp index f3038e17b6..915356ff8d 100644 --- a/src/propgrid/props.cpp +++ b/src/propgrid/props.cpp @@ -1964,6 +1964,7 @@ wxFileProperty::wxFileProperty( const wxString& label, const wxString& name, { m_flags |= wxPG_PROP_SHOW_FULL_FILENAME; m_indFilter = -1; + m_dlgStyle = 0; SetAttribute( wxPG_FILE_WILDCARD, wxALL_FILES); SetValue(value); @@ -2147,6 +2148,11 @@ bool wxFileProperty::DoSetAttribute( const wxString& name, wxVariant& value ) m_dlgTitle = value.GetString(); return true; } + else if ( name == wxPG_FILE_DIALOG_STYLE ) + { + m_dlgStyle = value.GetLong(); + return true; + } return wxPGProperty::DoSetAttribute(name, value); }