Make wxPG_FILE_DIALOG_STYLE a built-in attribute

This attribute is used only internally in wxFileProperty so it can be considered as a built-in attribute which value can be stored in the local data member and not in the property's attribute store.
This commit is contained in:
Artur Wieczorek 2019-05-12 11:16:25 +02:00
parent ca712c59fe
commit b2ea56b4e9
4 changed files with 18 additions and 6 deletions

View File

@ -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
};
// -----------------------------------------------------------------------

View File

@ -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

View File

@ -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;
};

View File

@ -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);
}