]>
Commit | Line | Data |
---|---|---|
200fed6c VS |
1 | \section{\class{wxProperty}}\label{wxproperty} |
2 | ||
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. | |
6 | ||
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). | |
14 | ||
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. | |
20 | ||
21 | ||
22 | \membersection{wxProperty::wxProperty} | |
23 | ||
24 | \func{void}{wxProperty}{\void} | |
25 | ||
26 | \func{void}{wxProperty}{\param{wxProperty\& }{prop}} | |
27 | ||
28 | \func{void}{wxProperty}{\param{wxString}{ name}, \param{wxString}{ role}, \param{wxPropertyValidator *}{validator=NULL}} | |
29 | ||
30 | \func{void}{wxProperty}{\param{wxString}{ name}, \param{const wxPropertyValue\&}{ val}, \param{wxString}{ role}, \param{wxPropertyValidator *}{validator=NULL}} | |
31 | ||
32 | Constructors. | |
33 | ||
34 | \membersection{wxProperty::\destruct{wxProperty}} | |
35 | ||
36 | \func{void}{\destruct{wxProperty}}{\void} | |
37 | ||
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. | |
40 | ||
41 | \membersection{wxProperty::GetValue} | |
42 | ||
43 | \func{wxPropertyValue\&}{GetValue}{\void} | |
44 | ||
45 | Returns a reference to the property value. | |
46 | ||
47 | \membersection{wxProperty::GetValidator} | |
48 | ||
49 | \func{wxPropertyValidator *}{GetValidator}{\void} | |
50 | ||
51 | Returns a pointer to the associated property validator (if any). | |
52 | ||
53 | \membersection{wxProperty::GetName} | |
54 | ||
55 | \func{wxString\&}{GetName}{\void} | |
56 | ||
57 | Returns the name of the property. | |
58 | ||
59 | \membersection{wxProperty::GetRole} | |
60 | ||
61 | \func{wxRole\&}{GetRole}{\void} | |
62 | ||
63 | Returns the role of the property, to be used when choosing an appropriate validator. | |
64 | ||
65 | \membersection{wxProperty::GetWindow} | |
66 | ||
67 | \func{wxWindow *}{GetWindow}{\void} | |
68 | ||
69 | Returns the window associated with the property (if any). | |
70 | ||
71 | \membersection{wxProperty::SetValue} | |
72 | ||
73 | \func{void}{SetValue}{\param{wxPropertyValue\&}{ val}} | |
74 | ||
75 | Sets the value of the property. | |
76 | ||
77 | \membersection{wxProperty::SetName} | |
78 | ||
79 | \func{void}{SetName}{\param{wxString\&}{ name}} | |
80 | ||
81 | Sets the name of the property. | |
82 | ||
83 | \membersection{wxProperty::SetRole} | |
84 | ||
85 | \func{void}{SetRole}{\param{wxString\&}{ role}} | |
86 | ||
87 | Sets the role of the property. | |
88 | ||
89 | \membersection{wxProperty::SetValidator} | |
90 | ||
91 | \func{void}{SetValidator}{\param{wxPropertyValidator *}{validator}} | |
92 | ||
93 | Sets the validator: this will be deleted when the property is deleted. | |
94 | ||
95 | \membersection{wxProperty::SetWindow} | |
96 | ||
97 | \func{void}{SetWindow}{\param{wxWindow *}{win}} | |
98 | ||
99 | Sets the window associated with the property. | |
100 | ||
101 | \membersection{wxProperty::operator $=$} | |
102 | ||
103 | \func{void}{operator $=$}{\param{const wxPropertyValue\&}{ val}} | |
104 | ||
105 | Assignment operator. | |
106 |