- wxPropertyGrid::CanClose() has been removed. Call
wxPropertyGridInterface::EditorValidate() instead.
+ - wxPGProperty::SetFlag() has been moved to private API. This was done to
+ underline the fact that it was not the preferred method to change a
+ property's state since it never had any desired side-effects. ChangeFlag()
+ still exists for those who really need to achieve the same effect.
+
@subsection propgrid_compat_propdev Property and Editor Sub-classing Changes
- Confusing custom property macros have been eliminated.
@remarks
This flag cannot be used with property iterators.
+
+ @see wxPGProperty::SetAutoUnspecified()
*/
wxPG_PROP_AUTO_UNSPECIFIED = 0x00040000,
void SetAttributes( const wxPGAttributeStorage& attributes );
+ /**
+ Set if user can change the property's value to unspecified by
+ modifying the value of the editor control (usually by clearing
+ it). Currently, this can work with following properties:
+ wxIntProperty, wxUIntProperty, wxFloatProperty, wxEditEnumProperty.
+
+ @param enable
+ Whether to enable or disable this behavior (it is disabled by
+ default).
+ */
+ void SetAutoUnspecified( bool enable = true )
+ {
+ ChangeFlag(wxPG_PROP_AUTO_UNSPECIFIED, enable);
+ }
+
/**
Sets property's background colour.
}
/**
- Sets given property flag.
-
- @see propgrid_propflags
- */
- void SetFlag( wxPGPropertyFlags flag )
- {
- //
- // NB: While using wxPGPropertyFlags here makes it difficult to
- // combine different flags, it usefully prevents user from
- // using incorrect flags (say, wxWindow styles).
- m_flags |= flag;
- }
+ Sets or clears given property flag. Mainly for internal use.
- /**
- Sets or clears given property flag.
+ @remarks Setting a property flag never has any side-effect, and is
+ intended almost exclusively for internal use. So, for
+ example, if you want to disable a property, call
+ Enable(false) instead of setting wxPG_PROP_DISABLED flag.
- @see propgrid_propflags
+ @see HasFlag(), GetFlags()
*/
void ChangeFlag( wxPGPropertyFlags flag, bool set )
{
}
/**
- Sets or clears given property flag, recursively.
+ Sets or clears given property flag, recursively. This function is
+ primarily intended for internal use.
- @see propgrid_propflags
+ @see ChangeFlag()
*/
void SetFlagRecursively( wxPGPropertyFlags flag, bool set );
return m_helpString;
}
- void ClearFlag( FlagType flag ) { m_flags &= ~(flag); }
-
// Use, for example, to detect if item is inside collapsed section.
bool IsSomeParent( wxPGProperty* candidate_parent ) const;
void SetParentState( wxPropertyGridPageState* pstate )
{ m_parentState = pstate; }
+ void SetFlag( wxPGPropertyFlags flag )
+ {
+ //
+ // NB: While using wxPGPropertyFlags here makes it difficult to
+ // combine different flags, it usefully prevents user from
+ // using incorrect flags (say, wxWindow styles).
+ m_flags |= flag;
+ }
+
+ void ClearFlag( FlagType flag ) { m_flags &= ~(flag); }
+
// Call after fixed sub-properties added/removed after creation.
// if oldSelInd >= 0 and < new max items, then selection is
// moved to it.
@remarks
This flag cannot be used with property iterators.
+
+ @see wxPGProperty::SetAutoUnspecified()
*/
wxPG_PROP_AUTO_UNSPECIFIED = 0x00040000,
bool AreChildrenComponents() const;
/**
- Sets or clears given property flag.
+ Sets or clears given property flag. Mainly for internal use.
- @see propgrid_propflags
+ @remarks Setting a property flag never has any side-effect, and is
+ intended almost exclusively for internal use. So, for
+ example, if you want to disable a property, call
+ Enable(false) instead of setting wxPG_PROP_DISABLED flag.
+
+ @see HasFlag(), GetFlags()
*/
void ChangeFlag( wxPGPropertyFlags flag, bool set );
*/
void SetAttribute( const wxString& name, wxVariant value );
+ /**
+ Set if user can change the property's value to unspecified by
+ modifying the value of the editor control (usually by clearing
+ it). Currently, this can work with following properties:
+ wxIntProperty, wxUIntProperty, wxFloatProperty, wxEditEnumProperty.
+
+ @param enable
+ Whether to enable or disable this behavior (it is disabled by
+ default).
+ */
+ void SetAutoUnspecified( bool enable = true );
+
/**
Sets property's background colour.
void SetDefaultValue( wxVariant& value );
/**
- Sets given property flag.
-
- @see propgrid_propflags
- */
- void SetFlag( wxPGPropertyFlags flag );
+ Sets or clears given property flag, recursively. This function is
+ primarily intended for internal use.
- /**
- Sets or clears given property flag, recursively.
-
- @see propgrid_propflags
+ @see ChangeFlag()
*/
void SetFlagRecursively( wxPGPropertyFlags flag, bool set );
pid = pg->Append( new wxColourProperty(wxT("ColourProperty"),wxPG_LABEL,*wxRED) );
//pg->SetPropertyAttribute(pid,wxPG_COLOUR_ALLOW_CUSTOM,false);
pg->SetPropertyEditor( wxT("ColourProperty"), wxPGEditor_ComboBox );
- pg->GetProperty(wxT("ColourProperty"))->SetFlag(wxPG_PROP_AUTO_UNSPECIFIED);
+ pg->GetProperty(wxT("ColourProperty"))->SetAutoUnspecified(true);
pg->SetPropertyHelpString( wxT("ColourProperty"),
wxT("wxPropertyGrid::SetPropertyEditor method has been used to change ")
wxT("editor of this property to wxPGEditor_ComboBox)"));
void FormMain::AddTestProperties( wxPropertyGridPage* pg )
{
pg->Append( new MyColourProperty(wxT("CustomColourProperty"), wxPG_LABEL, *wxGREEN) );
- pg->GetProperty(wxT("CustomColourProperty"))->SetFlag(wxPG_PROP_AUTO_UNSPECIFIED);
+ pg->GetProperty(wxT("CustomColourProperty"))->SetAutoUnspecified(true);
pg->SetPropertyEditor( wxT("CustomColourProperty"), wxPGEditor_ComboBox );
pg->SetPropertyHelpString(wxT("CustomColourProperty"),
flag = choices.GetValue(i);
if ( (newFlags & flag) != (m_oldValue & flag) )
- Item(i)->SetFlag( wxPG_PROP_MODIFIED );
+ Item(i)->ChangeFlag( wxPG_PROP_MODIFIED, true );
}
m_oldValue = newFlags;
wxPGProperty* p = Item(i);
if ( subVal != (m_oldValue & flag) )
- p->SetFlag( wxPG_PROP_MODIFIED );
+ p->ChangeFlag( wxPG_PROP_MODIFIED, true );
p->SetValue( subVal?true:false );
}