Contents Up Previous Next

wxProperty

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 =


wxProperty::wxProperty

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.


wxProperty::~wxProperty

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.


wxProperty::GetValue

wxPropertyValue& GetValue()

Returns a reference to the property value.


wxProperty::GetValidator

wxPropertyValidator * GetValidator()

Returns a pointer to the associated property validator (if any).


wxProperty::GetName

wxString& GetName()

Returns the name of the property.


wxProperty::GetRole

wxRole& GetRole()

Returns the role of the property, to be used when choosing an appropriate validator.


wxProperty::GetWindow

wxWindow * GetWindow()

Returns the window associated with the property (if any).


wxProperty::SetValue

void SetValue(wxPropertyValue& val)

Sets the value of the property.


wxProperty::SetName

void SetName(wxString& name)

Sets the name of the property.


wxProperty::SetRole

void SetRole(wxString& role)

Sets the role of the property.


wxProperty::SetValidator

void SetValidator(wxPropertyValidator *validator)

Sets the validator: this will be deleted when the property is deleted.


wxProperty::SetWindow

void SetWindow(wxWindow *win)

Sets the window associated with the property.


wxProperty::operator =

void operator =(const wxPropertyValue& val)

Assignment operator.