1 \chapter{Alphabetical class reference
}\label{classref
}
2 \setheader{{\it CHAPTER
\thechapter}}{}{}{}{}{{\it CHAPTER
\thechapter}}%
3 \setfooter{\thepage}{}{}{}{}{\thepage}%
9 \overview{Property classes overview
}{propertyoverview
}
12 \section{\class{wxBoolFormValidator
}: wxPropertyFormValidator
}\label{wxboolformvalidator
}
14 \overview{Validator classes
}{validatorclasses
}
16 This class validates a boolean value for a form view. The associated panel item must be a wxCheckBox.
18 \membersection{wxBoolFormValidator::wxBoolFormValidator
}
20 \func{void
}{wxBoolFormValidator
}{\param{long
}{flags=
0}}
24 \section{\class{wxBoolListValidator
}: wxPropertyListValidator
}\label{wxboollistvalidator
}
26 \overview{Validator classes
}{validatorclasses
}
28 This class validates a boolean value for a list view.
30 \membersection{wxBoolListValidator::wxBoolListValidator
}
32 \func{void
}{wxBoolListValidator
}{\param{long
}{flags=
0}}
36 \section{\class{wxIntegerFormValidator
}: wxPropertyFormValidator
}\label{wxintegerformvalidator
}
38 \overview{Validator classes
}{validatorclasses
}
40 This class validates a range of integer values for a form view. The associated panel item must be a wxText
43 \membersection{wxIntegerFormValidator::wxIntegerFormValidator
}
45 \func{void
}{wxIntegerFormValidator
}{\param{long
}{min=
0},
\param{long
}{max=
0},
46 \param{long
}{ flags=
0}}
48 Constructor. Assigning zero to minimum and maximum values indicates that there is no range to check.
51 \section{\class{wxIntegerListValidator
}: wxPropertyListValidator
}\label{wxintegerlistvalidator
}
53 \overview{Validator classes
}{validatorclasses
}
55 This class validates a range of integer values for a list view.
57 \membersection{wxIntegerListValidator::wxIntegerListValidator
}
59 \func{void
}{wxIntegerListValidator
}{\param{long
}{min=
0},
\param{long
}{max=
0},
60 \param{long
}{ flags=wxPROP
\_ALLOW\_TEXT\_EDITING}}
62 Constructor. Assigning zero to minimum and maximum values indicates that there is no range to check.
64 \section{\class{wxFilenameListValidator
}: wxPropertyListValidator
}\label{wxfilenamelistvalidator
}
66 \overview{Validator classes
}{validatorclasses
}
68 This class validates a filename for a list view, allowing the user to edit it textually and also popping up
69 a file selector in ``detailed editing" mode.
71 \membersection{wxFilenameListValidator::wxFilenameListValidator
}
73 \func{void
}{wxFilenameListValidator
}{\param{wxString
}{message = ``Select a file"
},
\param{wxString
}{wildcard = ``*.*"
},
74 \param{long
}{ flags=
0}}
76 Constructor. Supply an optional message and wildcard.
78 \section{\class{wxListOfStringsListValidator
}: wxPropertyListValidator
}\label{wxlistofstringslistvalidator
}
80 \overview{Validator classes
}{validatorclasses
}
82 This class validates a list of strings for a list view. When editing the property,
83 a dialog box is presented for adding, deleting or editing entries in the list.
84 At present no constraints may be supplied.
86 You can construct a string list property value by constructing a wxStringList object.
91 myListValidatorRegistry.RegisterValidator((wxString)"stringlist",
92 new wxListOfStringsListValidator);
94 wxStringList *strings = new wxStringList("earth", "fire", "wind", "water", NULL);
96 sheet->AddProperty(new wxProperty("fred", strings, "stringlist"));
99 \membersection{wxListOfStringsListValidator::wxListofStringsListValidator
}
101 \func{void
}{wxListOfStringsListValidator
}{\param{long
}{ flags=
0}}
105 \section{\class{wxProperty
}: wxObject
}\label{wxproperty
}
107 The
{\bf wxProperty
} class represents a property, with a
\helpref{wxPropertyValue
}{wxpropertyvalue
}\rtfsp
108 containing the actual value, a name a role, an optional validator, and
109 an optional associated window.
111 A property might correspond to an actual C++ data member, or it
112 might correspond to a conceptual property, such as the width of a window.
113 There is no explicit data member
{\it wxWindow::width
}, but it may be convenient
114 to invent such a property for the purposes of editing attributes of the window.
115 The properties in the property sheet can be mapped to ``reality" by
116 whatever means (in this case by calling wxWindow::SetSize when the user has
117 finished editing the property sheet).
119 A validator may be associated with the property in order to ensure that this and
120 only this validator will be used for editing and validating the property.
121 An alternative method is to use the
{\it role
} parameter to specify what kind
122 of validator would be appropriate; for example, specifying ``filename" for the role
123 would allow the property view to find an appropriate validator at edit time.
126 \membersection{wxProperty::wxProperty
}
128 \func{void
}{wxProperty
}{\void}
130 \func{void
}{wxProperty
}{\param{wxProperty\&
}{prop
}}
132 \func{void
}{wxProperty
}{\param{wxString
}{ name
},
\param{wxString
}{ role
},
\param{wxPropertyValidator *
}{validator=NULL
}}
134 \func{void
}{wxProperty
}{\param{wxString
}{ name
},
\param{const wxPropertyValue\&
}{ val
},
\param{wxString
}{ role
},
\param{wxPropertyValidator *
}{validator=NULL
}}
138 \membersection{wxProperty::
\destruct{wxProperty
}}
140 \func{void
}{\destruct{wxProperty
}}{\void}
142 Destructor. Destroys the wxPropertyValue, and the property validator if there is one. However, if the
143 actual C++ value in the wxPropertyValue is a pointer, the data in that variable is not destroyed.
145 \membersection{wxProperty::GetValue
}
147 \func{wxPropertyValue\&
}{GetValue
}{\void}
149 Returns a reference to the property value.
151 \membersection{wxProperty::GetValidator
}
153 \func{wxPropertyValidator *
}{GetValidator
}{\void}
155 Returns a pointer to the associated property validator (if any).
157 \membersection{wxProperty::GetName
}
159 \func{wxString\&
}{GetName
}{\void}
161 Returns the name of the property.
163 \membersection{wxProperty::GetRole
}
165 \func{wxRole\&
}{GetRole
}{\void}
167 Returns the role of the property, to be used when choosing an appropriate validator.
169 \membersection{wxProperty::GetWindow
}
171 \func{wxWindow *
}{GetWindow
}{\void}
173 Returns the window associated with the property (if any).
175 \membersection{wxProperty::SetValue
}
177 \func{void
}{SetValue
}{\param{wxPropertyValue\&
}{ val
}}
179 Sets the value of the property.
181 \membersection{wxProperty::SetName
}
183 \func{void
}{SetName
}{\param{wxString\&
}{ name
}}
185 Sets the name of the property.
187 \membersection{wxProperty::SetRole
}
189 \func{void
}{SetRole
}{\param{wxString\&
}{ role
}}
191 Sets the role of the property.
193 \membersection{wxProperty::SetValidator
}
195 \func{void
}{SetValidator
}{\param{wxPropertyValidator *
}{validator
}}
197 Sets the validator: this will be deleted when the property is deleted.
199 \membersection{wxProperty::SetWindow
}
201 \func{void
}{SetWindow
}{\param{wxWindow *
}{win
}}
203 Sets the window associated with the property.
205 \membersection{wxProperty::operator $=$
}
207 \func{void
}{operator $=$
}{\param{const wxPropertyValue\&
}{ val
}}
211 \section{\class{wxPropertyFormValidator
}: wxPropertyValidator
}\label{wxpropertyformvalidator
}
213 The
{\bf wxPropertyFormValidator
} abstract class is the root of classes that define validation
214 for a wxPropertyFormView.
217 \section{\class{wxPropertyFormDialog
}: wxDialogBox
}\label{wxpropertyformdialog
}
219 The
{\bf wxPropertyFormDialog
} class is a prepackaged dialog which can
220 be used for viewing a form property sheet. Pass a property form view object, and the dialog
221 will pass OnClose and OnDefaultAction listbox messages to the view class for
224 \membersection{wxPropertyFormDialog::wxPropertyFormDialog
}
226 \func{void
}{wxPropertyFormDialog
}{\param{wxPropertyFormView *
}{view
},
\param{wxWindow *
}{parent
},
\param{char *
}{title
},
227 \param{Bool
}{ modal=FALSE
},
\param{int
}{ x=-
1},
\param{int
}{ y=-
1},
\param{int
}{ width=-
1},
\param{int
}{height=-
1},
228 \param{long
}{ style=wxDEFAULT
\_DIALOG\_STYLE},
\param{char *
}{name=``dialogBox"
}}
232 \membersection{wxPropertyFormDialog::
\destruct{wxPropertyFormDialog
}}
234 \func{void
}{\destruct{wxPropertyFormDialog
}}{\void}
239 \section{\class{wxPropertyFormFrame
}: wxFrame
}\label{wxpropertyformframe
}
241 The
{\bf wxPropertyFormFrame
} class is a prepackaged frame which can
242 be used for viewing a property form. Pass a property form view object, and the frame
243 will pass OnClose messages to the view class for processing.
245 Call Initialize to create the panel and associate the view; override OnCreatePanel
246 if you wish to use a panel class other than the default wxPropertyFormPanel.
248 \membersection{wxPropertyFormFrame::wxPropertyFormFrame
}
250 \func{void
}{wxPropertyFormFrame
}{\param{wxPropertyFormView *
}{view
},
\param{wxFrame *
}{parent
},
\param{char *
}{title
},
251 \param{int
}{ x=-
1},
\param{int
}{ y=-
1},
\param{int
}{ width=-
1},
\param{int
}{height=-
1},
252 \param{long
}{ style=wxSDI $\|$ wxDEFAULT
\_FRAME},
\param{char *
}{name=``frame"
}}
256 \membersection{wxPropertyFormFrame::
\destruct{wxPropertyFormFrame
}}
258 \func{void
}{\destruct{wxPropertyFormFrame
}}{\void}
262 \membersection{wxPropertyFormFrame::GetPropertyPanel
}
264 \func{wxPanel *
}{GetPropertyPanel
}{\void}
266 Returns the panel associated with the frame.
268 \membersection{wxPropertyFormFrame::Initialize
}
270 \func{Bool
}{Initialize
}{\void}
272 Must be called to create the panel and associate the view with the panel and frame.
274 \membersection{wxPropertyFormFrame::OnCreatePanel
}
276 \func{wxPanel *
}{OnCreatePanel
}{\param{wxFrame *
}{parent
},
\param{wxPropertyFormView *
}{view
}}
278 Creates a panel. Override this to create a panel type other than wxPropertyFormPanel.
281 \section{\class{wxPropertyFormPanel
}: wxPanel
}\label{wxpropertyformpanel
}
283 The
{\bf wxPropertyFormPanel
} class is a prepackaged panel which can
284 be used for viewing a property form. Pass a property form view object, and the panel
285 will pass OnDefaultAction listbox messages to the view class for
288 \membersection{wxPropertyFormPanel::wxPropertyFormPanel
}
290 \func{void
}{wxPropertyFormPanel
}{\param{wxPropertyFormView *
}{view
},
\param{wxWindow *
}{parent
},
291 \param{int
}{ x=-
1},
\param{int
}{ y=-
1},
\param{int
}{ width=-
1},
\param{int
}{height=-
1},
292 \param{long
}{ style=
0},
\param{char *
}{name=``panel"
}}
296 \membersection{wxPropertyFormPanel::
\destruct{wxPropertyFormPanel
}}
298 \func{void
}{\destruct{wxPropertyFormPanel
}}{\void}
304 \section{\class{wxPropertyFormValidator
}: wxPropertyValidator
}\label{wxpropertyformvalidatir
}
306 \overview{wxPropertyFormValidator overview
}{wxpropertyformvalidatoroverview
}
308 The
{\bf wxPropertyFormValidator
} class defines a base class for form validators. By overriding virtual functions,
309 the programmer can create custom behaviour for kinds of property.
311 \membersection{wxPropertyFormValidator::wxPropertyFormValidator
}
313 \func{void
}{wxPropertyFormValidator
}{\param{long
}{ flags =
0}}
317 \membersection{wxPropertyFormValidator::
\destruct{wxPropertyFormValidator
}}
319 \func{void
}{\destruct{wxPropertyFormValidator
}}{\void}
323 \membersection{wxPropertyFormValidator::OnCommand
}
325 \func{Bool
}{OnCommand
}{\param{wxProperty *
}{property
},
\param{wxPropertyFormView *
}{view
},
326 \param{wxWindow *
}{parentWindow
},
\param{wxCommandEvent\&
}{event
}}
328 Called when the control corresponding to the property receives a command (if not intercepted
329 by a callback associated with the actual control).
331 \membersection{wxPropertyFormValidator::OnCheckValue
}
333 \func{Bool
}{OnCheckValue
}{\param{wxProperty *
}{property
},
\param{wxPropertyFormView *
}{view
},
334 \param{wxWindow *
}{parentWindow
}}
336 Called when the view checks the property value. The value checked by this validator should be taken from the
337 panel item corresponding to the property.
339 \membersection{wxPropertyFormValidator::OnDisplayValue
}
341 \func{Bool
}{OnDisplayValue
}{\param{wxProperty *
}{property
},
\param{wxPropertyFormView *
}{view
},
342 \param{wxWindow *
}{parentWindow
}}
344 Should display the property value in the appropriate control.
346 \membersection{wxPropertyFormValidator::OnDoubleClick
}
348 \func{Bool
}{OnDoubleClick
}{\param{wxProperty *
}{property
},
\param{wxPropertyFormView *
}{view
},
349 \param{wxWindow *
}{parentWindow
}}
351 Called when the control corresponding to the property is double clicked (listboxes only).
353 \membersection{wxPropertyFormValidator::OnRetrieveValue
}
355 \func{Bool
}{OnRetrieveValue
}{\param{wxProperty *
}{property
},
\param{wxPropertyFormView *
}{view
},
356 \param{wxWindow *
}{parentWindow
}}
358 Should do the transfer from the property editing area to the property itself.
361 \section{\class{wxPropertyFormView
}: wxPropertyView
}\label{wxpropertyformview
}
363 \overview{wxPropertyFormView overview
}{wxpropertyformviewoverview
}
365 The
{\bf wxPropertyFormView
} class shows a wxPropertySheet as a view onto a panel or dialog
366 box which has already been created.
368 \membersection{wxPropertyFormView::wxPropertyFormView
}
370 \func{void
}{wxPropertyFormView
}{\param{long
}{ flags =
0}}
374 \membersection{wxPropertyFormView::
\destruct{wxPropertyFormView
}}
376 \func{void
}{\destruct{wxPropertyFormView
}}{\void}
380 \membersection{wxPropertyFormView::AssociateNames
}\label{wxpropertyformviewassociatenames
}
382 \func{void
}{AssociateNames
}{\void}
384 Associates the properties with the controls on the panel. For each panel item, if the
385 panel item name is the same as a property name, the two objects will be associated.
386 This function should be called manually since the programmer may wish to do the
387 association manually.
389 \membersection{wxPropertyFormView::Check
}\label{wxpropertyformviewcheck
}
391 \func{Bool
}{Check
}{\void}
393 Checks all properties by calling the appropriate validators; returns FALSE if a validation failed.
395 \membersection{wxPropertyFormView::GetPanel
}\label{wxpropertyformviewgetpanel
}
397 \func{wxPanel *
}{GetPanel
}{\void}
399 Returns the panel associated with the view.
401 \membersection{wxPropertyFormView::GetManagedWindow
}\label{wxpropertyformviewgetmanagedwindow
}
403 \func{wxWindow *
}{GetManagedWindow
}{\void}
405 Returns the managed window (a frame or dialog) associated with the view.
407 \membersection{wxPropertyFormView::OnOk
}\label{wxpropertyformviewonok
}
409 \func{void
}{OnOk
}{\void}
411 Virtual function that will be called when the OK button on the physical window is pressed.
412 By default, checks and updates the form values, closes and deletes the frame or dialog, then deletes the view.
414 \membersection{wxPropertyFormView::OnCancel
}\label{wxpropertyformviewoncancel
}
416 \func{void
}{OnCancel
}{\void}
418 Virtual function that will be called when the Cancel button on the physical window is pressed.
419 By default, closes and deletes the frame or dialog, then deletes the view.
421 \membersection{wxPropertyFormView::OnHelp
}\label{wxpropertyformviewonhelp
}
423 \func{void
}{OnHelp
}{\void}
425 Virtual function that will be called when the Help button on the physical window is pressed.
426 This needs to be overridden by the application for anything interesting to happen.
428 \membersection{wxPropertyFormView::OnRevert
}\label{wxpropertyformviewonrevert
}
430 \func{void
}{OnRevert
}{\void}
432 Virtual function that will be called when the Revert button on the physical window is pressed.
433 By default transfers the wxProperty values to the panel items (in effect
434 undoing any unsaved changes in the items).
436 \membersection{wxPropertyFormView::OnUpdate
}\label{wxpropertyformviewonupdate
}
438 \func{void
}{OnUpdate
}{\void}
440 Virtual function that will be called when the Update button on the physical window is pressed.
441 By defaults transfers the displayed values to the wxProperty objects.
443 \membersection{wxPropertyFormView::SetManagedWindow
}\label{wxpropertyformviewsetmanagedwindow
}
445 \func{void
}{SetManagedWindow
}{\param{wxWindow *
}{win
}}
447 Sets the managed window (a frame or dialog) associated with the view.
449 \membersection{wxPropertyFormView::TransferToDialog
}\label{wxpropertyformviewtransfertodialog
}
451 \func{Bool
}{TransferToDialog
}{\void}
453 Transfers property values to the controls in the dialog.
455 \membersection{wxPropertyFormView::TransferToPropertySheet
}\label{wxpropertyformviewtransfertopropertysheet
}
457 \func{Bool
}{TransferToPropertySheet
}{\void}
459 Transfers property values from the controls in the dialog to the property sheet.
462 \section{\class{wxPropertyListDialog
}: wxDialogBox
}\label{wxpropertylistdialog
}
464 The
{\bf wxPropertyListDialog
} class is a prepackaged dialog which can
465 be used for viewing a property list. Pass a property list view object, and the dialog
466 will pass OnClose and OnDefaultAction listbox messages to the view class for
469 \membersection{wxPropertyListDialog::wxPropertyListDialog
}
471 \func{void
}{wxPropertyListDialog
}{\param{wxPropertyListView *
}{view
},
\param{wxWindow *
}{parent
},
\param{char *
}{title
},
472 \param{Bool
}{ modal=FALSE
},
\param{int
}{ x=-
1},
\param{int
}{ y=-
1},
\param{int
}{ width=-
1},
\param{int
}{height=-
1},
473 \param{long
}{ style=wxDEFAULT
\_DIALOG\_STYLE},
\param{char *
}{name=``dialogBox"
}}
477 \membersection{wxPropertyListDialog::
\destruct{wxPropertyListDialog
}}
479 \func{void
}{\destruct{wxPropertyListDialog
}}{\void}
484 \section{\class{wxPropertyListFrame
}: wxFrame
}\label{wxpropertylistframe
}
486 The
{\bf wxPropertyListFrame
} class is a prepackaged frame which can
487 be used for viewing a property list. Pass a property list view object, and the frame
488 will pass OnClose messages to the view class for processing.
490 Call Initialize to create the panel and associate the view; override OnCreatePanel
491 if you wish to use a panel class other than the default wxPropertyListPanel.
493 \membersection{wxPropertyListFrame::wxPropertyListFrame
}
495 \func{void
}{wxPropertyListFrame
}{\param{wxPropertyListView *
}{view
},
\param{wxFrame *
}{parent
},
\param{char *
}{title
},
496 \param{int
}{ x=-
1},
\param{int
}{ y=-
1},
\param{int
}{ width=-
1},
\param{int
}{height=-
1},
497 \param{long
}{ style=wxSDI $\|$ wxDEFAULT
\_FRAME},
\param{char *
}{name=``frame"
}}
501 \membersection{wxPropertyListFrame::
\destruct{wxPropertyListFrame
}}
503 \func{void
}{\destruct{wxPropertyListFrame
}}{\void}
507 \membersection{wxPropertyListFrame::GetPropertyPanel
}
509 \func{wxPanel *
}{GetPropertyPanel
}{\void}
511 Returns the panel associated with the frame.
513 \membersection{wxPropertyListFrame::Initialize
}
515 \func{Bool
}{Initialize
}{\void}
517 Must be called to create the panel and associate the view with the panel and frame.
519 \membersection{wxPropertyListFrame::OnCreatePanel
}
521 \func{wxPanel *
}{OnCreatePanel
}{\param{wxFrame *
}{parent
},
\param{wxPropertyListView *
}{view
}}
523 Creates a panel. Override this to create a panel type other than wxPropertyListPanel.
526 \section{\class{wxPropertyListPanel
}: wxPanel
}\label{wxpropertylistpanel
}
528 The
{\bf wxPropertyListPanel
} class is a prepackaged panel which can
529 be used for viewing a property list. Pass a property list view object, and the panel
530 will pass OnDefaultAction listbox messages to the view class for
533 \membersection{wxPropertyListPanel::wxPropertyListPanel
}
535 \func{void
}{wxPropertyListPanel
}{\param{wxPropertyListView *
}{view
},
\param{wxWindow *
}{parent
},
536 \param{int
}{ x=-
1},
\param{int
}{ y=-
1},
\param{int
}{ width=-
1},
\param{int
}{height=-
1},
537 \param{long
}{ style=
0},
\param{char *
}{name=``panel"
}}
541 \membersection{wxPropertyListPanel::
\destruct{wxPropertyListPanel
}}
543 \func{void
}{\destruct{wxPropertyListPanel
}}{\void}
550 \section{\class{wxPropertyListValidator
}: wxPropertyValidator
}\label{wxpropertylistvalidator
}
552 \overview{wxPropertyListValidator overview
}{wxpropertylistvalidatoroverview
}
554 The
{\bf wxPropertyListValidator
} abstract class is the base class for
555 deriving validators for property lists.
557 \membersection{wxPropertyListValidator::wxPropertyListValidator
}
559 \func{void
}{wxPropertyListValidator
}{\param{long
}{ flags = wxPROP
\_ALLOW\_TEXT\_EDITING}}
563 \membersection{wxPropertyListValidator::
\destruct{wxPropertyListValidator
}}
565 \func{void
}{\destruct{wxPropertyListValidator
}}{\void}
569 \membersection{wxPropertyListValidator::OnCheckValue
}
571 \func{Bool
}{OnCheckValue
}{\param{wxProperty *
}{property
},
\param{wxPropertyListView *
}{view
},
572 \param{wxWindow *
}{parentWindow
}}
574 Called when the Tick (Confirm) button is pressed or focus is list. Return FALSE if the value
575 was invalid, which is a signal restores the old value. Return TRUE if the value was valid.
577 \membersection{wxPropertyListValidator::OnClearControls
}
579 \func{Bool
}{OnClearControls
}{\param{wxProperty *
}{property
},
\param{wxPropertyListView *
}{view
},
580 \param{wxWindow *
}{parentWindow
}}
582 Allows the clearing (enabling, disabling) of property list controls, when the focus leaves the current property.
584 \membersection{wxPropertyListValidator::OnClearDetailControls
}
586 \func{Bool
}{OnClearDetailControls
}{\param{wxProperty *
}{property
},
\param{wxPropertyListView *
}{view
},
587 \param{wxWindow *
}{parentWindow
}}
589 Called when the focus is lost, if the validator is in detailed editing mode.
591 \membersection{wxPropertyListValidator::OnDisplayValue
}
593 \func{Bool
}{OnDisplayValue
}{\param{wxProperty *
}{property
},
\param{wxPropertyListView *
}{view
},
594 \param{wxWindow *
}{parentWindow
}}
596 Should display the value in the appropriate controls. The default implementation gets the
597 textual value from the property and inserts it into the text edit control.
599 \membersection{wxPropertyListValidator::OnDoubleClick
}
601 \func{Bool
}{OnDoubleClick
}{\param{wxProperty *
}{property
},
\param{wxPropertyListView *
}{view
},
602 \param{wxWindow *
}{parentWindow
}}
604 Called when the property is double clicked. Extra functionality can be provided,
605 such as cycling through possible values.
607 \membersection{wxPropertyListValidator::OnEdit
}
609 \func{Bool
}{OnEdit
}{\param{wxProperty *
}{property
},
\param{wxPropertyListView *
}{view
},
610 \param{wxWindow *
}{parentWindow
}}
612 Called when the Edit (detailed editing) button is pressed. The default implementation
613 calls wxPropertyListView::BeginDetailedEditing; a filename validator (for example) overrides
614 this function to show the file selector.
616 \membersection{wxPropertyListValidator::OnPrepareControls
}
618 \func{Bool
}{OnPrepareControls
}{\param{wxProperty *
}{property
},
\param{wxPropertyListView *
}{view
},
619 \param{wxWindow *
}{parentWindow
}}
621 Called to allow the validator to setup the display, such enabling or disabling buttons, and
622 setting the values and selection in the standard listbox control (the one optionally used for displaying
625 \membersection{wxPropertyListValidator::OnPrepareDetailControls
}
627 \func{Bool
}{OnPrepareDetailControls
}{\param{wxProperty *
}{property
},
\param{wxPropertyListView *
}{view
},
628 \param{wxWindow *
}{parentWindow
}}
630 Called when the property is edited `in detail', i.e. when the Edit button is pressed.
632 \membersection{wxPropertyListValidator::OnRetrieveValue
}
634 \func{Bool
}{OnRetrieveValue
}{\param{wxProperty *
}{property
},
\param{wxPropertyListView *
}{view
},
635 \param{wxWindow *
}{parentWindow
}}
637 Called when Tick (Confirm) is pressed or focus is lost or view wants to update
638 the property list. Should do the transfer from the property editing area to the property itself
640 \membersection{wxPropertyListValidator::OnSelect
}
642 \func{Bool
}{OnSelect
}{\param{Bool
}{ select
},
\param{wxProperty *
}{property
},
\param{wxPropertyListView *
}{view
},
643 \param{wxWindow *
}{parentWindow
}}
645 Called when the property is selected or deselected: typically displays the value
646 in the edit control (having chosen a suitable control to display: (non)editable text or listbox).
648 \membersection{wxPropertyListValidator::OnValueListSelect
}
650 \func{Bool
}{OnValueListSelect
}{\param{wxProperty *
}{property
},
\param{wxPropertyListView *
}{view
},
651 \param{wxWindow *
}{parentWindow
}}
653 Called when the value listbox is selected. The default behaviour is to copy
654 string to text control, and retrieve the value into the property.
658 \section{\class{wxPropertyListView
}: wxPropertyView
}\label{wxpropertylistview
}
660 \overview{wxPropertyListView overview
}{wxpropertylistviewoverview
}
662 The
{\bf wxPropertyListView
} class shows a wxPropertySheet as a Visual Basic-style property list.
664 \membersection{wxPropertyListView::wxPropertyListView
}
666 \func{void
}{wxPropertyListView
}{\param{long
}{ flags = wxPROP
\_BUTTON\_DEFAULT}}
670 The
{\it flags
} argument can be a bit list of the following:
672 \begin{itemize
}\itemsep=
0pt
673 \item wxPROP
\_BUTTON\_CLOSE
674 \item wxPROP
\_BUTTON\_OK
675 \item wxPROP
\_BUTTON\_CANCEL
676 \item wxPROP
\_BUTTON\_CHECK\_CROSS
677 \item wxPROP
\_BUTTON\_HELP
678 \item wxPROP
\_DYNAMIC\_VALUE\_FIELD
679 \item wxPROP
\_PULLDOWN
682 \membersection{wxPropertyListView::
\destruct{wxPropertyListView
}}
684 \func{void
}{\destruct{wxPropertyListView
}}{\void}
688 \membersection{wxPropertyListView::AssociatePanel
}\label{wxpropertylistviewassociatepanel
}
690 \func{void
}{AssociatePanel
}{\param{wxPanel *
}{panel
}}
692 Associates the window on which the controls will be displayed, with the view (sets an internal pointer to the window).
694 \membersection{wxPropertyListView::BeginShowingProperty
}\label{wxpropertylistviewbeginshowingproperty
}
696 \func{Bool
}{BeginShowingProperty
}{\param{wxProperty *
}{property
}}
698 Finds the appropriate validator and loads the property into the controls, by calling
699 wxPropertyValidator::OnPrepareControls and then wxPropertyListView::DisplayProperty.
701 \membersection{wxPropertyListView::DisplayProperty
}\label{wxpropertylistviewdisplayproperty
}
703 \func{Bool
}{DisplayProperty
}{\param{wxProperty *
}{property
}}
705 Calls wxPropertyValidator::OnDisplayValue for the current property's validator. This function
706 gets called by wxPropertyListView::BeginShowingProperty, which is in turn called
707 from ShowProperty, called by OnPropertySelect, called by the listbox callback when selected.
709 \membersection{wxPropertyListView::EndShowingProperty
}\label{wxpropertylistviewendshowingproperty
}
711 \func{Bool
}{EndShowingProperty
}{\param{wxProperty *
}{property
}}
713 Finds the appropriate validator and unloads the property from the controls, by calling
714 wxPropertyListView::RetrieveProperty, wxPropertyValidator::OnClearControls and (if we're in
715 detailed editing mdoe) wxPropertyValidator::OnClearDetailControls.
717 \membersection{wxPropertyListView::GetPanel
}\label{wxpropertylistviewgetpanel
}
719 \func{wxPanel *
}{GetPanel
}{\void}
721 Returns the panel associated with the view.
723 \membersection{wxPropertyListView::GetManagedWindow
}\label{wxpropertylistviewgetmanagedwindow
}
725 \func{wxWindow *
}{GetManagedWindow
}{\void}
727 Returns the managed window (a frame or dialog) associated with the view.
729 \membersection{wxPropertyListView::GetWindowCancelButton
}\label{wxpropertylistviewgetwindowcancelbutton
}
731 \func{wxButton *
}{GetWindowCancelButton
}{\void}
733 Returns the window cancel button, if any.
735 \membersection{wxPropertyListView::GetWindowCloseButton
}\label{wxpropertylistviewgetwindowclosebutton
}
737 \func{wxButton *
}{GetWindowCloseButton
}{\void}
739 Returns the window close or OK button, if any.
741 \membersection{wxPropertyListView::GetWindowHelpButton
}\label{wxpropertylistviewgetwindowhelpbutton
}
743 \func{wxButton *
}{GetWindowHelpButton
}{\void}
745 Returns the window help button, if any.
747 \membersection{wxPropertyListView::SetManagedWindow
}\label{wxpropertylistviewsetmanagedwindow
}
749 \func{void
}{SetManagedWindow
}{\param{wxWindow *
}{win
}}
751 Sets the managed window (a frame or dialog) associated with the view.
753 \membersection{wxPropertyListView::UpdatePropertyDisplayInList
}\label{wxpropertylistviewupdatepropdisplay
}
755 \func{Bool
}{UpdatePropertyDisplayInList
}{\param{wxProperty *
}{property
}}
757 Updates the display for the given changed property.
759 \membersection{wxPropertyListView::UpdatePropertyList
}\label{wxpropertylistviewupdateproplist
}
761 \func{Bool
}{UpdatePropertyList
}{\param{Bool
}{clearEditArea = TRUE
}}
763 Updates the whole property list display.
766 \section{\class{wxPropertySheet
}: wxObject
}\label{wxpropertysheet
}
768 \overview{wxPropertySheet overview
}{wxpropertysheetoverview
}
770 The
{\bf wxPropertySheet
} class is used for storing a number of
771 wxProperty objects (essentially names and values).
773 \membersection{wxPropertySheet::wxPropertySheet
}
775 \func{void
}{wxPropertySheet
}{\void}
779 \membersection{wxPropertySheet::
\destruct{wxPropertySheet
}}
781 \func{void
}{\destruct{wxPropertySheet
}}{\void}
783 Destructor. Destroys all contained properties.
785 \membersection{wxPropertySheet::AddProperty
}\label{wxpropertysheetaddproperty
}
787 \func{void
}{AddProperty
}{\param{wxProperty *
}{property
}}
789 Adds a property to the sheet.
791 \membersection{wxPropertySheet::Clear
}\label{wxpropertysheetclear
}
793 \func{void
}{Clear
}{\void}
795 Clears all the properties from the sheet (deleting them).
797 \membersection{wxPropertySheet::GetProperties
}\label{wxpropertysheetgetproperties
}
799 \func{wxList\&
}{GetProperties
}{\void}
801 Returns a reference to the internal list of properties.
803 \membersection{wxPropertySheet::GetProperty
}\label{wxpropertysheetgetproperty
}
805 \func{wxProperty *
}{GetProperty
}{\param{char *
}{name
}}
807 Gets a property by name.
809 \membersection{wxPropertySheet::SetAllModified
}
811 \func{void
}{SetAllModified
}{\param{Bool
}{ flag
}}
813 Sets the `modified' flag of each property value.
817 \section{\class{wxPropertyValidator
}: wxEvtHandler
}\label{wxpropertyvalidator
}
819 \overview{wxPropertyValidator overview
}{wxpropertyvalidatoroverview
}
821 The
{\bf wxPropertyValidator
} abstract class is the base class for deriving
822 validators for properties.
824 \membersection{wxPropertyValidator::wxPropertyValidator
}
826 \func{void
}{wxPropertyValidator
}{\param{long
}{ flags =
0}}
830 \membersection{wxPropertyValidator::
\destruct{wxPropertyValidator
}}
832 \func{void
}{\destruct{wxPropertyValidator
}}{\void}
836 \membersection{wxPropertyValidator::GetFlags
}
838 \func{long
}{GetFlags
}{\void}
840 Returns the flags for the validator.
842 \membersection{wxPropertyValidator::GetValidatorProperty
}
844 \func{wxProperty *
}{GetValidatorProperty
}{\void}
846 Gets the property for the validator.
848 \membersection{wxPropertyValidator::SetValidatorProperty
}
850 \func{void
}{SetValidatorProperty
}{\param{wxProperty *
}{property
}}
852 Sets the property for the validator.
855 \section{\class{wxPropertyValidatorRegistry
}: wxHashTable
}\label{wxpropertyvalidatorregistry
}
857 The
{\bf wxPropertyValidatorRegistry
} class is used for storing validators,
858 indexed by the `role name' of the property, by which groups of property
859 can be identified for the purpose of validation and editing.
861 \membersection{wxPropertyValidatorRegistry::wxPropertyValidatorRegistry
}
863 \func{void
}{wxPropertyValidatorRegistry
}{\void}
867 \membersection{wxPropertyValidatorRegistry::
\destruct{wxPropertyValidatorRegistry
}}
869 \func{void
}{\destruct{wxPropertyValidatorRegistry
}}{\void}
873 \membersection{wxPropertyValidatorRegistry::Clear
}
875 \func{void
}{ClearRegistry
}{\void}
877 Clears the registry, deleting the validators.
879 \membersection{wxPropertyValidatorRegistry::GetValidator
}
881 \func{wxPropertyValidator *
}{GetValidator
}{\param{wxString\&
}{roleName
}}
883 Retrieve a validator by the property role name.
885 \membersection{wxPropertyValidatorRegistry::RegisterValidator
}\label{wxpropertyvalidatorregistervalidator
}
887 \func{void
}{RegisterValidator
}{\param{wxString\&
}{roleName
},
\param{wxPropertyValidator *
}{validator
}}
889 Register a validator with the registry.
{\it roleName
} is a name indicating the
890 role of the property, such as ``filename''. Later, when a validator is chosen for
891 editing a property, this role name is matched against the class names of the property,
892 if the property does not already have a validator explicitly associated with it.
895 \section{\class{wxPropertyValue
}: wxObject
}\label{wxpropertyvalue
}
897 The
{\bf wxPropertyValue
} class represents the value of a property,
898 and is normally associated with a wxProperty object.
900 A wxPropertyValue has one of the following types:
902 \begin{itemize
}\itemsep=
0pt
903 \item wxPropertyValueNull
904 \item wxPropertyValueInteger
905 \item wxPropertyValueReal
906 \item wxPropertyValueBool
907 \item wxPropertyValueString
908 \item wxPropertyValueList
909 \item wxPropertyValueIntegerPtr
910 \item wxPropertyValueRealPtr
911 \item wxPropertyValueBoolPtr
912 \item wxPropertyValueStringPtr
915 \membersection{wxPropertyValue::wxPropertyValue
}
917 \func{void
}{wxPropertyValue
}{\void}
921 \func{void
}{wxPropertyValue
}{\param{const wxPropertyValue\&
}{copyFrom
}}
925 \func{void
}{wxPropertyValue
}{\param{char *
}{val
}}
927 Construction from a string value.
929 \func{void
}{wxPropertyValue
}{\param{long
}{ val
}}
931 Construction from an integer value. You may need to cast to (long) to
932 avoid confusion with other constructors (such as the Bool constructor).
934 \func{void
}{wxPropertyValue
}{\param{Bool
}{ val
}}
936 Construction from a boolean value.
938 \func{void
}{wxPropertyValue
}{\param{float
}{ val
}}
940 Construction from a floating point value.
942 \func{void
}{wxPropertyValue
}{\param{double
}{ val
}}
944 Construction from a floating point value.
946 \func{void
}{wxPropertyValue
}{\param{wxList *
}{ val
}}
948 Construction from a list of wxPropertyValue objects. The
949 list, but not each contained wxPropertyValue, will be deleted
950 by the constructor. The wxPropertyValues will be assigned to
951 this wxPropertyValue list. In other words, so do not delete wxList or
952 its data after calling this constructor.
954 \func{void
}{wxPropertyValue
}{\param{wxStringList *
}{ val
}}
956 Construction from a list of strings. The list (including the strings
957 contained in it) will be deleted by the constructor, so do not
958 destroy
{\it val
} explicitly.
960 \func{void
}{wxPropertyValue
}{\param{char **
}{val
}}
962 Construction from a string pointer.
964 \func{void
}{wxPropertyValue
}{\param{long *
}{val
}}
966 Construction from an integer pointer.
968 \func{void
}{wxPropertyValue
}{\param{Bool *
}{val
}}
970 Construction from an boolean pointer.
972 \func{void
}{wxPropertyValue
}{\param{float *
}{val
}}
974 Construction from a floating point pointer.
976 The last four constructors use pointers to various C++ types, and do not
977 store the types themselves; this allows the values to stand in for actual
978 data values defined elsewhere.
980 \membersection{wxPropertyValue::
\destruct{wxPropertyValue
}}
982 \func{void
}{\destruct{wxPropertyValue
}}{\void}
986 \membersection{wxPropertyValue::Append
}
988 \func{void
}{Append
}{\param{wxPropertyValue *
}{expr
}}
990 Appends a property value to the list.
992 \membersection{wxPropertyValue::BoolValue
}
994 \func{Bool
}{BoolValue
}{\void}
996 Returns the boolean value.
998 \membersection{wxPropertyValue::BoolValuePtr
}
1000 \func{Bool *
}{BoolValuePtr
}{\void}
1002 Returns the pointer to the boolean value.
1004 \membersection{wxPropertyValue::ClearList
}
1006 \func{void
}{ClearList
}{\void}
1008 Deletes the contents of the list.
1010 \membersection{wxPropertyValue::Delete
}
1012 \func{void
}{Delete
}{\param{wxPropertyValue *
}{expr
}}
1014 Deletes
{\it expr
} from this list.
1016 \membersection{wxPropertyValue::GetFirst
}
1018 \func{wxPropertyValue *
}{GetFirst
}{\void}
1020 Gets the first value in the list.
1022 \membersection{wxPropertyValue::GetLast
}
1024 \func{wxPropertyValue *
}{GetFirst
}{\void}
1026 Gets the last value in the list.
1028 \membersection{wxPropertyValue::GetModified
}
1030 \func{Bool
}{GetModified
}{\void}
1032 Returns TRUE if the value was modified since being created
1033 (or since SetModified was called).
1035 \membersection{wxPropertyValue::GetNext
}
1037 \func{wxPropertyValue *
}{GetNext
}{\void}
1039 Gets the next value in the list (the one after `this').
1041 \membersection{wxPropertyValue::GetStringRepresentation
}
1043 \func{wxString
}{GetStringRepresentation
}{\void}
1045 Gets a string representation of the value.
1047 \membersection{wxPropertyValue::IntegerValue
}
1049 \func{long
}{IntegerValue
}{\void}
1051 Returns the integer value.
1053 \membersection{wxPropertyValue::Insert
}
1055 \func{void
}{Insert
}{\param{wxPropertyValue *
}{expr
}}
1057 Inserts a property value at the front of a list.
1059 \membersection{wxPropertyValue::IntegerValuePtr
}
1061 \func{long *
}{IntegerValuePtr
}{\void}
1063 Returns the pointer to the integer value.
1065 \membersection{wxPropertyValue::Nth
}
1067 \func{wxPropertyValue *
}{Nth
}{\param{int
}{ n
}}
1069 Returns the nth value of a list expression (starting from zero).
1071 \membersection{wxPropertyValue::Number
}
1073 \func{int
}{Number
}{\void}
1075 Returns the number of elements in a list expression.
1077 \membersection{wxPropertyValue::RealValue
}
1079 \func{float
}{RealValue
}{\void}
1081 Returns the floating point value.
1083 \membersection{wxPropertyValue::RealValuePtr
}
1085 \func{float *
}{RealValuePtr
}{\void}
1087 Returns the pointer to the floating point value.
1089 \membersection{wxPropertyValue::SetModified
}
1091 \func{void
}{SetModified
}{\param{Bool
}{ flag
}}
1093 Sets the `modified' flag.
1095 \membersection{wxPropertyValue::StringValue
}
1097 \func{char *
}{StringValue
}{\void}
1099 Returns the string value.
1101 \membersection{wxPropertyValue::StringValuePtr
}
1103 \func{char **
}{StringValuePtr
}{\void}
1105 Returns the pointer to the string value.
1107 \membersection{wxPropertyValue::Type
}
1109 \func{wxPropertyValueType
}{Type
}{\void}
1111 Returns the value type.
1113 \membersection{wxPropertyValue::operator $=$
}
1115 \func{void
}{operator $=$
}{\param{const wxPropertyValue\&
}{val
}}
1117 \func{void
}{operator $=$
}{\param{const char *
}{val
}}
1119 \func{void
}{operator $=$
}{\param{const long
}{val
}}
1121 \func{void
}{operator $=$
}{\param{const Bool
}{val
}}
1123 \func{void
}{operator $=$
}{\param{const float
}{val
}}
1125 \func{void
}{operator $=$
}{\param{const char **
}{val
}}
1127 \func{void
}{operator $=$
}{\param{const long *
}{val
}}
1129 \func{void
}{operator $=$
}{\param{const Bool *
}{val
}}
1131 \func{void
}{operator $=$
}{\param{const float *
}{val
}}
1133 Assignment operators.
1137 \section{\class{wxPropertyView
}: wxEvtHandler
}\label{wxpropertyview
}
1139 \overview{wxPropertyView overview
}{wxpropertyviewoverview
}
1141 The
{\bf wxPropertyView
} abstract class is the base class for views
1142 of property sheets, acting as intermediaries between properties and
1145 \membersection{wxPropertyView::wxPropertyView
}
1147 \func{void
}{wxPropertyView
}{\param{long
}{ flags = wxPROP
\_BUTTON\_DEFAULT}}
1151 The
{\it flags
} argument can be a bit list of the following:
1153 \begin{itemize
}\itemsep=
0pt
1154 \item wxPROP
\_BUTTON\_CLOSE
1155 \item wxPROP
\_BUTTON\_OK
1156 \item wxPROP
\_BUTTON\_CANCEL
1157 \item wxPROP
\_BUTTON\_CHECK\_CROSS
1158 \item wxPROP
\_BUTTON\_HELP
1159 \item wxPROP
\_DYNAMIC\_VALUE\_FIELD
1160 \item wxPROP
\_PULLDOWN
1163 \membersection{wxPropertyView::
\destruct{wxPropertyView
}}
1165 \func{void
}{\destruct{wxPropertyView
}}{\void}
1169 \membersection{wxPropertyView::AddRegistry
}\label{wxpropertyviewaddregistry
}
1171 \func{void
}{AddRegistry
}{\param{wxPropertyValidatorRegistry *
}{registry
}}
1173 Adds a registry (list of property validators) the view's list of registries, which is initially empty.
1175 \membersection{wxPropertyView::FindPropertyValidator
}\label{wxpropertyviewfindpropertyvalidator
}
1177 \func{wxPropertyValidator *
}{FindPropertyValidator
}{\param{wxProperty *
}{property
}}
1179 Finds the property validator that is most appropriate to this property.
1181 \membersection{wxPropertyView::GetPropertySheet
}\label{wxpropertyviewgetpropertysheet
}
1183 \func{wxPropertySheet *
}{GetPropertySheet
}{\void}
1185 Gets the property sheet for this view.
1187 \membersection{wxPropertyView::GetRegistryList
}\label{wxpropertyviewgetregistrylist
}
1189 \func{wxList\&
}{GetRegistryList
}{\void}
1191 Returns a reference to the list of property validator registries.
1193 \membersection{wxPropertyView::OnOk
}\label{wxpropertyviewonok
}
1195 \func{void
}{OnOk
}{\void}
1197 Virtual function that will be called when the OK button on the physical window is pressed (if it exists).
1199 \membersection{wxPropertyView::OnCancel
}\label{wxpropertyviewoncancel
}
1201 \func{void
}{OnCancel
}{\void}
1203 Virtual function that will be called when the Cancel button on the physical window is pressed (if it exists).
1205 \membersection{wxPropertyView::OnClose
}\label{wxpropertyviewonclose
}
1207 \func{Bool
}{OnClose
}{\void}
1209 Virtual function that will be called when the physical window is closed. The default implementation returns FALSE.
1211 \membersection{wxPropertyView::OnHelp
}\label{wxpropertyviewonhelp
}
1213 \func{void
}{OnHelp
}{\void}
1215 Virtual function that will be called when the Help button on the physical window is pressed (if it exists).
1217 \membersection{wxPropertyView::OnPropertyChanged
}\label{wxpropertyviewonpropertychanged
}
1219 \func{void
}{OnPropertyChanged
}{\param{wxProperty *
}{property
}}
1221 Virtual function called by a view or validator when a property's value changed. Validators
1222 must be written correctly for this to be called. You can override this function
1223 to respond immediately to property value changes.
1225 \membersection{wxPropertyView::OnUpdateView
}\label{wxpropertyviewonupdateview
}
1227 \func{Bool
}{OnUpdateView
}{\void}
1229 Called by the viewed object to update the view. The default implementation just returns
1232 \membersection{wxPropertyView::SetPropertySheet
}\label{wxpropertyviewsetpropertysheet
}
1234 \func{void
}{SetPropertySheet
}{\param{wxPropertySheet *
}{sheet
}}
1236 Sets the property sheet for this view.
1238 \membersection{wxPropertyView::ShowView
}\label{wxpropertyviewshowview
}
1240 \func{void
}{ShowView
}{\param{wxPropertySheet *
}{sheet
},
\param{wxPanel *
}{panel
}}
1242 Associates this view with the given panel, and shows the view.
1244 \section{\class{wxRealFormValidator
}: wxPropertyFormValidator
}\label{wxrealformvalidator
}
1246 \overview{Validator classes
}{validatorclasses
}
1248 This class validates a range of real values for form views. The associated panel item must be a wxText.
1250 \membersection{wxRealFormValidator::wxRealFormValidator
}
1252 \func{void
}{wxRealFormValidator
}{\param{float
}{min=
0.0},
\param{float
}{max=
0.0},
1253 \param{long
}{ flags=
0}}
1255 Constructor. Assigning zero to minimum and maximum values indicates that there is no range to check.
1258 \section{\class{wxStringFormValidator
}: wxPropertyFormValidator
}\label{wxstringformvalidator
}
1260 \overview{Validator classes
}{validatorclasses
}
1262 This class validates a string value for a form view, with an optional choice of possible values.
1263 The associated panel item must be a wxText, wxListBox or wxChoice. For wxListBox and wxChoice items,
1264 if the item is empty, the validator attempts to initialize the item from the strings in
1265 the validator. Note that this does not happen for XView wxChoice items since XView cannot reinitialize a wxChoice.
1267 \membersection{wxStringFormValidator::wxStringFormValidator
}
1269 \func{void
}{wxStringFormValidator
}{\param{wxStringList *
}{list=NULL
},
\param{long
}{ flags=
0}}
1271 Constructor. Supply a list of strings to indicate a choice, or no strings to allow the
1272 user to freely edit the string. The string list will be deleted when the validator is deleted.
1275 \section{\class{wxRealListValidator
}: wxPropertyListValidator
}\label{wxreallistvalidator
}
1277 \overview{Validator classes
}{validatorclasses
}
1279 This class validates a range of real values for property lists.
1281 \membersection{wxRealListValidator::wxreallistvalidator
}
1283 \func{void
}{wxRealListValidator
}{\param{float
}{min=
0.0},
\param{float
}{max=
0.0},
1284 \param{long
}{ flags=wxPROP
\_ALLOW\_TEXT\_EDITING}}
1286 Constructor. Assigning zero to minimum and maximum values indicates that there is no range to check.
1289 \section{\class{wxStringListValidator
}: wxPropertyListValidator
}\label{wxstringlistvalidator
}
1291 \overview{Validator classes
}{validatorclasses
}
1293 This class validates a string value, with an optional choice of possible values.
1295 \membersection{wxStringListValidator::wxStringListValidator
}
1297 \func{void
}{wxStringListValidator
}{\param{wxStringList *
}{list=NULL
},
\param{long
}{ flags=
0}}
1299 Constructor. Supply a list of strings to indicate a choice, or no strings to allow the
1300 user to freely edit the string. The string list will be deleted when the validator is deleted.
1303 \chapter{Classes by category
}\label{classesbycat
}
1305 A classification of property sheet classes by category.
1307 \section{Data classes
}
1309 \begin{itemize
}\itemsep=
0pt
1310 \item \helpref{wxProperty
}{wxproperty
}
1311 \item \helpref{wxPropertyValue
}{wxpropertyvalue
}
1312 \item \helpref{wxPropertySheet
}{wxpropertysheet
}
1316 \section{Validator classes
}\label{validatorclasses
}
1318 Validators check that the values the user has entered for a property are
1319 valid. They can also define specific ways of entering data, such as a
1320 file selector for a filename, and they are responsible for transferring
1321 values between the wxProperty and the physical display.
1325 \begin{itemize
}\itemsep=
0pt
1326 \item \helpref{wxPropertyValidator
}{wxproperty
}
1327 \item \helpref{wxPropertyListValidator
}{wxpropertylistvalidator
}
1328 \item \helpref{wxPropertyFormValidator
}{wxpropertyformvalidator
}
1331 List view validators:
1333 \begin{itemize
}\itemsep=
0pt
1334 \item \helpref{wxBoolListValidator
}{wxboollistvalidator
}
1335 \item \helpref{wxFilenameListValidator
}{wxfilenamelistvalidator
}
1336 \item \helpref{wxIntegerListValidator
}{wxintegerlistvalidator
}
1337 \item \helpref{wxListOfStringsListValidator
}{wxlistofstringslistvalidator
}
1338 \item \helpref{wxRealListValidator
}{wxreallistvalidator
}
1339 \item \helpref{wxStringListValidator
}{wxstringlistvalidator
}
1342 Form view validators:
1344 \begin{itemize
}\itemsep=
0pt
1345 \item \helpref{wxBoolFormValidator
}{wxboolformvalidator
}
1346 \item \helpref{wxIntegerFormValidator
}{wxintegerformvalidator
}
1347 \item \helpref{wxRealFormValidator
}{wxrealformvalidator
}
1348 \item \helpref{wxStringFormValidator
}{wxstringformvalidator
}
1351 \section{View classes
}\label{viewclasses
}
1353 View classes mediate between a property sheet and a physical window.
1355 \begin{itemize
}\itemsep=
0pt
1356 \item \helpref{wxPropertyView
}{wxpropertyview
}
1357 \item \helpref{wxPropertyListView
}{wxpropertylistview
}
1358 \item \helpref{wxPropertyFormView
}{wxpropertyformview
}
1361 \section{Window classes
}\label{windowclasses
}
1363 The class library defines some window classes that can be used as-is with a suitable
1364 view class and property sheet.
1366 \begin{itemize
}\itemsep=
0pt
1367 \item \helpref{wxPropertyFormFrame
}{wxpropertyformframe
}
1368 \item \helpref{wxPropertyFormDialog
}{wxpropertyformdialog
}
1369 \item \helpref{wxPropertyFormPanel
}{wxpropertyformpanel
}
1370 \item \helpref{wxPropertyListFrame
}{wxpropertylistframe
}
1371 \item \helpref{wxPropertyListDialog
}{wxpropertylistdialog
}
1372 \item \helpref{wxPropertyListPanel
}{wxpropertylistpanel
}
1375 \section{Registry classes
}
1377 A validator registry is a list of validators that can be applied to properties in a property sheet.
1378 There may be one or more registries per property view.
1380 \begin{itemize
}\itemsep=
0pt
1381 \item \helpref{wxPropertyValidatorRegistry
}{wxpropertyvalidatorregistry
}
1385 \chapter{Topic overviews
}\label{overviews
}
1387 This chapter contains a selection of topic overviews.
1389 \section{Property classes overview
}\label{propertyoverview
}
1391 The property classes help a programmer to express relationships between
1392 data and physical windows, in particular:
1394 \begin{itemize
}\itemsep=
0pt
1395 \item the transfer of data to and from the physical controls;
1396 \item the behaviour of various controls and custom windows for particular
1398 \item the validation of data, notifying the user when incorrect data is entered,
1399 or even better, constraining the input so only valid data can be entered.
1402 With a consistent framework, the programmer should be able to use existing
1403 components and design new ones in a principled manner, to solve many data entry
1406 Each datum is represented in a
\helpref{wxProperty
}{wxproperty
}, which has a name and a value.
1407 Various C++ types are permitted in the value of a property, and the property can store a pointer
1408 to the data instead of a copy of the data. A
\helpref{wxPropertySheet
}{wxpropertysheet
} represents a number of these properties.
1410 These two classes are independent from the way in which the data is visually manipulated. To
1411 mediate between property sheets and windows, the abstract class
\helpref{wxPropertyView
}{wxpropertyview
} is
1412 available for programmers to derive new kinds of view. One kind of view that is available is the
\helpref{wxPropertyListView
}{wxpropertylistview
},
1413 which displays the data in a Visual Basic-style list, with a small number of controls for editing
1414 the currently selected property. Another is
\helpref{wxPropertyFormView
}{wxpropertyformview
} which
1415 mediates between an existing dialog or panel and the property sheet.
1417 The hard work of mediation is actually performed by validators, which are instances of classes
1418 derived from
\helpref{wxPropertyValidator
}{wxpropertyvalidator
}. A validator is associated with
1419 a particular property and is responsible for
1420 responding to user interface events, and displaying, updating and checking the property value.
1421 Because a validator's behaviour depends largely on the kind of view being used, there has to be
1422 a separate hierarchy of validators for each class of view. So for wxPropertyListView, there is
1423 an abstract class
\helpref{wxPropertyListValidator
}{wxpropertylistvalidator
} from which concrete
1424 classes are derived, such as
\helpref{wxRealListValidator
}{wxreallistvalidator
} and
1425 \rtfsp\helpref{wxStringListValidator
}{wxstringlistvalidator
}.
1427 A validator can be explicitly set for a property, so there is no doubt which validator
1428 should be used to edit that property. However, it is also possible to define a registry
1429 of validators, and have the validator chosen on the basis of the
{\it role
} of the property.
1430 So a property with a ``filename" role would match the ``filename" validator, which pops
1431 up a file selector when the user double clicks on the property.
1433 You don't have to define your own frame or window classes: there are some predefined
1434 that will work with the property list view. See
\helpref{Window classes
}{windowclasses
} for
1437 \subsection{Example
1: Property list view
}
1439 The following code fragment shows the essentials of creating a registry of
1440 standard validators, a property sheet containing some properties, and
1441 a property list view and dialog or frame. RegisterValidators will be
1442 called on program start, and PropertySheetTest is called in response to a
1445 Note how some properties are created with an explicit reference to
1446 a validator, and others are provided with a ``role'' which can be matched
1447 against a validator in the registry.
1449 The interface generated by this test program is shown in the section
\helpref{Appearance and
1450 behaviour of a property list view
}{appearance
}.
1453 void RegisterValidators(void)
1455 myListValidatorRegistry.RegisterValidator((wxString)"real", new wxRealListValidator);
1456 myListValidatorRegistry.RegisterValidator((wxString)"string", new wxStringListValidator);
1457 myListValidatorRegistry.RegisterValidator((wxString)"integer", new wxIntegerListValidator);
1458 myListValidatorRegistry.RegisterValidator((wxString)"bool", new wxBoolListValidator);
1461 void PropertyListTest(Bool useDialog)
1463 wxPropertySheet *sheet = new wxPropertySheet;
1465 sheet->AddProperty(new wxProperty("fred",
1.0, "real"));
1466 sheet->AddProperty(new wxProperty("tough choice", (Bool)TRUE, "bool"));
1467 sheet->AddProperty(new wxProperty("ian", (long)
45, "integer", new wxIntegerListValidator(-
50,
50)));
1468 sheet->AddProperty(new wxProperty("bill",
25.0, "real", new wxRealListValidator(
0.0,
100.0)));
1469 sheet->AddProperty(new wxProperty("julian", "one", "string"));
1470 sheet->AddProperty(new wxProperty("bitmap", "none", "string", new wxFilenameListValidator("Select a bitmap file", "*.bmp")));
1471 wxStringList *strings = new wxStringList("one", "two", "three", NULL);
1472 sheet->AddProperty(new wxProperty("constrained", "one", "string", new wxStringListValidator(strings)));
1474 wxPropertyListView *view =
1475 new wxPropertyListView(NULL,
1476 wxPROP_BUTTON_CHECK_CROSS|wxPROP_DYNAMIC_VALUE_FIELD|wxPROP_PULLDOWN);
1478 wxDialogBox *propDialog = NULL;
1479 wxPropertyListFrame *propFrame = NULL;
1482 propDialog = new wxPropertyListDialog(view, NULL, "Property Sheet Test", TRUE, -
1, -
1,
400,
500);
1486 propFrame = new wxPropertyListFrame(view, NULL, "Property Sheet Test", -
1, -
1,
400,
500);
1489 view->AddRegistry(&myListValidatorRegistry);
1493 view->ShowView(sheet, propDialog);
1494 propDialog->Centre(wxBOTH);
1495 propDialog->Show(TRUE);
1499 propFrame->Initialize();
1500 view->ShowView(sheet, propFrame->GetPropertyPanel());
1501 propFrame->Centre(wxBOTH);
1502 propFrame->Show(TRUE);
1507 \subsection{Example
2: Property form view
}
1509 This example is similar to Example
1, but uses a property form view to
1510 edit a property sheet using a predefined dialog box.
1513 void RegisterValidators(void)
1515 myFormValidatorRegistry.RegisterValidator((wxString)"real", new wxRealFormValidator);
1516 myFormValidatorRegistry.RegisterValidator((wxString)"string", new wxStringFormValidator);
1517 myFormValidatorRegistry.RegisterValidator((wxString)"integer", new wxIntegerFormValidator);
1518 myFormValidatorRegistry.RegisterValidator((wxString)"bool", new wxBoolFormValidator);
1521 void PropertyFormTest(Bool useDialog)
1523 wxPropertySheet *sheet = new wxPropertySheet;
1525 sheet->AddProperty(new wxProperty("fred",
25.0, "real", new wxRealFormValidator(
0.0,
100.0)));
1526 sheet->AddProperty(new wxProperty("tough choice", (Bool)TRUE, "bool"));
1527 sheet->AddProperty(new wxProperty("ian", (long)
45, "integer", new wxIntegerFormValidator(-
50,
50)));
1528 sheet->AddProperty(new wxProperty("julian", "one", "string"));
1529 wxStringList *strings = new wxStringList("one", "two", "three", NULL);
1530 sheet->AddProperty(new wxProperty("constrained", "one", "string", new wxStringFormValidator(strings)));
1532 wxPropertyFormView *view = new wxPropertyFormView(NULL);
1534 wxDialogBox *propDialog = NULL;
1535 wxPropertyFormFrame *propFrame = NULL;
1538 propDialog = new wxPropertyFormDialog(view, NULL, "Property Form Test", TRUE, -
1, -
1,
400,
300);
1542 propFrame = new wxPropertyFormFrame(view, NULL, "Property Form Test", -
1, -
1,
400,
300);
1543 propFrame->Initialize();
1546 wxPanel *panel = propDialog ? propDialog : propFrame->GetPropertyPanel();
1547 panel->SetLabelPosition(wxVERTICAL);
1549 // Add items to the panel
1551 (void) new wxButton(panel, (wxFunction)NULL, "OK", -
1, -
1, -
1, -
1,
0, "ok");
1552 (void) new wxButton(panel, (wxFunction)NULL, "Cancel", -
1, -
1,
80, -
1,
0, "cancel");
1553 (void) new wxButton(panel, (wxFunction)NULL, "Update", -
1, -
1,
80, -
1,
0, "update");
1554 (void) new wxButton(panel, (wxFunction)NULL, "Revert", -
1, -
1, -
1, -
1,
0, "revert");
1557 // The name of this text item matches the "fred" property
1558 (void) new wxText(panel, (wxFunction)NULL, "Fred", "", -
1, -
1,
90, -
1,
0, "fred");
1559 (void) new wxCheckBox(panel, (wxFunction)NULL, "Yes or no", -
1, -
1, -
1, -
1,
0, "tough choice");
1560 (void) new wxSlider(panel, (wxFunction)NULL, "Sliding scale",
0, -
50,
50,
100, -
1, -
1, wxHORIZONTAL, "ian");
1562 (void) new wxListBox(panel, (wxFunction)NULL, "Constrained", wxSINGLE, -
1, -
1,
100,
90,
0, NULL,
0, "constrained");
1564 view->AddRegistry(&myFormValidatorRegistry);
1568 view->ShowView(sheet, propDialog);
1569 view->AssociateNames();
1570 view->TransferToDialog();
1571 propDialog->Centre(wxBOTH);
1572 propDialog->Show(TRUE);
1576 view->ShowView(sheet, propFrame->GetPropertyPanel());
1577 view->AssociateNames();
1578 view->TransferToDialog();
1579 propFrame->Centre(wxBOTH);
1580 propFrame->Show(TRUE);
1585 \section{Validator classes overview
}\label{validatoroverview
}
1587 Classes:
\helpref{Validator classes
}{validatorclasses
}
1589 The validator classes provide functionality for mediating between a wxProperty and
1590 the actual display. There is a separate family of validator classes for each
1591 class of view, since the differences in user interface for these views implies
1592 that little common functionality can be shared amongst validators.
1594 \subsection{wxPropertyValidator overview
}\label{wxpropertyvalidatoroverview
}
1596 Class:
\helpref{wxPropertyValidator
}{wxpropertyvalidator
}
1598 This class is the root of all property validator classes. It contains a small
1599 amount of common functionality, including functions to convert between
1600 strings and C++ values.
1602 A validator is notionally an object which sits between a property and its displayed
1603 value, and checks that the value the user enters is correct, giving an error message
1604 if the validation fails. In fact, the validator does more than that, and is akin to
1605 a view class but at a finer level of detail. It is also responsible for
1606 loading the dialog box control with the value from the property, putting it back
1607 into the property, preparing special controls for editing the value, and
1608 may even invoke special dialogs for editing the value in a convenient way.
1610 In a property list dialog, there is quite a lot of scope for supplying custom dialogs,
1611 such as file or colour selectors. For a form dialog, there is less scope because
1612 there is no concept of `detailed editing' of a value: one control is associated with
1613 one property, and there is no provision for invoking further dialogs. The reader
1614 may like to work out how the form view could be extended to provide some of the
1615 functionality of the property list!
1617 Validator objects may be associated explictly with a wxProperty, or they may be
1618 indirectly associated by virtue of a property `kind' that matches validators having
1619 that kind. In the latter case, such validators are stored in a validator registry
1620 which is passed to the view before the dialog is shown. If the validator takes
1621 arguments, such as minimum and maximum values in the case of a wxIntegerListValidator,
1622 then the validator must be associated explicitly with the property. The validator
1623 will be deleted when the property is deleted.
1625 \subsection{wxPropertyListValidator overview
}\label{wxpropertylistvalidatoroverview
}
1627 Class:
\helpref{wxPropertyListValidator
}{wxpropertylistvalidator
}
1629 This class is the abstract base class for property list view validators.
1630 The list view acts upon a user interface containing a list of properties,
1631 a text item for direct property value editing, confirm/cancel buttons for the value,
1632 a pulldown list for making a choice between values, and OK/Cancel/Help buttons
1633 for the dialog (see
\helpref{property list appearance
}{appearance
}).
1635 By overriding virtual functions, the programmer can create custom
1636 behaviour for different kinds of property. Custom behaviour can use just the
1637 available controls on the property list dialog, or the validator can
1638 invoke custom editors with quite different controls, which pop up in
1639 `detailed editing' mode.
1641 See the detailed class documentation for the members you should override
1642 to give your validator appropriate behaviour.
1644 \subsection{wxPropertyFormValidator overview
}\label{wxpropertyformvalidatoroverview
}
1646 This class is the abstract base class for property form view validators.
1647 The form view acts upon an existing dialog box or panel, where either the
1648 panel item names correspond to property names, or the programmer has explicitly
1649 associated the panel item with the property.
1651 By overriding virtual functions, the programmer determines how
1652 values are displayed or retrieved, and the checking that the validator does.
1654 See the detailed class documentation for the members you should override
1655 to give your validator appropriate behaviour.
1657 \section{View classes overview
}\label{viewoverview
}
1659 Classes:
\helpref{View classes
}{viewclasses
}
1661 An instance of a view class relates a property sheet with an actual window.
1662 Currently, there are two classes of view: wxPropertyListView and wxPropertyFormView.
1664 \subsection{wxPropertyView overview
}\label{wxpropertyviewoverview
}
1666 Class:
\helpref{wxPropertyView
}{wxpropertyview
}
1668 This is the abstract base class for property views.
1670 \subsection{wxPropertyListView overview
}\label{wxpropertylistviewoverview
}
1672 Class:
\helpref{wxPropertyListView
}{wxpropertylistview
}
1674 The property list view defines the relationship between a property sheet and
1675 a property list dialog or panel. It manages user interface events such as
1676 clicking on a property, pressing return in the text edit field, and clicking
1677 on Confirm or Cancel. These events cause member functions of the
1678 class to be called, and these in turn may call member functions of
1679 the appropriate validator to be called, to prepare controls, check the property value,
1680 invoke detailed editing, etc.
1682 \subsection{wxPropertyFormView overview
}\label{wxpropertyformviewoverview
}
1684 Class:
\helpref{wxPropertyFormView
}{wxpropertyformview
}
1686 The property form view manages the relationship between a property sheet
1687 and an existing dialog or panel.
1689 You must first create a panel or dialog box for the view to work on.
1690 The panel should contain panel items with names that correspond to
1691 properties in your property sheet; or you can explicitly set the
1692 panel item for each property.
1694 Apart from any custom panel items that you wish to control independently
1695 of the property-editing items, wxPropertyFormView takes over the
1696 processing of item events. It can also control normal dialog behaviour such
1697 as OK, Cancel, so you should also create some standard buttons that the property view
1698 can recognise. Just create the buttons with standard names and the view
1699 will do the rest. The following button names are recognised:
1701 \begin{itemize
}\itemsep=
0pt
1702 \item {\bf ok
}: indicates the OK button. Calls wxPropertyFormView::OnOk. By default,
1703 checks and updates the form values, closes and deletes the frame or dialog, then deletes the view.
1704 \item {\bf cancel
}: indicates the Cancel button. Calls wxPropertyFormView::OnCancel. By default,
1705 closes and deletes the frame or dialog, then deletes the view.
1706 \item {\bf help
}: indicates the Help button. Calls wxPropertyFormView::OnHelp. This needs
1707 to be overridden by the application for anything interesting to happen.
1708 \item {\bf revert
}: indicates the Revert button. Calls wxPropertyFormView::OnRevert,
1709 which by default transfers the wxProperty values to the panel items (in effect
1710 undoing any unsaved changes in the items).
1711 \item {\bf update
}: indicates the Revert button. Calls wxPropertyFormView::OnUpdate, which
1712 by defaults transfers the displayed values to the wxProperty objects.
1715 \section{wxPropertySheet overview
}\label{wxpropertysheetoverview
}
1717 Classes:
\helpref{wxPropertySheet
}{wxpropertysheet
},
\helpref{wxProperty
}{wxproperty
},
\helpref{wxPropertyValue
}{wxpropertyvalue
}
1719 A property sheet defines zero or more properties. This is a bit like an explicit representation of
1720 a C++ object. wxProperty objects can have values which are pointers to C++ values, or they
1721 can allocate their own storage for values.
1723 Because the property sheet representation is explicit and can be manipulated by
1724 a program, it is a convenient form to be used for a variety of
1725 editing purposes. wxPropertyListView and wxPropertyFormView are two classes that
1726 specify the relationship between a property sheet and a user interface. You could imagine
1727 other uses for wxPropertySheet, for example to generate a form-like user interface without
1728 the need for GUI programming. Or for storing the names and values of command-line switches, with the
1729 option to subsequently edit these values using a wxPropertyListView.
1731 A typical use for a property sheet is to represent values of an object
1732 which are only implicit in the current representation of it. For
1733 example, in Visual Basic and similar programming environments, you can
1734 `edit a button', or rather, edit the button's properties. One of the
1735 properties you can edit is
{\it width
} - but there is no explicit
1736 representation of width in a wxWindows button; instead, you call SetSize
1737 and GetSize members. To translate this into a consisent,
1738 property-oriented scheme, we could derive a new class
1739 wxButtonWithProperties, which has two new functions: SetProperty and
1740 GetProperty. SetProperty accepts a property name and a value, and calls
1741 an appropriate function for the property that is being passed.
1742 GetProperty accepts a property name, returning a property value. So
1743 instead of having to use the usual arbitrary set of C++ member functions
1744 to set or access attributes of a window, programmer deals merely with
1745 SetValue/GetValue, and property names and values.
1746 We now have a single point at which we can modify or query an object by specifying
1747 names and values at run-time. (The implementation of SetProperty and GetProperty
1748 is probably quite messy and involves a large if-then-else statement to
1749 test the property name and act accordingly.)
1751 When the user invokes the property editor for a wxButtonWithProperties, the system
1752 creates a wxPropertySheet with `imaginary' properties such as width, height, font size
1753 and so on. For each property, wxButtonWithProperties::GetProperty is called, and the result is
1754 passed to the corresponding wxProperty. The wxPropertySheet is passed to a wxPropertyListView
1755 as described elsewhere, and the user edits away. When the user has finished editing, the system calls
1756 wxButtonWithProperties::SetProperty to transfer the wxProperty value back into the button
1757 by way of an appropriate call, wxWindow::SetSize in the case of width and height properties.