The wxProperty class represents a property, with a wxPropertyValue containing the actual value, a name a role, an optional validator, and an optional associated window.
A property might correspond to an actual C++ data member, or it might correspond to a conceptual property, such as the width of a window. There is no explicit data member wxWindow::width, but it may be convenient to invent such a property for the purposes of editing attributes of the window. The properties in the property sheet can be mapped to "reality" by whatever means (in this case by calling wxWindow::SetSize when the user has finished editing the property sheet).
A validator may be associated with the property in order to ensure that this and only this validator will be used for editing and validating the property. An alternative method is to use the role parameter to specify what kind of validator would be appropriate; for example, specifying "filename" for the role would allow the property view to find an appropriate validator at edit time.
Members
wxProperty::wxProperty
wxProperty::~wxProperty
wxProperty::GetValue
wxProperty::GetValidator
wxProperty::GetName
wxProperty::GetRole
wxProperty::GetWindow
wxProperty::SetValue
wxProperty::SetName
wxProperty::SetRole
wxProperty::SetValidator
wxProperty::SetWindow
wxProperty::operator =
void wxProperty()
void wxProperty(wxProperty& prop)
void wxProperty(wxString name, wxString role, wxPropertyValidator *validator=NULL)
void wxProperty(wxString name, const wxPropertyValue& val, wxString role, wxPropertyValidator *validator=NULL)
Constructors.
void ~wxProperty()
Destructor. Destroys the wxPropertyValue, and the property validator if there is one. However, if the actual C++ value in the wxPropertyValue is a pointer, the data in that variable is not destroyed.
wxPropertyValue& GetValue()
Returns a reference to the property value.
wxPropertyValidator * GetValidator()
Returns a pointer to the associated property validator (if any).
wxString& GetName()
Returns the name of the property.
wxRole& GetRole()
Returns the role of the property, to be used when choosing an appropriate validator.
wxWindow * GetWindow()
Returns the window associated with the property (if any).
void SetValue(wxPropertyValue& val)
Sets the value of the property.
void SetName(wxString& name)
Sets the name of the property.
void SetRole(wxString& role)
Sets the role of the property.
void SetValidator(wxPropertyValidator *validator)
Sets the validator: this will be deleted when the property is deleted.
void SetWindow(wxWindow *win)
Sets the window associated with the property.
void operator =(const wxPropertyValue& val)
Assignment operator.