1 \section{\class{wxProperty
}}\label{wxproperty
}
3 The
{\bf wxProperty
} class represents a property, with a
\helpref{wxPropertyValue
}{wxpropertyvalue
}\rtfsp
4 containing the actual value, a name a role, an optional validator, and
5 an optional associated window.
7 A property might correspond to an actual C++ data member, or it
8 might correspond to a conceptual property, such as the width of a window.
9 There is no explicit data member
{\it wxWindow::width
}, but it may be convenient
10 to invent such a property for the purposes of editing attributes of the window.
11 The properties in the property sheet can be mapped to ``reality" by
12 whatever means (in this case by calling wxWindow::SetSize when the user has
13 finished editing the property sheet).
15 A validator may be associated with the property in order to ensure that this and
16 only this validator will be used for editing and validating the property.
17 An alternative method is to use the
{\it role
} parameter to specify what kind
18 of validator would be appropriate; for example, specifying ``filename" for the role
19 would allow the property view to find an appropriate validator at edit time.
22 \membersection{wxProperty::wxProperty
}
24 \func{void
}{wxProperty
}{\void}
26 \func{void
}{wxProperty
}{\param{wxProperty\&
}{prop
}}
28 \func{void
}{wxProperty
}{\param{wxString
}{ name
},
\param{wxString
}{ role
},
\param{wxPropertyValidator *
}{validator=NULL
}}
30 \func{void
}{wxProperty
}{\param{wxString
}{ name
},
\param{const wxPropertyValue\&
}{ val
},
\param{wxString
}{ role
},
\param{wxPropertyValidator *
}{validator=NULL
}}
34 \membersection{wxProperty::
\destruct{wxProperty
}}
36 \func{void
}{\destruct{wxProperty
}}{\void}
38 Destructor. Destroys the wxPropertyValue, and the property validator if there is one. However, if the
39 actual C++ value in the wxPropertyValue is a pointer, the data in that variable is not destroyed.
41 \membersection{wxProperty::GetValue
}
43 \func{wxPropertyValue\&
}{GetValue
}{\void}
45 Returns a reference to the property value.
47 \membersection{wxProperty::GetValidator
}
49 \func{wxPropertyValidator *
}{GetValidator
}{\void}
51 Returns a pointer to the associated property validator (if any).
53 \membersection{wxProperty::GetName
}
55 \func{wxString\&
}{GetName
}{\void}
57 Returns the name of the property.
59 \membersection{wxProperty::GetRole
}
61 \func{wxRole\&
}{GetRole
}{\void}
63 Returns the role of the property, to be used when choosing an appropriate validator.
65 \membersection{wxProperty::GetWindow
}
67 \func{wxWindow *
}{GetWindow
}{\void}
69 Returns the window associated with the property (if any).
71 \membersection{wxProperty::SetValue
}
73 \func{void
}{SetValue
}{\param{wxPropertyValue\&
}{ val
}}
75 Sets the value of the property.
77 \membersection{wxProperty::SetName
}
79 \func{void
}{SetName
}{\param{wxString\&
}{ name
}}
81 Sets the name of the property.
83 \membersection{wxProperty::SetRole
}
85 \func{void
}{SetRole
}{\param{wxString\&
}{ role
}}
87 Sets the role of the property.
89 \membersection{wxProperty::SetValidator
}
91 \func{void
}{SetValidator
}{\param{wxPropertyValidator *
}{validator
}}
93 Sets the validator: this will be deleted when the property is deleted.
95 \membersection{wxProperty::SetWindow
}
97 \func{void
}{SetWindow
}{\param{wxWindow *
}{win
}}
99 Sets the window associated with the property.
101 \membersection{wxProperty::operator $=$
}
103 \func{void
}{operator $=$
}{\param{const wxPropertyValue\&
}{ val
}}