git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60828
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
*/
// Redefine attribute macros to use cached strings
*/
// Redefine attribute macros to use cached strings
+#undef wxPG_ATTR_DEFAULT_VALUE
+#define wxPG_ATTR_DEFAULT_VALUE wxPGGlobalVars->m_strDefaultValue
#undef wxPG_ATTR_MIN
#define wxPG_ATTR_MIN wxPGGlobalVars->m_strMin
#undef wxPG_ATTR_MAX
#undef wxPG_ATTR_MIN
#define wxPG_ATTR_MIN wxPGGlobalVars->m_strMin
#undef wxPG_ATTR_MAX
void SetTextColour( const wxColour& colour,
bool recursively = false );
void SetTextColour( const wxColour& colour,
bool recursively = false );
+ /** Set default value of a property. Synonymous to
+
+ @code
+ SetAttribute("DefaultValue", value);
+ @endcode
+ */
+ void SetDefaultValue( wxVariant& value );
+
#ifndef SWIG
/** Sets editor for a property.
#ifndef SWIG
/** Sets editor for a property.
wxPGCachedString m_strbool;
wxPGCachedString m_strlist;
wxPGCachedString m_strbool;
wxPGCachedString m_strlist;
+ wxPGCachedString m_strDefaultValue;
wxPGCachedString m_strMin;
wxPGCachedString m_strMax;
wxPGCachedString m_strUnits;
wxPGCachedString m_strMin;
wxPGCachedString m_strMax;
wxPGCachedString m_strUnits;
+inline void wxPGProperty::SetDefaultValue( wxVariant& value )
+{
+ SetAttribute(wxPG_ATTR_DEFAULT_VALUE, value);
+}
+
inline void wxPGProperty::SetEditor( const wxString& editorName )
{
m_customEditor = wxPropertyGridInterface::GetEditorByName(editorName);
inline void wxPGProperty::SetEditor( const wxString& editorName )
{
m_customEditor = wxPropertyGridInterface::GetEditorByName(editorName);
*/
void SetChoiceSelection( int newValue );
*/
void SetChoiceSelection( int newValue );
+ /** Set default value of a property. Synonymous to
+
+ @code
+ SetAttribute("DefaultValue", value);
+ @endcode
+ */
+ void SetDefaultValue( wxVariant& value );
+
/**
Sets property's help string, which is shown, for example, in
wxPropertyGridManager's description text box.
/**
Sets property's help string, which is shown, for example, in
wxPropertyGridManager's description text box.
wxVariant wxPGProperty::GetDefaultValue() const
{
wxVariant wxPGProperty::GetDefaultValue() const
{
- wxVariant defVal = GetAttribute(wxS("DefaultValue"));
+ wxVariant defVal = GetAttribute(wxPG_ATTR_DEFAULT_VALUE);
if ( !defVal.IsNull() )
return defVal;
if ( !defVal.IsNull() )
return defVal;
m_strlong = wxS("long");
m_strbool = wxS("bool");
m_strlist = wxS("list");
m_strlong = wxS("long");
m_strbool = wxS("bool");
m_strlist = wxS("list");
+ m_strDefaultValue = wxS("DefaultValue");
m_strMin = wxS("Min");
m_strMax = wxS("Max");
m_strUnits = wxS("Units");
m_strMin = wxS("Min");
m_strMax = wxS("Max");
m_strUnits = wxS("Units");