1 \chapter{Alphabetical class reference
}\label{classref
}
2 \setheader{{\it CHAPTER
\thechapter}}{}{}{}{}{{\it CHAPTER
\thechapter}}%
3 \setfooter{\thepage}{}{}{}{}{\thepage}%
5 \overview{Property classes overview
}{propertyoverview
}
8 \section{\class{wxBoolFormValidator
}: wxPropertyFormValidator
}\label{wxboolformvalidator
}
10 \overview{Validator classes
}{validatorclasses
}
12 This class validates a boolean value for a form view. The associated panel item must be a wxCheckBox.
14 \membersection{wxBoolFormValidator::wxBoolFormValidator
}
16 \func{void
}{wxBoolFormValidator
}{\param{long
}{flags=
0}}
20 \section{\class{wxBoolListValidator
}: wxPropertyListValidator
}\label{wxboollistvalidator
}
22 \overview{Validator classes
}{validatorclasses
}
24 This class validates a boolean value for a list view.
26 \membersection{wxBoolListValidator::wxBoolListValidator
}
28 \func{void
}{wxBoolListValidator
}{\param{long
}{flags=
0}}
32 \section{\class{wxIntegerFormValidator
}: wxPropertyFormValidator
}\label{wxintegerformvalidator
}
34 \overview{Validator classes
}{validatorclasses
}
36 This class validates a range of integer values for a form view. The associated panel item must be a wxText
39 \membersection{wxIntegerFormValidator::wxIntegerFormValidator
}
41 \func{void
}{wxIntegerFormValidator
}{\param{long
}{min=
0},
\param{long
}{max=
0},
42 \param{long
}{ flags=
0}}
44 Constructor. Assigning zero to minimum and maximum values indicates that there is no range to check.
47 \section{\class{wxIntegerListValidator
}: wxPropertyListValidator
}\label{wxintegerlistvalidator
}
49 \overview{Validator classes
}{validatorclasses
}
51 This class validates a range of integer values for a list view.
53 \membersection{wxIntegerListValidator::wxIntegerListValidator
}
55 \func{void
}{wxIntegerListValidator
}{\param{long
}{min=
0},
\param{long
}{max=
0},
56 \param{long
}{ flags=wxPROP
\_ALLOW\_TEXT\_EDITING}}
58 Constructor. Assigning zero to minimum and maximum values indicates that there is no range to check.
60 \section{\class{wxFilenameListValidator
}: wxPropertyListValidator
}\label{wxfilenamelistvalidator
}
62 \overview{Validator classes
}{validatorclasses
}
64 This class validates a filename for a list view, allowing the user to edit it textually and also popping up
65 a file selector in ``detailed editing" mode.
67 \membersection{wxFilenameListValidator::wxFilenameListValidator
}
69 \func{void
}{wxFilenameListValidator
}{\param{wxString
}{message = ``Select a file"
},
\param{wxString
}{wildcard = ``*.*"
},
70 \param{long
}{ flags=
0}}
72 Constructor. Supply an optional message and wildcard.
74 \section{\class{wxListOfStringsListValidator
}: wxPropertyListValidator
}\label{wxlistofstringslistvalidator
}
76 \overview{Validator classes
}{validatorclasses
}
78 This class validates a list of strings for a list view. When editing the property,
79 a dialog box is presented for adding, deleting or editing entries in the list.
80 At present no constraints may be supplied.
82 You can construct a string list property value by constructing a wxStringList object.
87 myListValidatorRegistry.RegisterValidator((wxString)"stringlist",
88 new wxListOfStringsListValidator);
90 wxStringList *strings = new wxStringList("earth", "fire", "wind", "water", NULL);
92 sheet->AddProperty(new wxProperty("fred", strings, "stringlist"));
95 \membersection{wxListOfStringsListValidator::wxListofStringsListValidator
}
97 \func{void
}{wxListOfStringsListValidator
}{\param{long
}{ flags=
0}}
101 \section{\class{wxProperty
}: wxObject
}\label{wxproperty
}
103 The
{\bf wxProperty
} class represents a property, with a
\helpref{wxPropertyValue
}{wxpropertyvalue
}\rtfsp
104 containing the actual value, a name a role, an optional validator, and
105 an optional associated window.
107 A property might correspond to an actual C++ data member, or it
108 might correspond to a conceptual property, such as the width of a window.
109 There is no explicit data member
{\it wxWindow::width
}, but it may be convenient
110 to invent such a property for the purposes of editing attributes of the window.
111 The properties in the property sheet can be mapped to ``reality" by
112 whatever means (in this case by calling wxWindow::SetSize when the user has
113 finished editing the property sheet).
115 A validator may be associated with the property in order to ensure that this and
116 only this validator will be used for editing and validating the property.
117 An alternative method is to use the
{\it role
} parameter to specify what kind
118 of validator would be appropriate; for example, specifying ``filename" for the role
119 would allow the property view to find an appropriate validator at edit time.
122 \membersection{wxProperty::wxProperty
}
124 \func{void
}{wxProperty
}{\void}
126 \func{void
}{wxProperty
}{\param{wxProperty\&
}{prop
}}
128 \func{void
}{wxProperty
}{\param{wxString
}{ name
},
\param{wxString
}{ role
},
\param{wxPropertyValidator *
}{validator=NULL
}}
130 \func{void
}{wxProperty
}{\param{wxString
}{ name
},
\param{const wxPropertyValue\&
}{ val
},
\param{wxString
}{ role
},
\param{wxPropertyValidator *
}{validator=NULL
}}
134 \membersection{wxProperty::
\destruct{wxProperty
}}
136 \func{void
}{\destruct{wxProperty
}}{\void}
138 Destructor. Destroys the wxPropertyValue, and the property validator if there is one. However, if the
139 actual C++ value in the wxPropertyValue is a pointer, the data in that variable is not destroyed.
141 \membersection{wxProperty::GetValue
}
143 \func{wxPropertyValue\&
}{GetValue
}{\void}
145 Returns a reference to the property value.
147 \membersection{wxProperty::GetValidator
}
149 \func{wxPropertyValidator *
}{GetValidator
}{\void}
151 Returns a pointer to the associated property validator (if any).
153 \membersection{wxProperty::GetName
}
155 \func{wxString\&
}{GetName
}{\void}
157 Returns the name of the property.
159 \membersection{wxProperty::GetRole
}
161 \func{wxRole\&
}{GetRole
}{\void}
163 Returns the role of the property, to be used when choosing an appropriate validator.
165 \membersection{wxProperty::GetWindow
}
167 \func{wxWindow *
}{GetWindow
}{\void}
169 Returns the window associated with the property (if any).
171 \membersection{wxProperty::SetValue
}
173 \func{void
}{SetValue
}{\param{wxPropertyValue\&
}{ val
}}
175 Sets the value of the property.
177 \membersection{wxProperty::SetName
}
179 \func{void
}{SetName
}{\param{wxString\&
}{ name
}}
181 Sets the name of the property.
183 \membersection{wxProperty::SetRole
}
185 \func{void
}{SetRole
}{\param{wxString\&
}{ role
}}
187 Sets the role of the property.
189 \membersection{wxProperty::SetValidator
}
191 \func{void
}{SetValidator
}{\param{wxPropertyValidator *
}{validator
}}
193 Sets the validator: this will be deleted when the property is deleted.
195 \membersection{wxProperty::SetWindow
}
197 \func{void
}{SetWindow
}{\param{wxWindow *
}{win
}}
199 Sets the window associated with the property.
201 \membersection{wxProperty::operator $=$
}
203 \func{void
}{operator $=$
}{\param{const wxPropertyValue\&
}{ val
}}
207 \section{\class{wxPropertyFormValidator
}: wxPropertyValidator
}\label{wxpropertyformvalidator
}
209 The
{\bf wxPropertyFormValidator
} abstract class is the root of classes that define validation
210 for a wxPropertyFormView.
213 \section{\class{wxPropertyFormDialog
}: wxDialogBox
}\label{wxpropertyformdialog
}
215 The
{\bf wxPropertyFormDialog
} class is a prepackaged dialog which can
216 be used for viewing a form property sheet. Pass a property form view object, and the dialog
217 will pass OnClose and OnDefaultAction listbox messages to the view class for
220 \membersection{wxPropertyFormDialog::wxPropertyFormDialog
}
222 \func{void
}{wxPropertyFormDialog
}{\param{wxPropertyFormView *
}{view
},
\param{wxWindow *
}{parent
},
\param{char *
}{title
},
223 \param{Bool
}{ modal=FALSE
},
\param{int
}{ x=-
1},
\param{int
}{ y=-
1},
\param{int
}{ width=-
1},
\param{int
}{height=-
1},
224 \param{long
}{ style=wxDEFAULT
\_DIALOG\_STYLE},
\param{char *
}{name=``dialogBox"
}}
228 \membersection{wxPropertyFormDialog::
\destruct{wxPropertyFormDialog
}}
230 \func{void
}{\destruct{wxPropertyFormDialog
}}{\void}
235 \section{\class{wxPropertyFormFrame
}: wxFrame
}\label{wxpropertyformframe
}
237 The
{\bf wxPropertyFormFrame
} class is a prepackaged frame which can
238 be used for viewing a property form. Pass a property form view object, and the frame
239 will pass OnClose messages to the view class for processing.
241 Call Initialize to create the panel and associate the view; override OnCreatePanel
242 if you wish to use a panel class other than the default wxPropertyFormPanel.
244 \membersection{wxPropertyFormFrame::wxPropertyFormFrame
}
246 \func{void
}{wxPropertyFormFrame
}{\param{wxPropertyFormView *
}{view
},
\param{wxFrame *
}{parent
},
\param{char *
}{title
},
247 \param{int
}{ x=-
1},
\param{int
}{ y=-
1},
\param{int
}{ width=-
1},
\param{int
}{height=-
1},
248 \param{long
}{ style=wxSDI $\|$ wxDEFAULT
\_FRAME},
\param{char *
}{name=``frame"
}}
252 \membersection{wxPropertyFormFrame::
\destruct{wxPropertyFormFrame
}}
254 \func{void
}{\destruct{wxPropertyFormFrame
}}{\void}
258 \membersection{wxPropertyFormFrame::GetPropertyPanel
}
260 \func{wxPanel *
}{GetPropertyPanel
}{\void}
262 Returns the panel associated with the frame.
264 \membersection{wxPropertyFormFrame::Initialize
}
266 \func{Bool
}{Initialize
}{\void}
268 Must be called to create the panel and associate the view with the panel and frame.
270 \membersection{wxPropertyFormFrame::OnCreatePanel
}
272 \func{wxPanel *
}{OnCreatePanel
}{\param{wxFrame *
}{parent
},
\param{wxPropertyFormView *
}{view
}}
274 Creates a panel. Override this to create a panel type other than wxPropertyFormPanel.
277 \section{\class{wxPropertyFormPanel
}: wxPanel
}\label{wxpropertyformpanel
}
279 The
{\bf wxPropertyFormPanel
} class is a prepackaged panel which can
280 be used for viewing a property form. Pass a property form view object, and the panel
281 will pass OnDefaultAction listbox messages to the view class for
284 \membersection{wxPropertyFormPanel::wxPropertyFormPanel
}
286 \func{void
}{wxPropertyFormPanel
}{\param{wxPropertyFormView *
}{view
},
\param{wxWindow *
}{parent
},
287 \param{int
}{ x=-
1},
\param{int
}{ y=-
1},
\param{int
}{ width=-
1},
\param{int
}{height=-
1},
288 \param{long
}{ style=
0},
\param{char *
}{name=``panel"
}}
292 \membersection{wxPropertyFormPanel::
\destruct{wxPropertyFormPanel
}}
294 \func{void
}{\destruct{wxPropertyFormPanel
}}{\void}
300 \section{\class{wxPropertyFormValidator
}: wxPropertyValidator
}\label{wxpropertyformvalidatir
}
302 \overview{wxPropertyFormValidator overview
}{wxpropertyformvalidatoroverview
}
304 The
{\bf wxPropertyFormValidator
} class defines a base class for form validators. By overriding virtual functions,
305 the programmer can create custom behaviour for kinds of property.
307 \membersection{wxPropertyFormValidator::wxPropertyFormValidator
}
309 \func{void
}{wxPropertyFormValidator
}{\param{long
}{ flags =
0}}
313 \membersection{wxPropertyFormValidator::
\destruct{wxPropertyFormValidator
}}
315 \func{void
}{\destruct{wxPropertyFormValidator
}}{\void}
319 \membersection{wxPropertyFormValidator::OnCommand
}
321 \func{Bool
}{OnCommand
}{\param{wxProperty *
}{property
},
\param{wxPropertyFormView *
}{view
},
322 \param{wxWindow *
}{parentWindow
},
\param{wxCommandEvent\&
}{event
}}
324 Called when the control corresponding to the property receives a command (if not intercepted
325 by a callback associated with the actual control).
327 \membersection{wxPropertyFormValidator::OnCheckValue
}
329 \func{Bool
}{OnCheckValue
}{\param{wxProperty *
}{property
},
\param{wxPropertyFormView *
}{view
},
330 \param{wxWindow *
}{parentWindow
}}
332 Called when the view checks the property value. The value checked by this validator should be taken from the
333 panel item corresponding to the property.
335 \membersection{wxPropertyFormValidator::OnDisplayValue
}
337 \func{Bool
}{OnDisplayValue
}{\param{wxProperty *
}{property
},
\param{wxPropertyFormView *
}{view
},
338 \param{wxWindow *
}{parentWindow
}}
340 Should display the property value in the appropriate control.
342 \membersection{wxPropertyFormValidator::OnDoubleClick
}
344 \func{Bool
}{OnDoubleClick
}{\param{wxProperty *
}{property
},
\param{wxPropertyFormView *
}{view
},
345 \param{wxWindow *
}{parentWindow
}}
347 Called when the control corresponding to the property is double clicked (listboxes only).
349 \membersection{wxPropertyFormValidator::OnRetrieveValue
}
351 \func{Bool
}{OnRetrieveValue
}{\param{wxProperty *
}{property
},
\param{wxPropertyFormView *
}{view
},
352 \param{wxWindow *
}{parentWindow
}}
354 Should do the transfer from the property editing area to the property itself.
357 \section{\class{wxPropertyFormView
}: wxPropertyView
}\label{wxpropertyformview
}
359 \overview{wxPropertyFormView overview
}{wxpropertyformviewoverview
}
361 The
{\bf wxPropertyFormView
} class shows a wxPropertySheet as a view onto a panel or dialog
362 box which has already been created.
364 \membersection{wxPropertyFormView::wxPropertyFormView
}
366 \func{void
}{wxPropertyFormView
}{\param{long
}{ flags =
0}}
370 \membersection{wxPropertyFormView::
\destruct{wxPropertyFormView
}}
372 \func{void
}{\destruct{wxPropertyFormView
}}{\void}
376 \membersection{wxPropertyFormView::AssociateNames
}\label{wxpropertyformviewassociatenames
}
378 \func{void
}{AssociateNames
}{\void}
380 Associates the properties with the controls on the panel. For each panel item, if the
381 panel item name is the same as a property name, the two objects will be associated.
382 This function should be called manually since the programmer may wish to do the
383 association manually.
385 \membersection{wxPropertyFormView::Check
}\label{wxpropertyformviewcheck
}
387 \func{Bool
}{Check
}{\void}
389 Checks all properties by calling the appropriate validators; returns FALSE if a validation failed.
391 \membersection{wxPropertyFormView::GetPanel
}\label{wxpropertyformviewgetpanel
}
393 \func{wxPanel *
}{GetPanel
}{\void}
395 Returns the panel associated with the view.
397 \membersection{wxPropertyFormView::GetManagedWindow
}\label{wxpropertyformviewgetmanagedwindow
}
399 \func{wxWindow *
}{GetManagedWindow
}{\void}
401 Returns the managed window (a frame or dialog) associated with the view.
403 \membersection{wxPropertyFormView::OnOk
}\label{wxpropertyformviewonok
}
405 \func{void
}{OnOk
}{\void}
407 Virtual function that will be called when the OK button on the physical window is pressed.
408 By default, checks and updates the form values, closes and deletes the frame or dialog, then deletes the view.
410 \membersection{wxPropertyFormView::OnCancel
}\label{wxpropertyformviewoncancel
}
412 \func{void
}{OnCancel
}{\void}
414 Virtual function that will be called when the Cancel button on the physical window is pressed.
415 By default, closes and deletes the frame or dialog, then deletes the view.
417 \membersection{wxPropertyFormView::OnHelp
}\label{wxpropertyformviewonhelp
}
419 \func{void
}{OnHelp
}{\void}
421 Virtual function that will be called when the Help button on the physical window is pressed.
422 This needs to be overridden by the application for anything interesting to happen.
424 \membersection{wxPropertyFormView::OnRevert
}\label{wxpropertyformviewonrevert
}
426 \func{void
}{OnRevert
}{\void}
428 Virtual function that will be called when the Revert button on the physical window is pressed.
429 By default transfers the wxProperty values to the panel items (in effect
430 undoing any unsaved changes in the items).
432 \membersection{wxPropertyFormView::OnUpdate
}\label{wxpropertyformviewonupdate
}
434 \func{void
}{OnUpdate
}{\void}
436 Virtual function that will be called when the Update button on the physical window is pressed.
437 By defaults transfers the displayed values to the wxProperty objects.
439 \membersection{wxPropertyFormView::SetManagedWindow
}\label{wxpropertyformviewsetmanagedwindow
}
441 \func{void
}{SetManagedWindow
}{\param{wxWindow *
}{win
}}
443 Sets the managed window (a frame or dialog) associated with the view.
445 \membersection{wxPropertyFormView::TransferToDialog
}\label{wxpropertyformviewtransfertodialog
}
447 \func{Bool
}{TransferToDialog
}{\void}
449 Transfers property values to the controls in the dialog.
451 \membersection{wxPropertyFormView::TransferToPropertySheet
}\label{wxpropertyformviewtransfertopropertysheet
}
453 \func{Bool
}{TransferToPropertySheet
}{\void}
455 Transfers property values from the controls in the dialog to the property sheet.
458 \section{\class{wxPropertyListDialog
}: wxDialogBox
}\label{wxpropertylistdialog
}
460 The
{\bf wxPropertyListDialog
} class is a prepackaged dialog which can
461 be used for viewing a property list. Pass a property list view object, and the dialog
462 will pass OnClose and OnDefaultAction listbox messages to the view class for
465 \membersection{wxPropertyListDialog::wxPropertyListDialog
}
467 \func{void
}{wxPropertyListDialog
}{\param{wxPropertyListView *
}{view
},
\param{wxWindow *
}{parent
},
\param{char *
}{title
},
468 \param{Bool
}{ modal=FALSE
},
\param{int
}{ x=-
1},
\param{int
}{ y=-
1},
\param{int
}{ width=-
1},
\param{int
}{height=-
1},
469 \param{long
}{ style=wxDEFAULT
\_DIALOG\_STYLE},
\param{char *
}{name=``dialogBox"
}}
473 \membersection{wxPropertyListDialog::
\destruct{wxPropertyListDialog
}}
475 \func{void
}{\destruct{wxPropertyListDialog
}}{\void}
480 \section{\class{wxPropertyListFrame
}: wxFrame
}\label{wxpropertylistframe
}
482 The
{\bf wxPropertyListFrame
} class is a prepackaged frame which can
483 be used for viewing a property list. Pass a property list view object, and the frame
484 will pass OnClose messages to the view class for processing.
486 Call Initialize to create the panel and associate the view; override OnCreatePanel
487 if you wish to use a panel class other than the default wxPropertyListPanel.
489 \membersection{wxPropertyListFrame::wxPropertyListFrame
}
491 \func{void
}{wxPropertyListFrame
}{\param{wxPropertyListView *
}{view
},
\param{wxFrame *
}{parent
},
\param{char *
}{title
},
492 \param{int
}{ x=-
1},
\param{int
}{ y=-
1},
\param{int
}{ width=-
1},
\param{int
}{height=-
1},
493 \param{long
}{ style=wxSDI $\|$ wxDEFAULT
\_FRAME},
\param{char *
}{name=``frame"
}}
497 \membersection{wxPropertyListFrame::
\destruct{wxPropertyListFrame
}}
499 \func{void
}{\destruct{wxPropertyListFrame
}}{\void}
503 \membersection{wxPropertyListFrame::GetPropertyPanel
}
505 \func{wxPanel *
}{GetPropertyPanel
}{\void}
507 Returns the panel associated with the frame.
509 \membersection{wxPropertyListFrame::Initialize
}
511 \func{Bool
}{Initialize
}{\void}
513 Must be called to create the panel and associate the view with the panel and frame.
515 \membersection{wxPropertyListFrame::OnCreatePanel
}
517 \func{wxPanel *
}{OnCreatePanel
}{\param{wxFrame *
}{parent
},
\param{wxPropertyListView *
}{view
}}
519 Creates a panel. Override this to create a panel type other than wxPropertyListPanel.
522 \section{\class{wxPropertyListPanel
}: wxPanel
}\label{wxpropertylistpanel
}
524 The
{\bf wxPropertyListPanel
} class is a prepackaged panel which can
525 be used for viewing a property list. Pass a property list view object, and the panel
526 will pass OnDefaultAction listbox messages to the view class for
529 \membersection{wxPropertyListPanel::wxPropertyListPanel
}
531 \func{void
}{wxPropertyListPanel
}{\param{wxPropertyListView *
}{view
},
\param{wxWindow *
}{parent
},
532 \param{int
}{ x=-
1},
\param{int
}{ y=-
1},
\param{int
}{ width=-
1},
\param{int
}{height=-
1},
533 \param{long
}{ style=
0},
\param{char *
}{name=``panel"
}}
537 \membersection{wxPropertyListPanel::
\destruct{wxPropertyListPanel
}}
539 \func{void
}{\destruct{wxPropertyListPanel
}}{\void}
546 \section{\class{wxPropertyListValidator
}: wxPropertyValidator
}\label{wxpropertylistvalidator
}
548 \overview{wxPropertyListValidator overview
}{wxpropertylistvalidatoroverview
}
550 The
{\bf wxPropertyListValidator
} abstract class is the base class for
551 deriving validators for property lists.
553 \membersection{wxPropertyListValidator::wxPropertyListValidator
}
555 \func{void
}{wxPropertyListValidator
}{\param{long
}{ flags = wxPROP
\_ALLOW\_TEXT\_EDITING}}
559 \membersection{wxPropertyListValidator::
\destruct{wxPropertyListValidator
}}
561 \func{void
}{\destruct{wxPropertyListValidator
}}{\void}
565 \membersection{wxPropertyListValidator::OnCheckValue
}
567 \func{Bool
}{OnCheckValue
}{\param{wxProperty *
}{property
},
\param{wxPropertyListView *
}{view
},
568 \param{wxWindow *
}{parentWindow
}}
570 Called when the Tick (Confirm) button is pressed or focus is list. Return FALSE if the value
571 was invalid, which is a signal restores the old value. Return TRUE if the value was valid.
573 \membersection{wxPropertyListValidator::OnClearControls
}
575 \func{Bool
}{OnClearControls
}{\param{wxProperty *
}{property
},
\param{wxPropertyListView *
}{view
},
576 \param{wxWindow *
}{parentWindow
}}
578 Allows the clearing (enabling, disabling) of property list controls, when the focus leaves the current property.
580 \membersection{wxPropertyListValidator::OnClearDetailControls
}
582 \func{Bool
}{OnClearDetailControls
}{\param{wxProperty *
}{property
},
\param{wxPropertyListView *
}{view
},
583 \param{wxWindow *
}{parentWindow
}}
585 Called when the focus is lost, if the validator is in detailed editing mode.
587 \membersection{wxPropertyListValidator::OnDisplayValue
}
589 \func{Bool
}{OnDisplayValue
}{\param{wxProperty *
}{property
},
\param{wxPropertyListView *
}{view
},
590 \param{wxWindow *
}{parentWindow
}}
592 Should display the value in the appropriate controls. The default implementation gets the
593 textual value from the property and inserts it into the text edit control.
595 \membersection{wxPropertyListValidator::OnDoubleClick
}
597 \func{Bool
}{OnDoubleClick
}{\param{wxProperty *
}{property
},
\param{wxPropertyListView *
}{view
},
598 \param{wxWindow *
}{parentWindow
}}
600 Called when the property is double clicked. Extra functionality can be provided,
601 such as cycling through possible values.
603 \membersection{wxPropertyListValidator::OnEdit
}
605 \func{Bool
}{OnEdit
}{\param{wxProperty *
}{property
},
\param{wxPropertyListView *
}{view
},
606 \param{wxWindow *
}{parentWindow
}}
608 Called when the Edit (detailed editing) button is pressed. The default implementation
609 calls wxPropertyListView::BeginDetailedEditing; a filename validator (for example) overrides
610 this function to show the file selector.
612 \membersection{wxPropertyListValidator::OnPrepareControls
}
614 \func{Bool
}{OnPrepareControls
}{\param{wxProperty *
}{property
},
\param{wxPropertyListView *
}{view
},
615 \param{wxWindow *
}{parentWindow
}}
617 Called to allow the validator to setup the display, such enabling or disabling buttons, and
618 setting the values and selection in the standard listbox control (the one optionally used for displaying
621 \membersection{wxPropertyListValidator::OnPrepareDetailControls
}
623 \func{Bool
}{OnPrepareDetailControls
}{\param{wxProperty *
}{property
},
\param{wxPropertyListView *
}{view
},
624 \param{wxWindow *
}{parentWindow
}}
626 Called when the property is edited `in detail', i.e. when the Edit button is pressed.
628 \membersection{wxPropertyListValidator::OnRetrieveValue
}
630 \func{Bool
}{OnRetrieveValue
}{\param{wxProperty *
}{property
},
\param{wxPropertyListView *
}{view
},
631 \param{wxWindow *
}{parentWindow
}}
633 Called when Tick (Confirm) is pressed or focus is lost or view wants to update
634 the property list. Should do the transfer from the property editing area to the property itself
636 \membersection{wxPropertyListValidator::OnSelect
}
638 \func{Bool
}{OnSelect
}{\param{Bool
}{ select
},
\param{wxProperty *
}{property
},
\param{wxPropertyListView *
}{view
},
639 \param{wxWindow *
}{parentWindow
}}
641 Called when the property is selected or deselected: typically displays the value
642 in the edit control (having chosen a suitable control to display: (non)editable text or listbox).
644 \membersection{wxPropertyListValidator::OnValueListSelect
}
646 \func{Bool
}{OnValueListSelect
}{\param{wxProperty *
}{property
},
\param{wxPropertyListView *
}{view
},
647 \param{wxWindow *
}{parentWindow
}}
649 Called when the value listbox is selected. The default behaviour is to copy
650 string to text control, and retrieve the value into the property.
654 \section{\class{wxPropertyListView
}: wxPropertyView
}\label{wxpropertylistview
}
656 \overview{wxPropertyListView overview
}{wxpropertylistviewoverview
}
658 The
{\bf wxPropertyListView
} class shows a wxPropertySheet as a Visual Basic-style property list.
660 \membersection{wxPropertyListView::wxPropertyListView
}
662 \func{void
}{wxPropertyListView
}{\param{long
}{ flags = wxPROP
\_BUTTON\_DEFAULT}}
666 The
{\it flags
} argument can be a bit list of the following:
668 \begin{itemize
}\itemsep=
0pt
669 \item wxPROP
\_BUTTON\_CLOSE
670 \item wxPROP
\_BUTTON\_OK
671 \item wxPROP
\_BUTTON\_CANCEL
672 \item wxPROP
\_BUTTON\_CHECK\_CROSS
673 \item wxPROP
\_BUTTON\_HELP
674 \item wxPROP
\_DYNAMIC\_VALUE\_FIELD
675 \item wxPROP
\_PULLDOWN
678 \membersection{wxPropertyListView::
\destruct{wxPropertyListView
}}
680 \func{void
}{\destruct{wxPropertyListView
}}{\void}
684 \membersection{wxPropertyListView::AssociatePanel
}\label{wxpropertylistviewassociatepanel
}
686 \func{void
}{AssociatePanel
}{\param{wxPanel *
}{panel
}}
688 Associates the window on which the controls will be displayed, with the view (sets an internal pointer to the window).
690 \membersection{wxPropertyListView::BeginShowingProperty
}\label{wxpropertylistviewbeginshowingproperty
}
692 \func{Bool
}{BeginShowingProperty
}{\param{wxProperty *
}{property
}}
694 Finds the appropriate validator and loads the property into the controls, by calling
695 wxPropertyValidator::OnPrepareControls and then wxPropertyListView::DisplayProperty.
697 \membersection{wxPropertyListView::DisplayProperty
}\label{wxpropertylistviewdisplayproperty
}
699 \func{Bool
}{DisplayProperty
}{\param{wxProperty *
}{property
}}
701 Calls wxPropertyValidator::OnDisplayValue for the current property's validator. This function
702 gets called by wxPropertyListView::BeginShowingProperty, which is in turn called
703 from ShowProperty, called by OnPropertySelect, called by the listbox callback when selected.
705 \membersection{wxPropertyListView::EndShowingProperty
}\label{wxpropertylistviewendshowingproperty
}
707 \func{Bool
}{EndShowingProperty
}{\param{wxProperty *
}{property
}}
709 Finds the appropriate validator and unloads the property from the controls, by calling
710 wxPropertyListView::RetrieveProperty, wxPropertyValidator::OnClearControls and (if we're in
711 detailed editing mdoe) wxPropertyValidator::OnClearDetailControls.
713 \membersection{wxPropertyListView::GetPanel
}\label{wxpropertylistviewgetpanel
}
715 \func{wxPanel *
}{GetPanel
}{\void}
717 Returns the panel associated with the view.
719 \membersection{wxPropertyListView::GetManagedWindow
}\label{wxpropertylistviewgetmanagedwindow
}
721 \func{wxWindow *
}{GetManagedWindow
}{\void}
723 Returns the managed window (a frame or dialog) associated with the view.
725 \membersection{wxPropertyListView::GetWindowCancelButton
}\label{wxpropertylistviewgetwindowcancelbutton
}
727 \func{wxButton *
}{GetWindowCancelButton
}{\void}
729 Returns the window cancel button, if any.
731 \membersection{wxPropertyListView::GetWindowCloseButton
}\label{wxpropertylistviewgetwindowclosebutton
}
733 \func{wxButton *
}{GetWindowCloseButton
}{\void}
735 Returns the window close or OK button, if any.
737 \membersection{wxPropertyListView::GetWindowHelpButton
}\label{wxpropertylistviewgetwindowhelpbutton
}
739 \func{wxButton *
}{GetWindowHelpButton
}{\void}
741 Returns the window help button, if any.
743 \membersection{wxPropertyListView::SetManagedWindow
}\label{wxpropertylistviewsetmanagedwindow
}
745 \func{void
}{SetManagedWindow
}{\param{wxWindow *
}{win
}}
747 Sets the managed window (a frame or dialog) associated with the view.
749 \membersection{wxPropertyListView::UpdatePropertyDisplayInList
}\label{wxpropertylistviewupdatepropdisplay
}
751 \func{Bool
}{UpdatePropertyDisplayInList
}{\param{wxProperty *
}{property
}}
753 Updates the display for the given changed property.
755 \membersection{wxPropertyListView::UpdatePropertyList
}\label{wxpropertylistviewupdateproplist
}
757 \func{Bool
}{UpdatePropertyList
}{\param{Bool
}{clearEditArea = TRUE
}}
759 Updates the whole property list display.
762 \section{\class{wxPropertySheet
}: wxObject
}\label{wxpropertysheet
}
764 \overview{wxPropertySheet overview
}{wxpropertysheetoverview
}
766 The
{\bf wxPropertySheet
} class is used for storing a number of
767 wxProperty objects (essentially names and values).
769 \membersection{wxPropertySheet::wxPropertySheet
}
771 \func{void
}{wxPropertySheet
}{\param{const wxString
}{ name = ""
}}
773 Constructor. Sets property sheet's name to name if present.
775 \membersection{wxPropertySheet::
\destruct{wxPropertySheet
}}
777 \func{void
}{\destruct{wxPropertySheet
}}{\void}
779 Destructor. Destroys all contained properties.
781 \membersection{wxPropertySheet::AddProperty
}\label{wxpropertysheetaddproperty
}
783 \func{void
}{AddProperty
}{\param{wxProperty *
}{property
}}
785 Adds a property to the sheet.
787 \membersection{wxPropertySheet::Clear
}\label{wxpropertysheetclear
}
789 \func{void
}{Clear
}{\void}
791 Clears all the properties from the sheet (deleting them).
793 \membersection{wxPropertySheet::GetName
}\label{wxpropertysheetgetname
}
795 \func{wxString
}{GetName
}{\void}
797 Gets the sheet's name.
799 \membersection{wxPropertySheet::GetProperty
}\label{wxpropertysheetgetproperty
}
801 \func{wxProperty *
}{GetProperty
}{\param{wxString
}{ name
}}
803 Gets a property by name.
805 \membersection{wxPropertySheet::GetProperties
}\label{wxpropertysheetgetproperties
}
807 \func{wxList\&
}{GetProperties
}{\void}
809 Returns a reference to the internal list of properties.
811 \membersection{wxPropertySheet::HasProperty
}\label{wxpropertysheethasproperty
}
813 \func{bool
}{HasProperty
}{\param{wxString
}{ propname
}}
815 Returns true if sheet contains property propname.
817 \membersection{wxPropertySheet::RemoveProperty
}\label{wxpropertysheetremoveproperty
}
819 \func{void
}{RemoveProperty
}{\param{wxString
}{ propname
}}
821 Removes property propname from sheet, deleting it.
823 \membersection{wxPropertySheet::SetName
}\label{wxpropertysheetsetname
}
825 \func{void
}{SetName
}{\param{wxString
}{ sheetname
}}
827 Set the sheet's name to sheetname
829 \membersection{wxPropertySheet::SetProperty
}\label{wxpropertysheetsetproperty
}
831 \func{bool
}{SetProperty
}{\param{wxString
}{ propname
},
\param{wxPropertyValue
}{ value
}}
833 Sets property propname to value. Returns false if property is not a member of sheet.
835 \membersection{wxPropertySheet::SetAllModified
}
837 \func{void
}{SetAllModified
}{\param{Bool
}{ flag
}}
839 Sets the `modified' flag of each property value.
843 \section{\class{wxPropertyValidator
}: wxEvtHandler
}\label{wxpropertyvalidator
}
845 \overview{wxPropertyValidator overview
}{wxpropertyvalidatoroverview
}
847 The
{\bf wxPropertyValidator
} abstract class is the base class for deriving
848 validators for properties.
850 \membersection{wxPropertyValidator::wxPropertyValidator
}
852 \func{void
}{wxPropertyValidator
}{\param{long
}{ flags =
0}}
856 \membersection{wxPropertyValidator::
\destruct{wxPropertyValidator
}}
858 \func{void
}{\destruct{wxPropertyValidator
}}{\void}
862 \membersection{wxPropertyValidator::GetFlags
}
864 \func{long
}{GetFlags
}{\void}
866 Returns the flags for the validator.
868 \membersection{wxPropertyValidator::GetValidatorProperty
}
870 \func{wxProperty *
}{GetValidatorProperty
}{\void}
872 Gets the property for the validator.
874 \membersection{wxPropertyValidator::SetValidatorProperty
}
876 \func{void
}{SetValidatorProperty
}{\param{wxProperty *
}{property
}}
878 Sets the property for the validator.
881 \section{\class{wxPropertyValidatorRegistry
}: wxHashTable
}\label{wxpropertyvalidatorregistry
}
883 The
{\bf wxPropertyValidatorRegistry
} class is used for storing validators,
884 indexed by the `role name' of the property, by which groups of property
885 can be identified for the purpose of validation and editing.
887 \membersection{wxPropertyValidatorRegistry::wxPropertyValidatorRegistry
}
889 \func{void
}{wxPropertyValidatorRegistry
}{\void}
893 \membersection{wxPropertyValidatorRegistry::
\destruct{wxPropertyValidatorRegistry
}}
895 \func{void
}{\destruct{wxPropertyValidatorRegistry
}}{\void}
899 \membersection{wxPropertyValidatorRegistry::Clear
}
901 \func{void
}{ClearRegistry
}{\void}
903 Clears the registry, deleting the validators.
905 \membersection{wxPropertyValidatorRegistry::GetValidator
}
907 \func{wxPropertyValidator *
}{GetValidator
}{\param{wxString\&
}{roleName
}}
909 Retrieve a validator by the property role name.
911 \membersection{wxPropertyValidatorRegistry::RegisterValidator
}\label{wxpropertyvalidatorregistervalidator
}
913 \func{void
}{RegisterValidator
}{\param{wxString\&
}{roleName
},
\param{wxPropertyValidator *
}{validator
}}
915 Register a validator with the registry.
{\it roleName
} is a name indicating the
916 role of the property, such as ``filename''. Later, when a validator is chosen for
917 editing a property, this role name is matched against the class names of the property,
918 if the property does not already have a validator explicitly associated with it.
921 \section{\class{wxPropertyValue
}: wxObject
}\label{wxpropertyvalue
}
923 The
{\bf wxPropertyValue
} class represents the value of a property,
924 and is normally associated with a wxProperty object.
926 A wxPropertyValue has one of the following types:
928 \begin{itemize
}\itemsep=
0pt
929 \item wxPropertyValueNull
930 \item wxPropertyValueInteger
931 \item wxPropertyValueReal
932 \item wxPropertyValueBool
933 \item wxPropertyValueString
934 \item wxPropertyValueList
935 \item wxPropertyValueIntegerPtr
936 \item wxPropertyValueRealPtr
937 \item wxPropertyValueBoolPtr
938 \item wxPropertyValueStringPtr
941 \membersection{wxPropertyValue::wxPropertyValue
}
943 \func{void
}{wxPropertyValue
}{\void}
947 \func{void
}{wxPropertyValue
}{\param{const wxPropertyValue\&
}{copyFrom
}}
951 \func{void
}{wxPropertyValue
}{\param{char *
}{val
}}
953 Construction from a string value.
955 \func{void
}{wxPropertyValue
}{\param{long
}{ val
}}
957 Construction from an integer value. You may need to cast to (long) to
958 avoid confusion with other constructors (such as the Bool constructor).
960 \func{void
}{wxPropertyValue
}{\param{Bool
}{ val
}}
962 Construction from a boolean value.
964 \func{void
}{wxPropertyValue
}{\param{float
}{ val
}}
966 Construction from a floating point value.
968 \func{void
}{wxPropertyValue
}{\param{double
}{ val
}}
970 Construction from a floating point value.
972 \func{void
}{wxPropertyValue
}{\param{wxList *
}{ val
}}
974 Construction from a list of wxPropertyValue objects. The
975 list, but not each contained wxPropertyValue, will be deleted
976 by the constructor. The wxPropertyValues will be assigned to
977 this wxPropertyValue list. In other words, so do not delete wxList or
978 its data after calling this constructor.
980 \func{void
}{wxPropertyValue
}{\param{wxStringList *
}{ val
}}
982 Construction from a list of strings. The list (including the strings
983 contained in it) will be deleted by the constructor, so do not
984 destroy
{\it val
} explicitly.
986 \func{void
}{wxPropertyValue
}{\param{char **
}{val
}}
988 Construction from a string pointer.
990 \func{void
}{wxPropertyValue
}{\param{long *
}{val
}}
992 Construction from an integer pointer.
994 \func{void
}{wxPropertyValue
}{\param{Bool *
}{val
}}
996 Construction from an boolean pointer.
998 \func{void
}{wxPropertyValue
}{\param{float *
}{val
}}
1000 Construction from a floating point pointer.
1002 The last four constructors use pointers to various C++ types, and do not
1003 store the types themselves; this allows the values to stand in for actual
1004 data values defined elsewhere.
1006 \membersection{wxPropertyValue::
\destruct{wxPropertyValue
}}
1008 \func{void
}{\destruct{wxPropertyValue
}}{\void}
1012 \membersection{wxPropertyValue::Append
}
1014 \func{void
}{Append
}{\param{wxPropertyValue *
}{expr
}}
1016 Appends a property value to the list.
1018 \membersection{wxPropertyValue::BoolValue
}
1020 \func{Bool
}{BoolValue
}{\void}
1022 Returns the boolean value.
1024 \membersection{wxPropertyValue::BoolValuePtr
}
1026 \func{Bool *
}{BoolValuePtr
}{\void}
1028 Returns the pointer to the boolean value.
1030 \membersection{wxPropertyValue::ClearList
}
1032 \func{void
}{ClearList
}{\void}
1034 Deletes the contents of the list.
1036 \membersection{wxPropertyValue::Delete
}
1038 \func{void
}{Delete
}{\param{wxPropertyValue *
}{expr
}}
1040 Deletes
{\it expr
} from this list.
1042 \membersection{wxPropertyValue::GetFirst
}
1044 \func{wxPropertyValue *
}{GetFirst
}{\void}
1046 Gets the first value in the list.
1048 \membersection{wxPropertyValue::GetLast
}
1050 \func{wxPropertyValue *
}{GetFirst
}{\void}
1052 Gets the last value in the list.
1054 \membersection{wxPropertyValue::GetModified
}
1056 \func{Bool
}{GetModified
}{\void}
1058 Returns TRUE if the value was modified since being created
1059 (or since SetModified was called).
1061 \membersection{wxPropertyValue::GetNext
}
1063 \func{wxPropertyValue *
}{GetNext
}{\void}
1065 Gets the next value in the list (the one after `this').
1067 \membersection{wxPropertyValue::GetStringRepresentation
}
1069 \func{wxString
}{GetStringRepresentation
}{\void}
1071 Gets a string representation of the value.
1073 \membersection{wxPropertyValue::IntegerValue
}
1075 \func{long
}{IntegerValue
}{\void}
1077 Returns the integer value.
1079 \membersection{wxPropertyValue::Insert
}
1081 \func{void
}{Insert
}{\param{wxPropertyValue *
}{expr
}}
1083 Inserts a property value at the front of a list.
1085 \membersection{wxPropertyValue::IntegerValuePtr
}
1087 \func{long *
}{IntegerValuePtr
}{\void}
1089 Returns the pointer to the integer value.
1091 \membersection{wxPropertyValue::Nth
}
1093 \func{wxPropertyValue *
}{Nth
}{\param{int
}{ n
}}
1095 Returns the nth value of a list expression (starting from zero).
1097 \membersection{wxPropertyValue::Number
}
1099 \func{int
}{Number
}{\void}
1101 Returns the number of elements in a list expression.
1103 \membersection{wxPropertyValue::RealValue
}
1105 \func{float
}{RealValue
}{\void}
1107 Returns the floating point value.
1109 \membersection{wxPropertyValue::RealValuePtr
}
1111 \func{float *
}{RealValuePtr
}{\void}
1113 Returns the pointer to the floating point value.
1115 \membersection{wxPropertyValue::SetModified
}
1117 \func{void
}{SetModified
}{\param{Bool
}{ flag
}}
1119 Sets the `modified' flag.
1121 \membersection{wxPropertyValue::StringValue
}
1123 \func{char *
}{StringValue
}{\void}
1125 Returns the string value.
1127 \membersection{wxPropertyValue::StringValuePtr
}
1129 \func{char **
}{StringValuePtr
}{\void}
1131 Returns the pointer to the string value.
1133 \membersection{wxPropertyValue::Type
}
1135 \func{wxPropertyValueType
}{Type
}{\void}
1137 Returns the value type.
1139 \membersection{wxPropertyValue::operator $=$
}
1141 \func{void
}{operator $=$
}{\param{const wxPropertyValue\&
}{val
}}
1143 \func{void
}{operator $=$
}{\param{const char *
}{val
}}
1145 \func{void
}{operator $=$
}{\param{const long
}{val
}}
1147 \func{void
}{operator $=$
}{\param{const Bool
}{val
}}
1149 \func{void
}{operator $=$
}{\param{const float
}{val
}}
1151 \func{void
}{operator $=$
}{\param{const char **
}{val
}}
1153 \func{void
}{operator $=$
}{\param{const long *
}{val
}}
1155 \func{void
}{operator $=$
}{\param{const Bool *
}{val
}}
1157 \func{void
}{operator $=$
}{\param{const float *
}{val
}}
1159 Assignment operators.
1163 \section{\class{wxPropertyView
}: wxEvtHandler
}\label{wxpropertyview
}
1165 \overview{wxPropertyView overview
}{wxpropertyviewoverview
}
1167 The
{\bf wxPropertyView
} abstract class is the base class for views
1168 of property sheets, acting as intermediaries between properties and
1171 \membersection{wxPropertyView::wxPropertyView
}
1173 \func{void
}{wxPropertyView
}{\param{long
}{ flags = wxPROP
\_BUTTON\_DEFAULT}}
1177 The
{\it flags
} argument can be a bit list of the following:
1179 \begin{itemize
}\itemsep=
0pt
1180 \item wxPROP
\_BUTTON\_CLOSE
1181 \item wxPROP
\_BUTTON\_OK
1182 \item wxPROP
\_BUTTON\_CANCEL
1183 \item wxPROP
\_BUTTON\_CHECK\_CROSS
1184 \item wxPROP
\_BUTTON\_HELP
1185 \item wxPROP
\_DYNAMIC\_VALUE\_FIELD
1186 \item wxPROP
\_PULLDOWN
1189 \membersection{wxPropertyView::
\destruct{wxPropertyView
}}
1191 \func{void
}{\destruct{wxPropertyView
}}{\void}
1195 \membersection{wxPropertyView::AddRegistry
}\label{wxpropertyviewaddregistry
}
1197 \func{void
}{AddRegistry
}{\param{wxPropertyValidatorRegistry *
}{registry
}}
1199 Adds a registry (list of property validators) the view's list of registries, which is initially empty.
1201 \membersection{wxPropertyView::FindPropertyValidator
}\label{wxpropertyviewfindpropertyvalidator
}
1203 \func{wxPropertyValidator *
}{FindPropertyValidator
}{\param{wxProperty *
}{property
}}
1205 Finds the property validator that is most appropriate to this property.
1207 \membersection{wxPropertyView::GetPropertySheet
}\label{wxpropertyviewgetpropertysheet
}
1209 \func{wxPropertySheet *
}{GetPropertySheet
}{\void}
1211 Gets the property sheet for this view.
1213 \membersection{wxPropertyView::GetRegistryList
}\label{wxpropertyviewgetregistrylist
}
1215 \func{wxList\&
}{GetRegistryList
}{\void}
1217 Returns a reference to the list of property validator registries.
1219 \membersection{wxPropertyView::OnOk
}\label{wxpropertyviewonok
}
1221 \func{void
}{OnOk
}{\void}
1223 Virtual function that will be called when the OK button on the physical window is pressed (if it exists).
1225 \membersection{wxPropertyView::OnCancel
}\label{wxpropertyviewoncancel
}
1227 \func{void
}{OnCancel
}{\void}
1229 Virtual function that will be called when the Cancel button on the physical window is pressed (if it exists).
1231 \membersection{wxPropertyView::OnClose
}\label{wxpropertyviewonclose
}
1233 \func{Bool
}{OnClose
}{\void}
1235 Virtual function that will be called when the physical window is closed. The default implementation returns FALSE.
1237 \membersection{wxPropertyView::OnHelp
}\label{wxpropertyviewonhelp
}
1239 \func{void
}{OnHelp
}{\void}
1241 Virtual function that will be called when the Help button on the physical window is pressed (if it exists).
1243 \membersection{wxPropertyView::OnPropertyChanged
}\label{wxpropertyviewonpropertychanged
}
1245 \func{void
}{OnPropertyChanged
}{\param{wxProperty *
}{property
}}
1247 Virtual function called by a view or validator when a property's value changed. Validators
1248 must be written correctly for this to be called. You can override this function
1249 to respond immediately to property value changes.
1251 \membersection{wxPropertyView::OnUpdateView
}\label{wxpropertyviewonupdateview
}
1253 \func{Bool
}{OnUpdateView
}{\void}
1255 Called by the viewed object to update the view. The default implementation just returns
1258 \membersection{wxPropertyView::SetPropertySheet
}\label{wxpropertyviewsetpropertysheet
}
1260 \func{void
}{SetPropertySheet
}{\param{wxPropertySheet *
}{sheet
}}
1262 Sets the property sheet for this view.
1264 \membersection{wxPropertyView::ShowView
}\label{wxpropertyviewshowview
}
1266 \func{void
}{ShowView
}{\param{wxPropertySheet *
}{sheet
},
\param{wxPanel *
}{panel
}}
1268 Associates this view with the given panel, and shows the view.
1270 \section{\class{wxRealFormValidator
}: wxPropertyFormValidator
}\label{wxrealformvalidator
}
1272 \overview{Validator classes
}{validatorclasses
}
1274 This class validates a range of real values for form views. The associated panel item must be a wxText.
1276 \membersection{wxRealFormValidator::wxRealFormValidator
}
1278 \func{void
}{wxRealFormValidator
}{\param{float
}{min=
0.0},
\param{float
}{max=
0.0},
1279 \param{long
}{ flags=
0}}
1281 Constructor. Assigning zero to minimum and maximum values indicates that there is no range to check.
1284 \section{\class{wxStringFormValidator
}: wxPropertyFormValidator
}\label{wxstringformvalidator
}
1286 \overview{Validator classes
}{validatorclasses
}
1288 This class validates a string value for a form view, with an optional choice of possible values.
1289 The associated panel item must be a wxText, wxListBox or wxChoice. For wxListBox and wxChoice items,
1290 if the item is empty, the validator attempts to initialize the item from the strings in
1291 the validator. Note that this does not happen for XView wxChoice items since XView cannot reinitialize a wxChoice.
1293 \membersection{wxStringFormValidator::wxStringFormValidator
}
1295 \func{void
}{wxStringFormValidator
}{\param{wxStringList *
}{list=NULL
},
\param{long
}{ flags=
0}}
1297 Constructor. Supply a list of strings to indicate a choice, or no strings to allow the
1298 user to freely edit the string. The string list will be deleted when the validator is deleted.
1301 \section{\class{wxRealListValidator
}: wxPropertyListValidator
}\label{wxreallistvalidator
}
1303 \overview{Validator classes
}{validatorclasses
}
1305 This class validates a range of real values for property lists.
1307 \membersection{wxRealListValidator::wxreallistvalidator
}
1309 \func{void
}{wxRealListValidator
}{\param{float
}{min=
0.0},
\param{float
}{max=
0.0},
1310 \param{long
}{ flags=wxPROP
\_ALLOW\_TEXT\_EDITING}}
1312 Constructor. Assigning zero to minimum and maximum values indicates that there is no range to check.
1315 \section{\class{wxStringListValidator
}: wxPropertyListValidator
}\label{wxstringlistvalidator
}
1317 \overview{Validator classes
}{validatorclasses
}
1319 This class validates a string value, with an optional choice of possible values.
1321 \membersection{wxStringListValidator::wxStringListValidator
}
1323 \func{void
}{wxStringListValidator
}{\param{wxStringList *
}{list=NULL
},
\param{long
}{ flags=
0}}
1325 Constructor. Supply a list of strings to indicate a choice, or no strings to allow the
1326 user to freely edit the string. The string list will be deleted when the validator is deleted.
1329 \chapter{Classes by category
}\label{classesbycat
}
1331 A classification of property sheet classes by category.
1333 \section{Data classes
}
1335 \begin{itemize
}\itemsep=
0pt
1336 \item \helpref{wxProperty
}{wxproperty
}
1337 \item \helpref{wxPropertyValue
}{wxpropertyvalue
}
1338 \item \helpref{wxPropertySheet
}{wxpropertysheet
}
1342 \section{Validator classes
}\label{validatorclasses
}
1344 Validators check that the values the user has entered for a property are
1345 valid. They can also define specific ways of entering data, such as a
1346 file selector for a filename, and they are responsible for transferring
1347 values between the wxProperty and the physical display.
1351 \begin{itemize
}\itemsep=
0pt
1352 \item \helpref{wxPropertyValidator
}{wxproperty
}
1353 \item \helpref{wxPropertyListValidator
}{wxpropertylistvalidator
}
1354 \item \helpref{wxPropertyFormValidator
}{wxpropertyformvalidator
}
1357 List view validators:
1359 \begin{itemize
}\itemsep=
0pt
1360 \item \helpref{wxBoolListValidator
}{wxboollistvalidator
}
1361 \item \helpref{wxFilenameListValidator
}{wxfilenamelistvalidator
}
1362 \item \helpref{wxIntegerListValidator
}{wxintegerlistvalidator
}
1363 \item \helpref{wxListOfStringsListValidator
}{wxlistofstringslistvalidator
}
1364 \item \helpref{wxRealListValidator
}{wxreallistvalidator
}
1365 \item \helpref{wxStringListValidator
}{wxstringlistvalidator
}
1368 Form view validators:
1370 \begin{itemize
}\itemsep=
0pt
1371 \item \helpref{wxBoolFormValidator
}{wxboolformvalidator
}
1372 \item \helpref{wxIntegerFormValidator
}{wxintegerformvalidator
}
1373 \item \helpref{wxRealFormValidator
}{wxrealformvalidator
}
1374 \item \helpref{wxStringFormValidator
}{wxstringformvalidator
}
1377 \section{View classes
}\label{viewclasses
}
1379 View classes mediate between a property sheet and a physical window.
1381 \begin{itemize
}\itemsep=
0pt
1382 \item \helpref{wxPropertyView
}{wxpropertyview
}
1383 \item \helpref{wxPropertyListView
}{wxpropertylistview
}
1384 \item \helpref{wxPropertyFormView
}{wxpropertyformview
}
1387 \section{Window classes
}\label{windowclasses
}
1389 The class library defines some window classes that can be used as-is with a suitable
1390 view class and property sheet.
1392 \begin{itemize
}\itemsep=
0pt
1393 \item \helpref{wxPropertyFormFrame
}{wxpropertyformframe
}
1394 \item \helpref{wxPropertyFormDialog
}{wxpropertyformdialog
}
1395 \item \helpref{wxPropertyFormPanel
}{wxpropertyformpanel
}
1396 \item \helpref{wxPropertyListFrame
}{wxpropertylistframe
}
1397 \item \helpref{wxPropertyListDialog
}{wxpropertylistdialog
}
1398 \item \helpref{wxPropertyListPanel
}{wxpropertylistpanel
}
1401 \section{Registry classes
}
1403 A validator registry is a list of validators that can be applied to properties in a property sheet.
1404 There may be one or more registries per property view.
1406 \begin{itemize
}\itemsep=
0pt
1407 \item \helpref{wxPropertyValidatorRegistry
}{wxpropertyvalidatorregistry
}
1411 \chapter{Topic overviews
}\label{overviews
}
1413 This chapter contains a selection of topic overviews.
1415 \section{Property classes overview
}\label{propertyoverview
}
1417 The property classes help a programmer to express relationships between
1418 data and physical windows, in particular:
1420 \begin{itemize
}\itemsep=
0pt
1421 \item the transfer of data to and from the physical controls;
1422 \item the behaviour of various controls and custom windows for particular
1424 \item the validation of data, notifying the user when incorrect data is entered,
1425 or even better, constraining the input so only valid data can be entered.
1428 With a consistent framework, the programmer should be able to use existing
1429 components and design new ones in a principled manner, to solve many data entry
1432 Each datum is represented in a
\helpref{wxProperty
}{wxproperty
}, which has a name and a value.
1433 Various C++ types are permitted in the value of a property, and the property can store a pointer
1434 to the data instead of a copy of the data. A
\helpref{wxPropertySheet
}{wxpropertysheet
} represents a number of these properties.
1436 These two classes are independent from the way in which the data is visually manipulated. To
1437 mediate between property sheets and windows, the abstract class
\helpref{wxPropertyView
}{wxpropertyview
} is
1438 available for programmers to derive new kinds of view. One kind of view that is available is the
\helpref{wxPropertyListView
}{wxpropertylistview
},
1439 which displays the data in a Visual Basic-style list, with a small number of controls for editing
1440 the currently selected property. Another is
\helpref{wxPropertyFormView
}{wxpropertyformview
} which
1441 mediates between an existing dialog or panel and the property sheet.
1443 The hard work of mediation is actually performed by validators, which are instances of classes
1444 derived from
\helpref{wxPropertyValidator
}{wxpropertyvalidator
}. A validator is associated with
1445 a particular property and is responsible for
1446 responding to user interface events, and displaying, updating and checking the property value.
1447 Because a validator's behaviour depends largely on the kind of view being used, there has to be
1448 a separate hierarchy of validators for each class of view. So for wxPropertyListView, there is
1449 an abstract class
\helpref{wxPropertyListValidator
}{wxpropertylistvalidator
} from which concrete
1450 classes are derived, such as
\helpref{wxRealListValidator
}{wxreallistvalidator
} and
1451 \rtfsp\helpref{wxStringListValidator
}{wxstringlistvalidator
}.
1453 A validator can be explicitly set for a property, so there is no doubt which validator
1454 should be used to edit that property. However, it is also possible to define a registry
1455 of validators, and have the validator chosen on the basis of the
{\it role
} of the property.
1456 So a property with a ``filename" role would match the ``filename" validator, which pops
1457 up a file selector when the user double clicks on the property.
1459 You don't have to define your own frame or window classes: there are some predefined
1460 that will work with the property list view. See
\helpref{Window classes
}{windowclasses
} for
1463 \subsection{Example
1: Property list view
}
1465 The following code fragment shows the essentials of creating a registry of
1466 standard validators, a property sheet containing some properties, and
1467 a property list view and dialog or frame. RegisterValidators will be
1468 called on program start, and PropertySheetTest is called in response to a
1471 Note how some properties are created with an explicit reference to
1472 a validator, and others are provided with a ``role'' which can be matched
1473 against a validator in the registry.
1475 The interface generated by this test program is shown in the section
\helpref{Appearance and
1476 behaviour of a property list view
}{appearance
}.
1479 void RegisterValidators(void)
1481 myListValidatorRegistry.RegisterValidator((wxString)"real", new wxRealListValidator);
1482 myListValidatorRegistry.RegisterValidator((wxString)"string", new wxStringListValidator);
1483 myListValidatorRegistry.RegisterValidator((wxString)"integer", new wxIntegerListValidator);
1484 myListValidatorRegistry.RegisterValidator((wxString)"bool", new wxBoolListValidator);
1487 void PropertyListTest(Bool useDialog)
1489 wxPropertySheet *sheet = new wxPropertySheet;
1491 sheet->AddProperty(new wxProperty("fred",
1.0, "real"));
1492 sheet->AddProperty(new wxProperty("tough choice", (Bool)TRUE, "bool"));
1493 sheet->AddProperty(new wxProperty("ian", (long)
45, "integer", new wxIntegerListValidator(-
50,
50)));
1494 sheet->AddProperty(new wxProperty("bill",
25.0, "real", new wxRealListValidator(
0.0,
100.0)));
1495 sheet->AddProperty(new wxProperty("julian", "one", "string"));
1496 sheet->AddProperty(new wxProperty("bitmap", "none", "string", new wxFilenameListValidator("Select a bitmap file", "*.bmp")));
1497 wxStringList *strings = new wxStringList("one", "two", "three", NULL);
1498 sheet->AddProperty(new wxProperty("constrained", "one", "string", new wxStringListValidator(strings)));
1500 wxPropertyListView *view =
1501 new wxPropertyListView(NULL,
1502 wxPROP_BUTTON_CHECK_CROSS|wxPROP_DYNAMIC_VALUE_FIELD|wxPROP_PULLDOWN);
1504 wxDialogBox *propDialog = NULL;
1505 wxPropertyListFrame *propFrame = NULL;
1508 propDialog = new wxPropertyListDialog(view, NULL, "Property Sheet Test", TRUE, -
1, -
1,
400,
500);
1512 propFrame = new wxPropertyListFrame(view, NULL, "Property Sheet Test", -
1, -
1,
400,
500);
1515 view->AddRegistry(&myListValidatorRegistry);
1519 view->ShowView(sheet, propDialog);
1520 propDialog->Centre(wxBOTH);
1521 propDialog->Show(TRUE);
1525 propFrame->Initialize();
1526 view->ShowView(sheet, propFrame->GetPropertyPanel());
1527 propFrame->Centre(wxBOTH);
1528 propFrame->Show(TRUE);
1533 \subsection{Example
2: Property form view
}
1535 This example is similar to Example
1, but uses a property form view to
1536 edit a property sheet using a predefined dialog box.
1539 void RegisterValidators(void)
1541 myFormValidatorRegistry.RegisterValidator((wxString)"real", new wxRealFormValidator);
1542 myFormValidatorRegistry.RegisterValidator((wxString)"string", new wxStringFormValidator);
1543 myFormValidatorRegistry.RegisterValidator((wxString)"integer", new wxIntegerFormValidator);
1544 myFormValidatorRegistry.RegisterValidator((wxString)"bool", new wxBoolFormValidator);
1547 void PropertyFormTest(Bool useDialog)
1549 wxPropertySheet *sheet = new wxPropertySheet;
1551 sheet->AddProperty(new wxProperty("fred",
25.0, "real", new wxRealFormValidator(
0.0,
100.0)));
1552 sheet->AddProperty(new wxProperty("tough choice", (Bool)TRUE, "bool"));
1553 sheet->AddProperty(new wxProperty("ian", (long)
45, "integer", new wxIntegerFormValidator(-
50,
50)));
1554 sheet->AddProperty(new wxProperty("julian", "one", "string"));
1555 wxStringList *strings = new wxStringList("one", "two", "three", NULL);
1556 sheet->AddProperty(new wxProperty("constrained", "one", "string", new wxStringFormValidator(strings)));
1558 wxPropertyFormView *view = new wxPropertyFormView(NULL);
1560 wxDialogBox *propDialog = NULL;
1561 wxPropertyFormFrame *propFrame = NULL;
1564 propDialog = new wxPropertyFormDialog(view, NULL, "Property Form Test", TRUE, -
1, -
1,
400,
300);
1568 propFrame = new wxPropertyFormFrame(view, NULL, "Property Form Test", -
1, -
1,
400,
300);
1569 propFrame->Initialize();
1572 wxPanel *panel = propDialog ? propDialog : propFrame->GetPropertyPanel();
1573 panel->SetLabelPosition(wxVERTICAL);
1575 // Add items to the panel
1577 (void) new wxButton(panel, (wxFunction)NULL, "OK", -
1, -
1, -
1, -
1,
0, "ok");
1578 (void) new wxButton(panel, (wxFunction)NULL, "Cancel", -
1, -
1,
80, -
1,
0, "cancel");
1579 (void) new wxButton(panel, (wxFunction)NULL, "Update", -
1, -
1,
80, -
1,
0, "update");
1580 (void) new wxButton(panel, (wxFunction)NULL, "Revert", -
1, -
1, -
1, -
1,
0, "revert");
1583 // The name of this text item matches the "fred" property
1584 (void) new wxText(panel, (wxFunction)NULL, "Fred", "", -
1, -
1,
90, -
1,
0, "fred");
1585 (void) new wxCheckBox(panel, (wxFunction)NULL, "Yes or no", -
1, -
1, -
1, -
1,
0, "tough choice");
1586 (void) new wxSlider(panel, (wxFunction)NULL, "Sliding scale",
0, -
50,
50,
100, -
1, -
1, wxHORIZONTAL, "ian");
1588 (void) new wxListBox(panel, (wxFunction)NULL, "Constrained", wxSINGLE, -
1, -
1,
100,
90,
0, NULL,
0, "constrained");
1590 view->AddRegistry(&myFormValidatorRegistry);
1594 view->ShowView(sheet, propDialog);
1595 view->AssociateNames();
1596 view->TransferToDialog();
1597 propDialog->Centre(wxBOTH);
1598 propDialog->Show(TRUE);
1602 view->ShowView(sheet, propFrame->GetPropertyPanel());
1603 view->AssociateNames();
1604 view->TransferToDialog();
1605 propFrame->Centre(wxBOTH);
1606 propFrame->Show(TRUE);
1611 \section{Validator classes overview
}\label{validatoroverview
}
1613 Classes:
\helpref{Validator classes
}{validatorclasses
}
1615 The validator classes provide functionality for mediating between a wxProperty and
1616 the actual display. There is a separate family of validator classes for each
1617 class of view, since the differences in user interface for these views implies
1618 that little common functionality can be shared amongst validators.
1620 \subsection{wxPropertyValidator overview
}\label{wxpropertyvalidatoroverview
}
1622 Class:
\helpref{wxPropertyValidator
}{wxpropertyvalidator
}
1624 This class is the root of all property validator classes. It contains a small
1625 amount of common functionality, including functions to convert between
1626 strings and C++ values.
1628 A validator is notionally an object which sits between a property and its displayed
1629 value, and checks that the value the user enters is correct, giving an error message
1630 if the validation fails. In fact, the validator does more than that, and is akin to
1631 a view class but at a finer level of detail. It is also responsible for
1632 loading the dialog box control with the value from the property, putting it back
1633 into the property, preparing special controls for editing the value, and
1634 may even invoke special dialogs for editing the value in a convenient way.
1636 In a property list dialog, there is quite a lot of scope for supplying custom dialogs,
1637 such as file or colour selectors. For a form dialog, there is less scope because
1638 there is no concept of `detailed editing' of a value: one control is associated with
1639 one property, and there is no provision for invoking further dialogs. The reader
1640 may like to work out how the form view could be extended to provide some of the
1641 functionality of the property list!
1643 Validator objects may be associated explictly with a wxProperty, or they may be
1644 indirectly associated by virtue of a property `kind' that matches validators having
1645 that kind. In the latter case, such validators are stored in a validator registry
1646 which is passed to the view before the dialog is shown. If the validator takes
1647 arguments, such as minimum and maximum values in the case of a wxIntegerListValidator,
1648 then the validator must be associated explicitly with the property. The validator
1649 will be deleted when the property is deleted.
1651 \subsection{wxPropertyListValidator overview
}\label{wxpropertylistvalidatoroverview
}
1653 Class:
\helpref{wxPropertyListValidator
}{wxpropertylistvalidator
}
1655 This class is the abstract base class for property list view validators.
1656 The list view acts upon a user interface containing a list of properties,
1657 a text item for direct property value editing, confirm/cancel buttons for the value,
1658 a pulldown list for making a choice between values, and OK/Cancel/Help buttons
1659 for the dialog (see
\helpref{property list appearance
}{appearance
}).
1661 By overriding virtual functions, the programmer can create custom
1662 behaviour for different kinds of property. Custom behaviour can use just the
1663 available controls on the property list dialog, or the validator can
1664 invoke custom editors with quite different controls, which pop up in
1665 `detailed editing' mode.
1667 See the detailed class documentation for the members you should override
1668 to give your validator appropriate behaviour.
1670 \subsection{wxPropertyFormValidator overview
}\label{wxpropertyformvalidatoroverview
}
1672 This class is the abstract base class for property form view validators.
1673 The form view acts upon an existing dialog box or panel, where either the
1674 panel item names correspond to property names, or the programmer has explicitly
1675 associated the panel item with the property.
1677 By overriding virtual functions, the programmer determines how
1678 values are displayed or retrieved, and the checking that the validator does.
1680 See the detailed class documentation for the members you should override
1681 to give your validator appropriate behaviour.
1683 \section{View classes overview
}\label{viewoverview
}
1685 Classes:
\helpref{View classes
}{viewclasses
}
1687 An instance of a view class relates a property sheet with an actual window.
1688 Currently, there are two classes of view: wxPropertyListView and wxPropertyFormView.
1690 \subsection{wxPropertyView overview
}\label{wxpropertyviewoverview
}
1692 Class:
\helpref{wxPropertyView
}{wxpropertyview
}
1694 This is the abstract base class for property views.
1696 \subsection{wxPropertyListView overview
}\label{wxpropertylistviewoverview
}
1698 Class:
\helpref{wxPropertyListView
}{wxpropertylistview
}
1700 The property list view defines the relationship between a property sheet and
1701 a property list dialog or panel. It manages user interface events such as
1702 clicking on a property, pressing return in the text edit field, and clicking
1703 on Confirm or Cancel. These events cause member functions of the
1704 class to be called, and these in turn may call member functions of
1705 the appropriate validator to be called, to prepare controls, check the property value,
1706 invoke detailed editing, etc.
1708 \subsection{wxPropertyFormView overview
}\label{wxpropertyformviewoverview
}
1710 Class:
\helpref{wxPropertyFormView
}{wxpropertyformview
}
1712 The property form view manages the relationship between a property sheet
1713 and an existing dialog or panel.
1715 You must first create a panel or dialog box for the view to work on.
1716 The panel should contain panel items with names that correspond to
1717 properties in your property sheet; or you can explicitly set the
1718 panel item for each property.
1720 Apart from any custom panel items that you wish to control independently
1721 of the property-editing items, wxPropertyFormView takes over the
1722 processing of item events. It can also control normal dialog behaviour such
1723 as OK, Cancel, so you should also create some standard buttons that the property view
1724 can recognise. Just create the buttons with standard names and the view
1725 will do the rest. The following button names are recognised:
1727 \begin{itemize
}\itemsep=
0pt
1728 \item {\bf ok
}: indicates the OK button. Calls wxPropertyFormView::OnOk. By default,
1729 checks and updates the form values, closes and deletes the frame or dialog, then deletes the view.
1730 \item {\bf cancel
}: indicates the Cancel button. Calls wxPropertyFormView::OnCancel. By default,
1731 closes and deletes the frame or dialog, then deletes the view.
1732 \item {\bf help
}: indicates the Help button. Calls wxPropertyFormView::OnHelp. This needs
1733 to be overridden by the application for anything interesting to happen.
1734 \item {\bf revert
}: indicates the Revert button. Calls wxPropertyFormView::OnRevert,
1735 which by default transfers the wxProperty values to the panel items (in effect
1736 undoing any unsaved changes in the items).
1737 \item {\bf update
}: indicates the Revert button. Calls wxPropertyFormView::OnUpdate, which
1738 by defaults transfers the displayed values to the wxProperty objects.
1741 \section{wxPropertySheet overview
}\label{wxpropertysheetoverview
}
1743 Classes:
\helpref{wxPropertySheet
}{wxpropertysheet
},
\helpref{wxProperty
}{wxproperty
},
\helpref{wxPropertyValue
}{wxpropertyvalue
}
1745 A property sheet defines zero or more properties. This is a bit like an explicit representation of
1746 a C++ object. wxProperty objects can have values which are pointers to C++ values, or they
1747 can allocate their own storage for values.
1749 Because the property sheet representation is explicit and can be manipulated by
1750 a program, it is a convenient form to be used for a variety of
1751 editing purposes. wxPropertyListView and wxPropertyFormView are two classes that
1752 specify the relationship between a property sheet and a user interface. You could imagine
1753 other uses for wxPropertySheet, for example to generate a form-like user interface without
1754 the need for GUI programming. Or for storing the names and values of command-line switches, with the
1755 option to subsequently edit these values using a wxPropertyListView.
1757 A typical use for a property sheet is to represent values of an object
1758 which are only implicit in the current representation of it. For
1759 example, in Visual Basic and similar programming environments, you can
1760 `edit a button', or rather, edit the button's properties. One of the
1761 properties you can edit is
{\it width
} - but there is no explicit
1762 representation of width in a wxWindows button; instead, you call SetSize
1763 and GetSize members. To translate this into a consisent,
1764 property-oriented scheme, we could derive a new class
1765 wxButtonWithProperties, which has two new functions: SetProperty and
1766 GetProperty. SetProperty accepts a property name and a value, and calls
1767 an appropriate function for the property that is being passed.
1768 GetProperty accepts a property name, returning a property value. So
1769 instead of having to use the usual arbitrary set of C++ member functions
1770 to set or access attributes of a window, programmer deals merely with
1771 SetValue/GetValue, and property names and values.
1772 We now have a single point at which we can modify or query an object by specifying
1773 names and values at run-time. (The implementation of SetProperty and GetProperty
1774 is probably quite messy and involves a large if-then-else statement to
1775 test the property name and act accordingly.)
1777 When the user invokes the property editor for a wxButtonWithProperties, the system
1778 creates a wxPropertySheet with `imaginary' properties such as width, height, font size
1779 and so on. For each property, wxButtonWithProperties::GetProperty is called, and the result is
1780 passed to the corresponding wxProperty. The wxPropertySheet is passed to a wxPropertyListView
1781 as described elsewhere, and the user edits away. When the user has finished editing, the system calls
1782 wxButtonWithProperties::SetProperty to transfer the wxProperty value back into the button
1783 by way of an appropriate call, wxWindow::SetSize in the case of width and height properties.