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
}
7 \section{\class{wxBoolFormValidator
}: wxPropertyFormValidator
}\label{wxboolformvalidator
}
9 \overview{Validator classes
}{validatorclasses
}
11 This class validates a boolean value for a form view. The associated panel item must be a wxCheckBox.
13 \membersection{wxBoolFormValidator::wxBoolFormValidator
}
15 \func{void
}{wxBoolFormValidator
}{\param{long
}{flags=
0}}
19 \section{\class{wxBoolListValidator
}: wxPropertyListValidator
}\label{wxboollistvalidator
}
21 \overview{Validator classes
}{validatorclasses
}
23 This class validates a boolean value for a list view.
25 \membersection{wxBoolListValidator::wxBoolListValidator
}
27 \func{void
}{wxBoolListValidator
}{\param{long
}{flags=
0}}
31 \section{\class{wxIntegerFormValidator
}: wxPropertyFormValidator
}\label{wxintegerformvalidator
}
33 \overview{Validator classes
}{validatorclasses
}
35 This class validates a range of integer values for a form view. The associated panel item must be a wxText
38 \membersection{wxIntegerFormValidator::wxIntegerFormValidator
}
40 \func{void
}{wxIntegerFormValidator
}{\param{long
}{min=
0},
\param{long
}{max=
0},
41 \param{long
}{ flags=
0}}
43 Constructor. Assigning zero to minimum and maximum values indicates that there is no range to check.
46 \section{\class{wxIntegerListValidator
}: wxPropertyListValidator
}\label{wxintegerlistvalidator
}
48 \overview{Validator classes
}{validatorclasses
}
50 This class validates a range of integer values for a list view.
52 \membersection{wxIntegerListValidator::wxIntegerListValidator
}
54 \func{void
}{wxIntegerListValidator
}{\param{long
}{min=
0},
\param{long
}{max=
0},
55 \param{long
}{ flags=wxPROP
\_ALLOW\_TEXT\_EDITING}}
57 Constructor. Assigning zero to minimum and maximum values indicates that there is no range to check.
59 \section{\class{wxFilenameListValidator
}: wxPropertyListValidator
}\label{wxfilenamelistvalidator
}
61 \overview{Validator classes
}{validatorclasses
}
63 This class validates a filename for a list view, allowing the user to edit it textually and also popping up
64 a file selector in ``detailed editing" mode.
66 \membersection{wxFilenameListValidator::wxFilenameListValidator
}
68 \func{void
}{wxFilenameListValidator
}{\param{wxString
}{message = ``Select a file"
},
\param{wxString
}{wildcard = ``*.*"
},
69 \param{long
}{ flags=
0}}
71 Constructor. Supply an optional message and wildcard.
73 \section{\class{wxListOfStringsListValidator
}: wxPropertyListValidator
}\label{wxlistofstringslistvalidator
}
75 \overview{Validator classes
}{validatorclasses
}
77 This class validates a list of strings for a list view. When editing the property,
78 a dialog box is presented for adding, deleting or editing entries in the list.
79 At present no constraints may be supplied.
81 You can construct a string list property value by constructing a wxStringList object.
86 myListValidatorRegistry.RegisterValidator((wxString)"stringlist",
87 new wxListOfStringsListValidator);
89 wxStringList *strings = new wxStringList("earth", "fire", "wind", "water", NULL);
91 sheet->AddProperty(new wxProperty("fred", strings, "stringlist"));
94 \membersection{wxListOfStringsListValidator::wxListofStringsListValidator
}
96 \func{void
}{wxListOfStringsListValidator
}{\param{long
}{ flags=
0}}
100 \section{\class{wxProperty
}: wxObject
}\label{wxproperty
}
102 The
{\bf wxProperty
} class represents a property, with a
\helpref{wxPropertyValue
}{wxpropertyvalue
}\rtfsp
103 containing the actual value, a name a role, an optional validator, and
104 an optional associated window.
106 A property might correspond to an actual C++ data member, or it
107 might correspond to a conceptual property, such as the width of a window.
108 There is no explicit data member
{\it wxWindow::width
}, but it may be convenient
109 to invent such a property for the purposes of editing attributes of the window.
110 The properties in the property sheet can be mapped to ``reality" by
111 whatever means (in this case by calling wxWindow::SetSize when the user has
112 finished editing the property sheet).
114 A validator may be associated with the property in order to ensure that this and
115 only this validator will be used for editing and validating the property.
116 An alternative method is to use the
{\it role
} parameter to specify what kind
117 of validator would be appropriate; for example, specifying ``filename" for the role
118 would allow the property view to find an appropriate validator at edit time.
121 \membersection{wxProperty::wxProperty
}
123 \func{void
}{wxProperty
}{\void}
125 \func{void
}{wxProperty
}{\param{wxProperty\&
}{prop
}}
127 \func{void
}{wxProperty
}{\param{wxString
}{ name
},
\param{wxString
}{ role
},
\param{wxPropertyValidator *
}{validator=NULL
}}
129 \func{void
}{wxProperty
}{\param{wxString
}{ name
},
\param{const wxPropertyValue\&
}{ val
},
\param{wxString
}{ role
},
\param{wxPropertyValidator *
}{validator=NULL
}}
133 \membersection{wxProperty::
\destruct{wxProperty
}}
135 \func{void
}{\destruct{wxProperty
}}{\void}
137 Destructor. Destroys the wxPropertyValue, and the property validator if there is one. However, if the
138 actual C++ value in the wxPropertyValue is a pointer, the data in that variable is not destroyed.
140 \membersection{wxProperty::GetValue
}
142 \func{wxPropertyValue\&
}{GetValue
}{\void}
144 Returns a reference to the property value.
146 \membersection{wxProperty::GetValidator
}
148 \func{wxPropertyValidator *
}{GetValidator
}{\void}
150 Returns a pointer to the associated property validator (if any).
152 \membersection{wxProperty::GetName
}
154 \func{wxString\&
}{GetName
}{\void}
156 Returns the name of the property.
158 \membersection{wxProperty::GetRole
}
160 \func{wxRole\&
}{GetRole
}{\void}
162 Returns the role of the property, to be used when choosing an appropriate validator.
164 \membersection{wxProperty::GetWindow
}
166 \func{wxWindow *
}{GetWindow
}{\void}
168 Returns the window associated with the property (if any).
170 \membersection{wxProperty::SetValue
}
172 \func{void
}{SetValue
}{\param{wxPropertyValue\&
}{ val
}}
174 Sets the value of the property.
176 \membersection{wxProperty::SetName
}
178 \func{void
}{SetName
}{\param{wxString\&
}{ name
}}
180 Sets the name of the property.
182 \membersection{wxProperty::SetRole
}
184 \func{void
}{SetRole
}{\param{wxString\&
}{ role
}}
186 Sets the role of the property.
188 \membersection{wxProperty::SetValidator
}
190 \func{void
}{SetValidator
}{\param{wxPropertyValidator *
}{validator
}}
192 Sets the validator: this will be deleted when the property is deleted.
194 \membersection{wxProperty::SetWindow
}
196 \func{void
}{SetWindow
}{\param{wxWindow *
}{win
}}
198 Sets the window associated with the property.
200 \membersection{wxProperty::operator $=$
}
202 \func{void
}{operator $=$
}{\param{const wxPropertyValue\&
}{ val
}}
206 \section{\class{wxPropertyFormValidator
}: wxPropertyValidator
}\label{wxpropertyformvalidator
}
208 The
{\bf wxPropertyFormValidator
} abstract class is the root of classes that define validation
209 for a wxPropertyFormView.
212 \section{\class{wxPropertyFormDialog
}: wxDialogBox
}\label{wxpropertyformdialog
}
214 The
{\bf wxPropertyFormDialog
} class is a prepackaged dialog which can
215 be used for viewing a form property sheet. Pass a property form view object, and the dialog
216 will pass OnClose and OnDefaultAction listbox messages to the view class for
219 \membersection{wxPropertyFormDialog::wxPropertyFormDialog
}
221 \func{void
}{wxPropertyFormDialog
}{\param{wxPropertyFormView *
}{view
},
\param{wxWindow *
}{parent
},
\param{char *
}{title
},
222 \param{Bool
}{ modal=FALSE
},
\param{int
}{ x=-
1},
\param{int
}{ y=-
1},
\param{int
}{ width=-
1},
\param{int
}{height=-
1},
223 \param{long
}{ style=wxDEFAULT
\_DIALOG\_STYLE},
\param{char *
}{name=``dialogBox"
}}
227 \membersection{wxPropertyFormDialog::
\destruct{wxPropertyFormDialog
}}
229 \func{void
}{\destruct{wxPropertyFormDialog
}}{\void}
234 \section{\class{wxPropertyFormFrame
}: wxFrame
}\label{wxpropertyformframe
}
236 The
{\bf wxPropertyFormFrame
} class is a prepackaged frame which can
237 be used for viewing a property form. Pass a property form view object, and the frame
238 will pass OnClose messages to the view class for processing.
240 Call Initialize to create the panel and associate the view; override OnCreatePanel
241 if you wish to use a panel class other than the default wxPropertyFormPanel.
243 \membersection{wxPropertyFormFrame::wxPropertyFormFrame
}
245 \func{void
}{wxPropertyFormFrame
}{\param{wxPropertyFormView *
}{view
},
\param{wxFrame *
}{parent
},
\param{char *
}{title
},
246 \param{int
}{ x=-
1},
\param{int
}{ y=-
1},
\param{int
}{ width=-
1},
\param{int
}{height=-
1},
247 \param{long
}{ style=wxSDI $\|$ wxDEFAULT
\_FRAME},
\param{char *
}{name=``frame"
}}
251 \membersection{wxPropertyFormFrame::
\destruct{wxPropertyFormFrame
}}
253 \func{void
}{\destruct{wxPropertyFormFrame
}}{\void}
257 \membersection{wxPropertyFormFrame::GetPropertyPanel
}
259 \func{wxPanel *
}{GetPropertyPanel
}{\void}
261 Returns the panel associated with the frame.
263 \membersection{wxPropertyFormFrame::Initialize
}
265 \func{Bool
}{Initialize
}{\void}
267 Must be called to create the panel and associate the view with the panel and frame.
269 \membersection{wxPropertyFormFrame::OnCreatePanel
}
271 \func{wxPanel *
}{OnCreatePanel
}{\param{wxFrame *
}{parent
},
\param{wxPropertyFormView *
}{view
}}
273 Creates a panel. Override this to create a panel type other than wxPropertyFormPanel.
276 \section{\class{wxPropertyFormPanel
}: wxPanel
}\label{wxpropertyformpanel
}
278 The
{\bf wxPropertyFormPanel
} class is a prepackaged panel which can
279 be used for viewing a property form. Pass a property form view object, and the panel
280 will pass OnDefaultAction listbox messages to the view class for
283 \membersection{wxPropertyFormPanel::wxPropertyFormPanel
}
285 \func{void
}{wxPropertyFormPanel
}{\param{wxPropertyFormView *
}{view
},
\param{wxWindow *
}{parent
},
286 \param{int
}{ x=-
1},
\param{int
}{ y=-
1},
\param{int
}{ width=-
1},
\param{int
}{height=-
1},
287 \param{long
}{ style=
0},
\param{char *
}{name=``panel"
}}
291 \membersection{wxPropertyFormPanel::
\destruct{wxPropertyFormPanel
}}
293 \func{void
}{\destruct{wxPropertyFormPanel
}}{\void}
299 \section{\class{wxPropertyFormValidator
}: wxPropertyValidator
}\label{wxpropertyformvalidatir
}
301 \overview{wxPropertyFormValidator overview
}{wxpropertyformvalidatoroverview
}
303 The
{\bf wxPropertyFormValidator
} class defines a base class for form validators. By overriding virtual functions,
304 the programmer can create custom behaviour for kinds of property.
306 \membersection{wxPropertyFormValidator::wxPropertyFormValidator
}
308 \func{void
}{wxPropertyFormValidator
}{\param{long
}{ flags =
0}}
312 \membersection{wxPropertyFormValidator::
\destruct{wxPropertyFormValidator
}}
314 \func{void
}{\destruct{wxPropertyFormValidator
}}{\void}
318 \membersection{wxPropertyFormValidator::OnCommand
}
320 \func{Bool
}{OnCommand
}{\param{wxProperty *
}{property
},
\param{wxPropertyFormView *
}{view
},
321 \param{wxWindow *
}{parentWindow
},
\param{wxCommandEvent\&
}{event
}}
323 Called when the control corresponding to the property receives a command (if not intercepted
324 by a callback associated with the actual control).
326 \membersection{wxPropertyFormValidator::OnCheckValue
}
328 \func{Bool
}{OnCheckValue
}{\param{wxProperty *
}{property
},
\param{wxPropertyFormView *
}{view
},
329 \param{wxWindow *
}{parentWindow
}}
331 Called when the view checks the property value. The value checked by this validator should be taken from the
332 panel item corresponding to the property.
334 \membersection{wxPropertyFormValidator::OnDisplayValue
}
336 \func{Bool
}{OnDisplayValue
}{\param{wxProperty *
}{property
},
\param{wxPropertyFormView *
}{view
},
337 \param{wxWindow *
}{parentWindow
}}
339 Should display the property value in the appropriate control.
341 \membersection{wxPropertyFormValidator::OnDoubleClick
}
343 \func{Bool
}{OnDoubleClick
}{\param{wxProperty *
}{property
},
\param{wxPropertyFormView *
}{view
},
344 \param{wxWindow *
}{parentWindow
}}
346 Called when the control corresponding to the property is double clicked (listboxes only).
348 \membersection{wxPropertyFormValidator::OnRetrieveValue
}
350 \func{Bool
}{OnRetrieveValue
}{\param{wxProperty *
}{property
},
\param{wxPropertyFormView *
}{view
},
351 \param{wxWindow *
}{parentWindow
}}
353 Should do the transfer from the property editing area to the property itself.
356 \section{\class{wxPropertyFormView
}: wxPropertyView
}\label{wxpropertyformview
}
358 \overview{wxPropertyFormView overview
}{wxpropertyformviewoverview
}
360 The
{\bf wxPropertyFormView
} class shows a wxPropertySheet as a view onto a panel or dialog
361 box which has already been created.
363 \membersection{wxPropertyFormView::wxPropertyFormView
}
365 \func{void
}{wxPropertyFormView
}{\param{long
}{ flags =
0}}
369 \membersection{wxPropertyFormView::
\destruct{wxPropertyFormView
}}
371 \func{void
}{\destruct{wxPropertyFormView
}}{\void}
375 \membersection{wxPropertyFormView::AssociateNames
}\label{wxpropertyformviewassociatenames
}
377 \func{void
}{AssociateNames
}{\void}
379 Associates the properties with the controls on the panel. For each panel item, if the
380 panel item name is the same as a property name, the two objects will be associated.
381 This function should be called manually since the programmer may wish to do the
382 association manually.
384 \membersection{wxPropertyFormView::Check
}\label{wxpropertyformviewcheck
}
386 \func{Bool
}{Check
}{\void}
388 Checks all properties by calling the appropriate validators; returns FALSE if a validation failed.
390 \membersection{wxPropertyFormView::GetPanel
}\label{wxpropertyformviewgetpanel
}
392 \func{wxPanel *
}{GetPanel
}{\void}
394 Returns the panel associated with the view.
396 \membersection{wxPropertyFormView::GetManagedWindow
}\label{wxpropertyformviewgetmanagedwindow
}
398 \func{wxWindow *
}{GetManagedWindow
}{\void}
400 Returns the managed window (a frame or dialog) associated with the view.
402 \membersection{wxPropertyFormView::OnOk
}\label{wxpropertyformviewonok
}
404 \func{void
}{OnOk
}{\void}
406 Virtual function that will be called when the OK button on the physical window is pressed.
407 By default, checks and updates the form values, closes and deletes the frame or dialog, then deletes the view.
409 \membersection{wxPropertyFormView::OnCancel
}\label{wxpropertyformviewoncancel
}
411 \func{void
}{OnCancel
}{\void}
413 Virtual function that will be called when the Cancel button on the physical window is pressed.
414 By default, closes and deletes the frame or dialog, then deletes the view.
416 \membersection{wxPropertyFormView::OnHelp
}\label{wxpropertyformviewonhelp
}
418 \func{void
}{OnHelp
}{\void}
420 Virtual function that will be called when the Help button on the physical window is pressed.
421 This needs to be overridden by the application for anything interesting to happen.
423 \membersection{wxPropertyFormView::OnRevert
}\label{wxpropertyformviewonrevert
}
425 \func{void
}{OnRevert
}{\void}
427 Virtual function that will be called when the Revert button on the physical window is pressed.
428 By default transfers the wxProperty values to the panel items (in effect
429 undoing any unsaved changes in the items).
431 \membersection{wxPropertyFormView::OnUpdate
}\label{wxpropertyformviewonupdate
}
433 \func{void
}{OnUpdate
}{\void}
435 Virtual function that will be called when the Update button on the physical window is pressed.
436 By defaults transfers the displayed values to the wxProperty objects.
438 \membersection{wxPropertyFormView::SetManagedWindow
}\label{wxpropertyformviewsetmanagedwindow
}
440 \func{void
}{SetManagedWindow
}{\param{wxWindow *
}{win
}}
442 Sets the managed window (a frame or dialog) associated with the view.
444 \membersection{wxPropertyFormView::TransferToDialog
}\label{wxpropertyformviewtransfertodialog
}
446 \func{Bool
}{TransferToDialog
}{\void}
448 Transfers property values to the controls in the dialog.
450 \membersection{wxPropertyFormView::TransferToPropertySheet
}\label{wxpropertyformviewtransfertopropertysheet
}
452 \func{Bool
}{TransferToPropertySheet
}{\void}
454 Transfers property values from the controls in the dialog to the property sheet.
457 \section{\class{wxPropertyListDialog
}: wxDialogBox
}\label{wxpropertylistdialog
}
459 The
{\bf wxPropertyListDialog
} class is a prepackaged dialog which can
460 be used for viewing a property list. Pass a property list view object, and the dialog
461 will pass OnClose and OnDefaultAction listbox messages to the view class for
464 \membersection{wxPropertyListDialog::wxPropertyListDialog
}
466 \func{void
}{wxPropertyListDialog
}{\param{wxPropertyListView *
}{view
},
\param{wxWindow *
}{parent
},
\param{char *
}{title
},
467 \param{Bool
}{ modal=FALSE
},
\param{int
}{ x=-
1},
\param{int
}{ y=-
1},
\param{int
}{ width=-
1},
\param{int
}{height=-
1},
468 \param{long
}{ style=wxDEFAULT
\_DIALOG\_STYLE},
\param{char *
}{name=``dialogBox"
}}
472 \membersection{wxPropertyListDialog::
\destruct{wxPropertyListDialog
}}
474 \func{void
}{\destruct{wxPropertyListDialog
}}{\void}
479 \section{\class{wxPropertyListFrame
}: wxFrame
}\label{wxpropertylistframe
}
481 The
{\bf wxPropertyListFrame
} class is a prepackaged frame which can
482 be used for viewing a property list. Pass a property list view object, and the frame
483 will pass OnClose messages to the view class for processing.
485 Call Initialize to create the panel and associate the view; override OnCreatePanel
486 if you wish to use a panel class other than the default wxPropertyListPanel.
488 \membersection{wxPropertyListFrame::wxPropertyListFrame
}
490 \func{void
}{wxPropertyListFrame
}{\param{wxPropertyListView *
}{view
},
\param{wxFrame *
}{parent
},
\param{char *
}{title
},
491 \param{int
}{ x=-
1},
\param{int
}{ y=-
1},
\param{int
}{ width=-
1},
\param{int
}{height=-
1},
492 \param{long
}{ style=wxSDI $\|$ wxDEFAULT
\_FRAME},
\param{char *
}{name=``frame"
}}
496 \membersection{wxPropertyListFrame::
\destruct{wxPropertyListFrame
}}
498 \func{void
}{\destruct{wxPropertyListFrame
}}{\void}
502 \membersection{wxPropertyListFrame::GetPropertyPanel
}
504 \func{wxPanel *
}{GetPropertyPanel
}{\void}
506 Returns the panel associated with the frame.
508 \membersection{wxPropertyListFrame::Initialize
}
510 \func{Bool
}{Initialize
}{\void}
512 Must be called to create the panel and associate the view with the panel and frame.
514 \membersection{wxPropertyListFrame::OnCreatePanel
}
516 \func{wxPanel *
}{OnCreatePanel
}{\param{wxFrame *
}{parent
},
\param{wxPropertyListView *
}{view
}}
518 Creates a panel. Override this to create a panel type other than wxPropertyListPanel.
521 \section{\class{wxPropertyListPanel
}: wxPanel
}\label{wxpropertylistpanel
}
523 The
{\bf wxPropertyListPanel
} class is a prepackaged panel which can
524 be used for viewing a property list. Pass a property list view object, and the panel
525 will pass OnDefaultAction listbox messages to the view class for
528 \membersection{wxPropertyListPanel::wxPropertyListPanel
}
530 \func{void
}{wxPropertyListPanel
}{\param{wxPropertyListView *
}{view
},
\param{wxWindow *
}{parent
},
531 \param{int
}{ x=-
1},
\param{int
}{ y=-
1},
\param{int
}{ width=-
1},
\param{int
}{height=-
1},
532 \param{long
}{ style=
0},
\param{char *
}{name=``panel"
}}
536 \membersection{wxPropertyListPanel::
\destruct{wxPropertyListPanel
}}
538 \func{void
}{\destruct{wxPropertyListPanel
}}{\void}
545 \section{\class{wxPropertyListValidator
}: wxPropertyValidator
}\label{wxpropertylistvalidator
}
547 \overview{wxPropertyListValidator overview
}{wxpropertylistvalidatoroverview
}
549 The
{\bf wxPropertyListValidator
} abstract class is the base class for
550 deriving validators for property lists.
552 \membersection{wxPropertyListValidator::wxPropertyListValidator
}
554 \func{void
}{wxPropertyListValidator
}{\param{long
}{ flags = wxPROP
\_ALLOW\_TEXT\_EDITING}}
558 \membersection{wxPropertyListValidator::
\destruct{wxPropertyListValidator
}}
560 \func{void
}{\destruct{wxPropertyListValidator
}}{\void}
564 \membersection{wxPropertyListValidator::OnCheckValue
}
566 \func{Bool
}{OnCheckValue
}{\param{wxProperty *
}{property
},
\param{wxPropertyListView *
}{view
},
567 \param{wxWindow *
}{parentWindow
}}
569 Called when the Tick (Confirm) button is pressed or focus is list. Return FALSE if the value
570 was invalid, which is a signal restores the old value. Return TRUE if the value was valid.
572 \membersection{wxPropertyListValidator::OnClearControls
}
574 \func{Bool
}{OnClearControls
}{\param{wxProperty *
}{property
},
\param{wxPropertyListView *
}{view
},
575 \param{wxWindow *
}{parentWindow
}}
577 Allows the clearing (enabling, disabling) of property list controls, when the focus leaves the current property.
579 \membersection{wxPropertyListValidator::OnClearDetailControls
}
581 \func{Bool
}{OnClearDetailControls
}{\param{wxProperty *
}{property
},
\param{wxPropertyListView *
}{view
},
582 \param{wxWindow *
}{parentWindow
}}
584 Called when the focus is lost, if the validator is in detailed editing mode.
586 \membersection{wxPropertyListValidator::OnDisplayValue
}
588 \func{Bool
}{OnDisplayValue
}{\param{wxProperty *
}{property
},
\param{wxPropertyListView *
}{view
},
589 \param{wxWindow *
}{parentWindow
}}
591 Should display the value in the appropriate controls. The default implementation gets the
592 textual value from the property and inserts it into the text edit control.
594 \membersection{wxPropertyListValidator::OnDoubleClick
}
596 \func{Bool
}{OnDoubleClick
}{\param{wxProperty *
}{property
},
\param{wxPropertyListView *
}{view
},
597 \param{wxWindow *
}{parentWindow
}}
599 Called when the property is double clicked. Extra functionality can be provided,
600 such as cycling through possible values.
602 \membersection{wxPropertyListValidator::OnEdit
}
604 \func{Bool
}{OnEdit
}{\param{wxProperty *
}{property
},
\param{wxPropertyListView *
}{view
},
605 \param{wxWindow *
}{parentWindow
}}
607 Called when the Edit (detailed editing) button is pressed. The default implementation
608 calls wxPropertyListView::BeginDetailedEditing; a filename validator (for example) overrides
609 this function to show the file selector.
611 \membersection{wxPropertyListValidator::OnPrepareControls
}
613 \func{Bool
}{OnPrepareControls
}{\param{wxProperty *
}{property
},
\param{wxPropertyListView *
}{view
},
614 \param{wxWindow *
}{parentWindow
}}
616 Called to allow the validator to setup the display, such enabling or disabling buttons, and
617 setting the values and selection in the standard listbox control (the one optionally used for displaying
620 \membersection{wxPropertyListValidator::OnPrepareDetailControls
}
622 \func{Bool
}{OnPrepareDetailControls
}{\param{wxProperty *
}{property
},
\param{wxPropertyListView *
}{view
},
623 \param{wxWindow *
}{parentWindow
}}
625 Called when the property is edited `in detail', i.e. when the Edit button is pressed.
627 \membersection{wxPropertyListValidator::OnRetrieveValue
}
629 \func{Bool
}{OnRetrieveValue
}{\param{wxProperty *
}{property
},
\param{wxPropertyListView *
}{view
},
630 \param{wxWindow *
}{parentWindow
}}
632 Called when Tick (Confirm) is pressed or focus is lost or view wants to update
633 the property list. Should do the transfer from the property editing area to the property itself
635 \membersection{wxPropertyListValidator::OnSelect
}
637 \func{Bool
}{OnSelect
}{\param{Bool
}{ select
},
\param{wxProperty *
}{property
},
\param{wxPropertyListView *
}{view
},
638 \param{wxWindow *
}{parentWindow
}}
640 Called when the property is selected or deselected: typically displays the value
641 in the edit control (having chosen a suitable control to display: (non)editable text or listbox).
643 \membersection{wxPropertyListValidator::OnValueListSelect
}
645 \func{Bool
}{OnValueListSelect
}{\param{wxProperty *
}{property
},
\param{wxPropertyListView *
}{view
},
646 \param{wxWindow *
}{parentWindow
}}
648 Called when the value listbox is selected. The default behaviour is to copy
649 string to text control, and retrieve the value into the property.
653 \section{\class{wxPropertyListView
}: wxPropertyView
}\label{wxpropertylistview
}
655 \overview{wxPropertyListView overview
}{wxpropertylistviewoverview
}
657 The
{\bf wxPropertyListView
} class shows a wxPropertySheet as a Visual Basic-style property list.
659 \membersection{wxPropertyListView::wxPropertyListView
}
661 \func{void
}{wxPropertyListView
}{\param{long
}{ flags = wxPROP
\_BUTTON\_DEFAULT}}
665 The
{\it flags
} argument can be a bit list of the following:
667 \begin{itemize
}\itemsep=
0pt
668 \item wxPROP
\_BUTTON\_CLOSE
669 \item wxPROP
\_BUTTON\_OK
670 \item wxPROP
\_BUTTON\_CANCEL
671 \item wxPROP
\_BUTTON\_CHECK\_CROSS
672 \item wxPROP
\_BUTTON\_HELP
673 \item wxPROP
\_DYNAMIC\_VALUE\_FIELD
674 \item wxPROP
\_PULLDOWN
677 \membersection{wxPropertyListView::
\destruct{wxPropertyListView
}}
679 \func{void
}{\destruct{wxPropertyListView
}}{\void}
683 \membersection{wxPropertyListView::AssociatePanel
}\label{wxpropertylistviewassociatepanel
}
685 \func{void
}{AssociatePanel
}{\param{wxPanel *
}{panel
}}
687 Associates the window on which the controls will be displayed, with the view (sets an internal pointer to the window).
689 \membersection{wxPropertyListView::BeginShowingProperty
}\label{wxpropertylistviewbeginshowingproperty
}
691 \func{Bool
}{BeginShowingProperty
}{\param{wxProperty *
}{property
}}
693 Finds the appropriate validator and loads the property into the controls, by calling
694 wxPropertyValidator::OnPrepareControls and then wxPropertyListView::DisplayProperty.
696 \membersection{wxPropertyListView::DisplayProperty
}\label{wxpropertylistviewdisplayproperty
}
698 \func{Bool
}{DisplayProperty
}{\param{wxProperty *
}{property
}}
700 Calls wxPropertyValidator::OnDisplayValue for the current property's validator. This function
701 gets called by wxPropertyListView::BeginShowingProperty, which is in turn called
702 from ShowProperty, called by OnPropertySelect, called by the listbox callback when selected.
704 \membersection{wxPropertyListView::EndShowingProperty
}\label{wxpropertylistviewendshowingproperty
}
706 \func{Bool
}{EndShowingProperty
}{\param{wxProperty *
}{property
}}
708 Finds the appropriate validator and unloads the property from the controls, by calling
709 wxPropertyListView::RetrieveProperty, wxPropertyValidator::OnClearControls and (if we're in
710 detailed editing mdoe) wxPropertyValidator::OnClearDetailControls.
712 \membersection{wxPropertyListView::GetPanel
}\label{wxpropertylistviewgetpanel
}
714 \func{wxPanel *
}{GetPanel
}{\void}
716 Returns the panel associated with the view.
718 \membersection{wxPropertyListView::GetManagedWindow
}\label{wxpropertylistviewgetmanagedwindow
}
720 \func{wxWindow *
}{GetManagedWindow
}{\void}
722 Returns the managed window (a frame or dialog) associated with the view.
724 \membersection{wxPropertyListView::GetWindowCancelButton
}\label{wxpropertylistviewgetwindowcancelbutton
}
726 \func{wxButton *
}{GetWindowCancelButton
}{\void}
728 Returns the window cancel button, if any.
730 \membersection{wxPropertyListView::GetWindowCloseButton
}\label{wxpropertylistviewgetwindowclosebutton
}
732 \func{wxButton *
}{GetWindowCloseButton
}{\void}
734 Returns the window close or OK button, if any.
736 \membersection{wxPropertyListView::GetWindowHelpButton
}\label{wxpropertylistviewgetwindowhelpbutton
}
738 \func{wxButton *
}{GetWindowHelpButton
}{\void}
740 Returns the window help button, if any.
742 \membersection{wxPropertyListView::SetManagedWindow
}\label{wxpropertylistviewsetmanagedwindow
}
744 \func{void
}{SetManagedWindow
}{\param{wxWindow *
}{win
}}
746 Sets the managed window (a frame or dialog) associated with the view.
748 \membersection{wxPropertyListView::UpdatePropertyDisplayInList
}\label{wxpropertylistviewupdatepropdisplay
}
750 \func{Bool
}{UpdatePropertyDisplayInList
}{\param{wxProperty *
}{property
}}
752 Updates the display for the given changed property.
754 \membersection{wxPropertyListView::UpdatePropertyList
}\label{wxpropertylistviewupdateproplist
}
756 \func{Bool
}{UpdatePropertyList
}{\param{Bool
}{clearEditArea = TRUE
}}
758 Updates the whole property list display.
761 \section{\class{wxPropertySheet
}: wxObject
}\label{wxpropertysheet
}
763 \overview{wxPropertySheet overview
}{wxpropertysheetoverview
}
765 The
{\bf wxPropertySheet
} class is used for storing a number of
766 wxProperty objects (essentially names and values).
768 \membersection{wxPropertySheet::wxPropertySheet
}
770 \func{void
}{wxPropertySheet
}{\param{const wxString
}{ name = ""
}}
772 Constructor. Sets property sheet's name to name if present.
774 \membersection{wxPropertySheet::
\destruct{wxPropertySheet
}}
776 \func{void
}{\destruct{wxPropertySheet
}}{\void}
778 Destructor. Destroys all contained properties.
780 \membersection{wxPropertySheet::AddProperty
}\label{wxpropertysheetaddproperty
}
782 \func{void
}{AddProperty
}{\param{wxProperty *
}{property
}}
784 Adds a property to the sheet.
786 \membersection{wxPropertySheet::Clear
}\label{wxpropertysheetclear
}
788 \func{void
}{Clear
}{\void}
790 Clears all the properties from the sheet (deleting them).
792 \membersection{wxPropertySheet::GetName
}\label{wxpropertysheetgetname
}
794 \func{wxString
}{GetName
}{\void}
796 Gets the sheet's name.
798 \membersection{wxPropertySheet::GetProperty
}\label{wxpropertysheetgetproperty
}
800 \func{wxProperty *
}{GetProperty
}{\param{wxString
}{ name
}}
802 Gets a property by name.
804 \membersection{wxPropertySheet::GetProperties
}\label{wxpropertysheetgetproperties
}
806 \func{wxList\&
}{GetProperties
}{\void}
808 Returns a reference to the internal list of properties.
810 \membersection{wxPropertySheet::HasProperty
}\label{wxpropertysheethasproperty
}
812 \func{bool
}{HasProperty
}{\param{wxString
}{ propname
}}
814 Returns true if sheet contains property propname.
816 \membersection{wxPropertySheet::RemoveProperty
}\label{wxpropertysheetremoveproperty
}
818 \func{void
}{RemoveProperty
}{\param{wxString
}{ propname
}}
820 Removes property propname from sheet, deleting it.
822 \membersection{wxPropertySheet::SetName
}\label{wxpropertysheetsetname
}
824 \func{void
}{SetName
}{\param{wxString
}{ sheetname
}}
826 Set the sheet's name to sheetname
828 \membersection{wxPropertySheet::SetProperty
}\label{wxpropertysheetsetproperty
}
830 \func{bool
}{SetProperty
}{\param{wxString
}{ propname
},
\param{wxPropertyValue
}{ value
}}
832 Sets property propname to value. Returns false if property is not a member of sheet.
834 \membersection{wxPropertySheet::SetAllModified
}
836 \func{void
}{SetAllModified
}{\param{Bool
}{ flag
}}
838 Sets the `modified' flag of each property value.
842 \section{\class{wxPropertyValidator
}: wxEvtHandler
}\label{wxpropertyvalidator
}
844 \overview{wxPropertyValidator overview
}{wxpropertyvalidatoroverview
}
846 The
{\bf wxPropertyValidator
} abstract class is the base class for deriving
847 validators for properties.
849 \membersection{wxPropertyValidator::wxPropertyValidator
}
851 \func{void
}{wxPropertyValidator
}{\param{long
}{ flags =
0}}
855 \membersection{wxPropertyValidator::
\destruct{wxPropertyValidator
}}
857 \func{void
}{\destruct{wxPropertyValidator
}}{\void}
861 \membersection{wxPropertyValidator::GetFlags
}
863 \func{long
}{GetFlags
}{\void}
865 Returns the flags for the validator.
867 \membersection{wxPropertyValidator::GetValidatorProperty
}
869 \func{wxProperty *
}{GetValidatorProperty
}{\void}
871 Gets the property for the validator.
873 \membersection{wxPropertyValidator::SetValidatorProperty
}
875 \func{void
}{SetValidatorProperty
}{\param{wxProperty *
}{property
}}
877 Sets the property for the validator.
880 \section{\class{wxPropertyValidatorRegistry
}: wxHashTable
}\label{wxpropertyvalidatorregistry
}
882 The
{\bf wxPropertyValidatorRegistry
} class is used for storing validators,
883 indexed by the `role name' of the property, by which groups of property
884 can be identified for the purpose of validation and editing.
886 \membersection{wxPropertyValidatorRegistry::wxPropertyValidatorRegistry
}
888 \func{void
}{wxPropertyValidatorRegistry
}{\void}
892 \membersection{wxPropertyValidatorRegistry::
\destruct{wxPropertyValidatorRegistry
}}
894 \func{void
}{\destruct{wxPropertyValidatorRegistry
}}{\void}
898 \membersection{wxPropertyValidatorRegistry::Clear
}
900 \func{void
}{ClearRegistry
}{\void}
902 Clears the registry, deleting the validators.
904 \membersection{wxPropertyValidatorRegistry::GetValidator
}
906 \func{wxPropertyValidator *
}{GetValidator
}{\param{wxString\&
}{roleName
}}
908 Retrieve a validator by the property role name.
910 \membersection{wxPropertyValidatorRegistry::RegisterValidator
}\label{wxpropertyvalidatorregistervalidator
}
912 \func{void
}{RegisterValidator
}{\param{wxString\&
}{roleName
},
\param{wxPropertyValidator *
}{validator
}}
914 Register a validator with the registry.
{\it roleName
} is a name indicating the
915 role of the property, such as ``filename''. Later, when a validator is chosen for
916 editing a property, this role name is matched against the class names of the property,
917 if the property does not already have a validator explicitly associated with it.
920 \section{\class{wxPropertyValue
}: wxObject
}\label{wxpropertyvalue
}
922 The
{\bf wxPropertyValue
} class represents the value of a property,
923 and is normally associated with a wxProperty object.
925 A wxPropertyValue has one of the following types:
927 \begin{itemize
}\itemsep=
0pt
928 \item wxPropertyValueNull
929 \item wxPropertyValueInteger
930 \item wxPropertyValueReal
931 \item wxPropertyValueBool
932 \item wxPropertyValueString
933 \item wxPropertyValueList
934 \item wxPropertyValueIntegerPtr
935 \item wxPropertyValueRealPtr
936 \item wxPropertyValueBoolPtr
937 \item wxPropertyValueStringPtr
940 \membersection{wxPropertyValue::wxPropertyValue
}
942 \func{void
}{wxPropertyValue
}{\void}
946 \func{void
}{wxPropertyValue
}{\param{const wxPropertyValue\&
}{copyFrom
}}
950 \func{void
}{wxPropertyValue
}{\param{char *
}{val
}}
952 Construction from a string value.
954 \func{void
}{wxPropertyValue
}{\param{long
}{ val
}}
956 Construction from an integer value. You may need to cast to (long) to
957 avoid confusion with other constructors (such as the Bool constructor).
959 \func{void
}{wxPropertyValue
}{\param{Bool
}{ val
}}
961 Construction from a boolean value.
963 \func{void
}{wxPropertyValue
}{\param{float
}{ val
}}
965 Construction from a floating point value.
967 \func{void
}{wxPropertyValue
}{\param{double
}{ val
}}
969 Construction from a floating point value.
971 \func{void
}{wxPropertyValue
}{\param{wxList *
}{ val
}}
973 Construction from a list of wxPropertyValue objects. The
974 list, but not each contained wxPropertyValue, will be deleted
975 by the constructor. The wxPropertyValues will be assigned to
976 this wxPropertyValue list. In other words, so do not delete wxList or
977 its data after calling this constructor.
979 \func{void
}{wxPropertyValue
}{\param{wxStringList *
}{ val
}}
981 Construction from a list of strings. The list (including the strings
982 contained in it) will be deleted by the constructor, so do not
983 destroy
{\it val
} explicitly.
985 \func{void
}{wxPropertyValue
}{\param{char **
}{val
}}
987 Construction from a string pointer.
989 \func{void
}{wxPropertyValue
}{\param{long *
}{val
}}
991 Construction from an integer pointer.
993 \func{void
}{wxPropertyValue
}{\param{Bool *
}{val
}}
995 Construction from an boolean pointer.
997 \func{void
}{wxPropertyValue
}{\param{float *
}{val
}}
999 Construction from a floating point pointer.
1001 The last four constructors use pointers to various C++ types, and do not
1002 store the types themselves; this allows the values to stand in for actual
1003 data values defined elsewhere.
1005 \membersection{wxPropertyValue::
\destruct{wxPropertyValue
}}
1007 \func{void
}{\destruct{wxPropertyValue
}}{\void}
1011 \membersection{wxPropertyValue::Append
}
1013 \func{void
}{Append
}{\param{wxPropertyValue *
}{expr
}}
1015 Appends a property value to the list.
1017 \membersection{wxPropertyValue::BoolValue
}
1019 \func{Bool
}{BoolValue
}{\void}
1021 Returns the boolean value.
1023 \membersection{wxPropertyValue::BoolValuePtr
}
1025 \func{Bool *
}{BoolValuePtr
}{\void}
1027 Returns the pointer to the boolean value.
1029 \membersection{wxPropertyValue::ClearList
}
1031 \func{void
}{ClearList
}{\void}
1033 Deletes the contents of the list.
1035 \membersection{wxPropertyValue::Delete
}
1037 \func{void
}{Delete
}{\param{wxPropertyValue *
}{expr
}}
1039 Deletes
{\it expr
} from this list.
1041 \membersection{wxPropertyValue::GetFirst
}
1043 \func{wxPropertyValue *
}{GetFirst
}{\void}
1045 Gets the first value in the list.
1047 \membersection{wxPropertyValue::GetLast
}
1049 \func{wxPropertyValue *
}{GetFirst
}{\void}
1051 Gets the last value in the list.
1053 \membersection{wxPropertyValue::GetModified
}
1055 \func{Bool
}{GetModified
}{\void}
1057 Returns TRUE if the value was modified since being created
1058 (or since SetModified was called).
1060 \membersection{wxPropertyValue::GetNext
}
1062 \func{wxPropertyValue *
}{GetNext
}{\void}
1064 Gets the next value in the list (the one after `this').
1066 \membersection{wxPropertyValue::GetStringRepresentation
}
1068 \func{wxString
}{GetStringRepresentation
}{\void}
1070 Gets a string representation of the value.
1072 \membersection{wxPropertyValue::IntegerValue
}
1074 \func{long
}{IntegerValue
}{\void}
1076 Returns the integer value.
1078 \membersection{wxPropertyValue::Insert
}
1080 \func{void
}{Insert
}{\param{wxPropertyValue *
}{expr
}}
1082 Inserts a property value at the front of a list.
1084 \membersection{wxPropertyValue::IntegerValuePtr
}
1086 \func{long *
}{IntegerValuePtr
}{\void}
1088 Returns the pointer to the integer value.
1090 \membersection{wxPropertyValue::Nth
}
1092 \func{wxPropertyValue *
}{Nth
}{\param{int
}{ n
}}
1094 Returns the nth value of a list expression (starting from zero).
1096 \membersection{wxPropertyValue::Number
}
1098 \func{int
}{Number
}{\void}
1100 Returns the number of elements in a list expression.
1102 \membersection{wxPropertyValue::RealValue
}
1104 \func{float
}{RealValue
}{\void}
1106 Returns the floating point value.
1108 \membersection{wxPropertyValue::RealValuePtr
}
1110 \func{float *
}{RealValuePtr
}{\void}
1112 Returns the pointer to the floating point value.
1114 \membersection{wxPropertyValue::SetModified
}
1116 \func{void
}{SetModified
}{\param{Bool
}{ flag
}}
1118 Sets the `modified' flag.
1120 \membersection{wxPropertyValue::StringValue
}
1122 \func{char *
}{StringValue
}{\void}
1124 Returns the string value.
1126 \membersection{wxPropertyValue::StringValuePtr
}
1128 \func{char **
}{StringValuePtr
}{\void}
1130 Returns the pointer to the string value.
1132 \membersection{wxPropertyValue::Type
}
1134 \func{wxPropertyValueType
}{Type
}{\void}
1136 Returns the value type.
1138 \membersection{wxPropertyValue::operator $=$
}
1140 \func{void
}{operator $=$
}{\param{const wxPropertyValue\&
}{val
}}
1142 \func{void
}{operator $=$
}{\param{const char *
}{val
}}
1144 \func{void
}{operator $=$
}{\param{const long
}{val
}}
1146 \func{void
}{operator $=$
}{\param{const Bool
}{val
}}
1148 \func{void
}{operator $=$
}{\param{const float
}{val
}}
1150 \func{void
}{operator $=$
}{\param{const char **
}{val
}}
1152 \func{void
}{operator $=$
}{\param{const long *
}{val
}}
1154 \func{void
}{operator $=$
}{\param{const Bool *
}{val
}}
1156 \func{void
}{operator $=$
}{\param{const float *
}{val
}}
1158 Assignment operators.
1162 \section{\class{wxPropertyView
}: wxEvtHandler
}\label{wxpropertyview
}
1164 \overview{wxPropertyView overview
}{wxpropertyviewoverview
}
1166 The
{\bf wxPropertyView
} abstract class is the base class for views
1167 of property sheets, acting as intermediaries between properties and
1170 \membersection{wxPropertyView::wxPropertyView
}
1172 \func{void
}{wxPropertyView
}{\param{long
}{ flags = wxPROP
\_BUTTON\_DEFAULT}}
1176 The
{\it flags
} argument can be a bit list of the following:
1178 \begin{itemize
}\itemsep=
0pt
1179 \item wxPROP
\_BUTTON\_CLOSE
1180 \item wxPROP
\_BUTTON\_OK
1181 \item wxPROP
\_BUTTON\_CANCEL
1182 \item wxPROP
\_BUTTON\_CHECK\_CROSS
1183 \item wxPROP
\_BUTTON\_HELP
1184 \item wxPROP
\_DYNAMIC\_VALUE\_FIELD
1185 \item wxPROP
\_PULLDOWN
1188 \membersection{wxPropertyView::
\destruct{wxPropertyView
}}
1190 \func{void
}{\destruct{wxPropertyView
}}{\void}
1194 \membersection{wxPropertyView::AddRegistry
}\label{wxpropertyviewaddregistry
}
1196 \func{void
}{AddRegistry
}{\param{wxPropertyValidatorRegistry *
}{registry
}}
1198 Adds a registry (list of property validators) the view's list of registries, which is initially empty.
1200 \membersection{wxPropertyView::FindPropertyValidator
}\label{wxpropertyviewfindpropertyvalidator
}
1202 \func{wxPropertyValidator *
}{FindPropertyValidator
}{\param{wxProperty *
}{property
}}
1204 Finds the property validator that is most appropriate to this property.
1206 \membersection{wxPropertyView::GetPropertySheet
}\label{wxpropertyviewgetpropertysheet
}
1208 \func{wxPropertySheet *
}{GetPropertySheet
}{\void}
1210 Gets the property sheet for this view.
1212 \membersection{wxPropertyView::GetRegistryList
}\label{wxpropertyviewgetregistrylist
}
1214 \func{wxList\&
}{GetRegistryList
}{\void}
1216 Returns a reference to the list of property validator registries.
1218 \membersection{wxPropertyView::OnOk
}\label{wxpropertyviewonok
}
1220 \func{void
}{OnOk
}{\void}
1222 Virtual function that will be called when the OK button on the physical window is pressed (if it exists).
1224 \membersection{wxPropertyView::OnCancel
}\label{wxpropertyviewoncancel
}
1226 \func{void
}{OnCancel
}{\void}
1228 Virtual function that will be called when the Cancel button on the physical window is pressed (if it exists).
1230 \membersection{wxPropertyView::OnClose
}\label{wxpropertyviewonclose
}
1232 \func{Bool
}{OnClose
}{\void}
1234 Virtual function that will be called when the physical window is closed. The default implementation returns FALSE.
1236 \membersection{wxPropertyView::OnHelp
}\label{wxpropertyviewonhelp
}
1238 \func{void
}{OnHelp
}{\void}
1240 Virtual function that will be called when the Help button on the physical window is pressed (if it exists).
1242 \membersection{wxPropertyView::OnPropertyChanged
}\label{wxpropertyviewonpropertychanged
}
1244 \func{void
}{OnPropertyChanged
}{\param{wxProperty *
}{property
}}
1246 Virtual function called by a view or validator when a property's value changed. Validators
1247 must be written correctly for this to be called. You can override this function
1248 to respond immediately to property value changes.
1250 \membersection{wxPropertyView::OnUpdateView
}\label{wxpropertyviewonupdateview
}
1252 \func{Bool
}{OnUpdateView
}{\void}
1254 Called by the viewed object to update the view. The default implementation just returns
1257 \membersection{wxPropertyView::SetPropertySheet
}\label{wxpropertyviewsetpropertysheet
}
1259 \func{void
}{SetPropertySheet
}{\param{wxPropertySheet *
}{sheet
}}
1261 Sets the property sheet for this view.
1263 \membersection{wxPropertyView::ShowView
}\label{wxpropertyviewshowview
}
1265 \func{void
}{ShowView
}{\param{wxPropertySheet *
}{sheet
},
\param{wxPanel *
}{panel
}}
1267 Associates this view with the given panel, and shows the view.
1269 \section{\class{wxRealFormValidator
}: wxPropertyFormValidator
}\label{wxrealformvalidator
}
1271 \overview{Validator classes
}{validatorclasses
}
1273 This class validates a range of real values for form views. The associated panel item must be a wxText.
1275 \membersection{wxRealFormValidator::wxRealFormValidator
}
1277 \func{void
}{wxRealFormValidator
}{\param{float
}{min=
0.0},
\param{float
}{max=
0.0},
1278 \param{long
}{ flags=
0}}
1280 Constructor. Assigning zero to minimum and maximum values indicates that there is no range to check.
1283 \section{\class{wxStringFormValidator
}: wxPropertyFormValidator
}\label{wxstringformvalidator
}
1285 \overview{Validator classes
}{validatorclasses
}
1287 This class validates a string value for a form view, with an optional choice of possible values.
1288 The associated panel item must be a wxText, wxListBox or wxChoice. For wxListBox and wxChoice items,
1289 if the item is empty, the validator attempts to initialize the item from the strings in
1290 the validator. Note that this does not happen for XView wxChoice items since XView cannot reinitialize a wxChoice.
1292 \membersection{wxStringFormValidator::wxStringFormValidator
}
1294 \func{void
}{wxStringFormValidator
}{\param{wxStringList *
}{list=NULL
},
\param{long
}{ flags=
0}}
1296 Constructor. Supply a list of strings to indicate a choice, or no strings to allow the
1297 user to freely edit the string. The string list will be deleted when the validator is deleted.
1300 \section{\class{wxRealListValidator
}: wxPropertyListValidator
}\label{wxreallistvalidator
}
1302 \overview{Validator classes
}{validatorclasses
}
1304 This class validates a range of real values for property lists.
1306 \membersection{wxRealListValidator::wxreallistvalidator
}
1308 \func{void
}{wxRealListValidator
}{\param{float
}{min=
0.0},
\param{float
}{max=
0.0},
1309 \param{long
}{ flags=wxPROP
\_ALLOW\_TEXT\_EDITING}}
1311 Constructor. Assigning zero to minimum and maximum values indicates that there is no range to check.
1314 \section{\class{wxStringListValidator
}: wxPropertyListValidator
}\label{wxstringlistvalidator
}
1316 \overview{Validator classes
}{validatorclasses
}
1318 This class validates a string value, with an optional choice of possible values.
1320 \membersection{wxStringListValidator::wxStringListValidator
}
1322 \func{void
}{wxStringListValidator
}{\param{wxStringList *
}{list=NULL
},
\param{long
}{ flags=
0}}
1324 Constructor. Supply a list of strings to indicate a choice, or no strings to allow the
1325 user to freely edit the string. The string list will be deleted when the validator is deleted.
1328 \chapter{Classes by category
}\label{classesbycat
}
1330 A classification of property sheet classes by category.
1332 \section{Data classes
}
1334 \begin{itemize
}\itemsep=
0pt
1335 \item \helpref{wxProperty
}{wxproperty
}
1336 \item \helpref{wxPropertyValue
}{wxpropertyvalue
}
1337 \item \helpref{wxPropertySheet
}{wxpropertysheet
}
1341 \section{Validator classes
}\label{validatorclasses
}
1343 Validators check that the values the user has entered for a property are
1344 valid. They can also define specific ways of entering data, such as a
1345 file selector for a filename, and they are responsible for transferring
1346 values between the wxProperty and the physical display.
1350 \begin{itemize
}\itemsep=
0pt
1351 \item \helpref{wxPropertyValidator
}{wxproperty
}
1352 \item \helpref{wxPropertyListValidator
}{wxpropertylistvalidator
}
1353 \item \helpref{wxPropertyFormValidator
}{wxpropertyformvalidator
}
1356 List view validators:
1358 \begin{itemize
}\itemsep=
0pt
1359 \item \helpref{wxBoolListValidator
}{wxboollistvalidator
}
1360 \item \helpref{wxFilenameListValidator
}{wxfilenamelistvalidator
}
1361 \item \helpref{wxIntegerListValidator
}{wxintegerlistvalidator
}
1362 \item \helpref{wxListOfStringsListValidator
}{wxlistofstringslistvalidator
}
1363 \item \helpref{wxRealListValidator
}{wxreallistvalidator
}
1364 \item \helpref{wxStringListValidator
}{wxstringlistvalidator
}
1367 Form view validators:
1369 \begin{itemize
}\itemsep=
0pt
1370 \item \helpref{wxBoolFormValidator
}{wxboolformvalidator
}
1371 \item \helpref{wxIntegerFormValidator
}{wxintegerformvalidator
}
1372 \item \helpref{wxRealFormValidator
}{wxrealformvalidator
}
1373 \item \helpref{wxStringFormValidator
}{wxstringformvalidator
}
1376 \section{View classes
}\label{viewclasses
}
1378 View classes mediate between a property sheet and a physical window.
1380 \begin{itemize
}\itemsep=
0pt
1381 \item \helpref{wxPropertyView
}{wxpropertyview
}
1382 \item \helpref{wxPropertyListView
}{wxpropertylistview
}
1383 \item \helpref{wxPropertyFormView
}{wxpropertyformview
}
1386 \section{Window classes
}\label{windowclasses
}
1388 The class library defines some window classes that can be used as-is with a suitable
1389 view class and property sheet.
1391 \begin{itemize
}\itemsep=
0pt
1392 \item \helpref{wxPropertyFormFrame
}{wxpropertyformframe
}
1393 \item \helpref{wxPropertyFormDialog
}{wxpropertyformdialog
}
1394 \item \helpref{wxPropertyFormPanel
}{wxpropertyformpanel
}
1395 \item \helpref{wxPropertyListFrame
}{wxpropertylistframe
}
1396 \item \helpref{wxPropertyListDialog
}{wxpropertylistdialog
}
1397 \item \helpref{wxPropertyListPanel
}{wxpropertylistpanel
}
1400 \section{Registry classes
}
1402 A validator registry is a list of validators that can be applied to properties in a property sheet.
1403 There may be one or more registries per property view.
1405 \begin{itemize
}\itemsep=
0pt
1406 \item \helpref{wxPropertyValidatorRegistry
}{wxpropertyvalidatorregistry
}
1410 \chapter{Topic overviews
}\label{overviews
}
1412 This chapter contains a selection of topic overviews.
1414 \section{Property classes overview
}\label{propertyoverview
}
1416 The property classes help a programmer to express relationships between
1417 data and physical windows, in particular:
1419 \begin{itemize
}\itemsep=
0pt
1420 \item the transfer of data to and from the physical controls;
1421 \item the behaviour of various controls and custom windows for particular
1423 \item the validation of data, notifying the user when incorrect data is entered,
1424 or even better, constraining the input so only valid data can be entered.
1427 With a consistent framework, the programmer should be able to use existing
1428 components and design new ones in a principled manner, to solve many data entry
1431 Each datum is represented in a
\helpref{wxProperty
}{wxproperty
}, which has a name and a value.
1432 Various C++ types are permitted in the value of a property, and the property can store a pointer
1433 to the data instead of a copy of the data. A
\helpref{wxPropertySheet
}{wxpropertysheet
} represents a number of these properties.
1435 These two classes are independent from the way in which the data is visually manipulated. To
1436 mediate between property sheets and windows, the abstract class
\helpref{wxPropertyView
}{wxpropertyview
} is
1437 available for programmers to derive new kinds of view. One kind of view that is available is the
\helpref{wxPropertyListView
}{wxpropertylistview
},
1438 which displays the data in a Visual Basic-style list, with a small number of controls for editing
1439 the currently selected property. Another is
\helpref{wxPropertyFormView
}{wxpropertyformview
} which
1440 mediates between an existing dialog or panel and the property sheet.
1442 The hard work of mediation is actually performed by validators, which are instances of classes
1443 derived from
\helpref{wxPropertyValidator
}{wxpropertyvalidator
}. A validator is associated with
1444 a particular property and is responsible for
1445 responding to user interface events, and displaying, updating and checking the property value.
1446 Because a validator's behaviour depends largely on the kind of view being used, there has to be
1447 a separate hierarchy of validators for each class of view. So for wxPropertyListView, there is
1448 an abstract class
\helpref{wxPropertyListValidator
}{wxpropertylistvalidator
} from which concrete
1449 classes are derived, such as
\helpref{wxRealListValidator
}{wxreallistvalidator
} and
1450 \rtfsp\helpref{wxStringListValidator
}{wxstringlistvalidator
}.
1452 A validator can be explicitly set for a property, so there is no doubt which validator
1453 should be used to edit that property. However, it is also possible to define a registry
1454 of validators, and have the validator chosen on the basis of the
{\it role
} of the property.
1455 So a property with a ``filename" role would match the ``filename" validator, which pops
1456 up a file selector when the user double clicks on the property.
1458 You don't have to define your own frame or window classes: there are some predefined
1459 that will work with the property list view. See
\helpref{Window classes
}{windowclasses
} for
1462 \subsection{Example
1: Property list view
}
1464 The following code fragment shows the essentials of creating a registry of
1465 standard validators, a property sheet containing some properties, and
1466 a property list view and dialog or frame. RegisterValidators will be
1467 called on program start, and PropertySheetTest is called in response to a
1470 Note how some properties are created with an explicit reference to
1471 a validator, and others are provided with a ``role'' which can be matched
1472 against a validator in the registry.
1474 The interface generated by this test program is shown in the section
\helpref{Appearance and
1475 behaviour of a property list view
}{appearance
}.
1478 void RegisterValidators(void)
1480 myListValidatorRegistry.RegisterValidator((wxString)"real", new wxRealListValidator);
1481 myListValidatorRegistry.RegisterValidator((wxString)"string", new wxStringListValidator);
1482 myListValidatorRegistry.RegisterValidator((wxString)"integer", new wxIntegerListValidator);
1483 myListValidatorRegistry.RegisterValidator((wxString)"bool", new wxBoolListValidator);
1486 void PropertyListTest(Bool useDialog)
1488 wxPropertySheet *sheet = new wxPropertySheet;
1490 sheet->AddProperty(new wxProperty("fred",
1.0, "real"));
1491 sheet->AddProperty(new wxProperty("tough choice", (Bool)TRUE, "bool"));
1492 sheet->AddProperty(new wxProperty("ian", (long)
45, "integer", new wxIntegerListValidator(-
50,
50)));
1493 sheet->AddProperty(new wxProperty("bill",
25.0, "real", new wxRealListValidator(
0.0,
100.0)));
1494 sheet->AddProperty(new wxProperty("julian", "one", "string"));
1495 sheet->AddProperty(new wxProperty("bitmap", "none", "string", new wxFilenameListValidator("Select a bitmap file", "*.bmp")));
1496 wxStringList *strings = new wxStringList("one", "two", "three", NULL);
1497 sheet->AddProperty(new wxProperty("constrained", "one", "string", new wxStringListValidator(strings)));
1499 wxPropertyListView *view =
1500 new wxPropertyListView(NULL,
1501 wxPROP_BUTTON_CHECK_CROSS|wxPROP_DYNAMIC_VALUE_FIELD|wxPROP_PULLDOWN);
1503 wxDialogBox *propDialog = NULL;
1504 wxPropertyListFrame *propFrame = NULL;
1507 propDialog = new wxPropertyListDialog(view, NULL, "Property Sheet Test", TRUE, -
1, -
1,
400,
500);
1511 propFrame = new wxPropertyListFrame(view, NULL, "Property Sheet Test", -
1, -
1,
400,
500);
1514 view->AddRegistry(&myListValidatorRegistry);
1518 view->ShowView(sheet, propDialog);
1519 propDialog->Centre(wxBOTH);
1520 propDialog->Show(TRUE);
1524 propFrame->Initialize();
1525 view->ShowView(sheet, propFrame->GetPropertyPanel());
1526 propFrame->Centre(wxBOTH);
1527 propFrame->Show(TRUE);
1532 \subsection{Example
2: Property form view
}
1534 This example is similar to Example
1, but uses a property form view to
1535 edit a property sheet using a predefined dialog box.
1538 void RegisterValidators(void)
1540 myFormValidatorRegistry.RegisterValidator((wxString)"real", new wxRealFormValidator);
1541 myFormValidatorRegistry.RegisterValidator((wxString)"string", new wxStringFormValidator);
1542 myFormValidatorRegistry.RegisterValidator((wxString)"integer", new wxIntegerFormValidator);
1543 myFormValidatorRegistry.RegisterValidator((wxString)"bool", new wxBoolFormValidator);
1546 void PropertyFormTest(Bool useDialog)
1548 wxPropertySheet *sheet = new wxPropertySheet;
1550 sheet->AddProperty(new wxProperty("fred",
25.0, "real", new wxRealFormValidator(
0.0,
100.0)));
1551 sheet->AddProperty(new wxProperty("tough choice", (Bool)TRUE, "bool"));
1552 sheet->AddProperty(new wxProperty("ian", (long)
45, "integer", new wxIntegerFormValidator(-
50,
50)));
1553 sheet->AddProperty(new wxProperty("julian", "one", "string"));
1554 wxStringList *strings = new wxStringList("one", "two", "three", NULL);
1555 sheet->AddProperty(new wxProperty("constrained", "one", "string", new wxStringFormValidator(strings)));
1557 wxPropertyFormView *view = new wxPropertyFormView(NULL);
1559 wxDialogBox *propDialog = NULL;
1560 wxPropertyFormFrame *propFrame = NULL;
1563 propDialog = new wxPropertyFormDialog(view, NULL, "Property Form Test", TRUE, -
1, -
1,
400,
300);
1567 propFrame = new wxPropertyFormFrame(view, NULL, "Property Form Test", -
1, -
1,
400,
300);
1568 propFrame->Initialize();
1571 wxPanel *panel = propDialog ? propDialog : propFrame->GetPropertyPanel();
1572 panel->SetLabelPosition(wxVERTICAL);
1574 // Add items to the panel
1576 (void) new wxButton(panel, (wxFunction)NULL, "OK", -
1, -
1, -
1, -
1,
0, "ok");
1577 (void) new wxButton(panel, (wxFunction)NULL, "Cancel", -
1, -
1,
80, -
1,
0, "cancel");
1578 (void) new wxButton(panel, (wxFunction)NULL, "Update", -
1, -
1,
80, -
1,
0, "update");
1579 (void) new wxButton(panel, (wxFunction)NULL, "Revert", -
1, -
1, -
1, -
1,
0, "revert");
1582 // The name of this text item matches the "fred" property
1583 (void) new wxText(panel, (wxFunction)NULL, "Fred", "", -
1, -
1,
90, -
1,
0, "fred");
1584 (void) new wxCheckBox(panel, (wxFunction)NULL, "Yes or no", -
1, -
1, -
1, -
1,
0, "tough choice");
1585 (void) new wxSlider(panel, (wxFunction)NULL, "Sliding scale",
0, -
50,
50,
100, -
1, -
1, wxHORIZONTAL, "ian");
1587 (void) new wxListBox(panel, (wxFunction)NULL, "Constrained", wxSINGLE, -
1, -
1,
100,
90,
0, NULL,
0, "constrained");
1589 view->AddRegistry(&myFormValidatorRegistry);
1593 view->ShowView(sheet, propDialog);
1594 view->AssociateNames();
1595 view->TransferToDialog();
1596 propDialog->Centre(wxBOTH);
1597 propDialog->Show(TRUE);
1601 view->ShowView(sheet, propFrame->GetPropertyPanel());
1602 view->AssociateNames();
1603 view->TransferToDialog();
1604 propFrame->Centre(wxBOTH);
1605 propFrame->Show(TRUE);
1610 \section{Validator classes overview
}\label{validatoroverview
}
1612 Classes:
\helpref{Validator classes
}{validatorclasses
}
1614 The validator classes provide functionality for mediating between a wxProperty and
1615 the actual display. There is a separate family of validator classes for each
1616 class of view, since the differences in user interface for these views implies
1617 that little common functionality can be shared amongst validators.
1619 \subsection{wxPropertyValidator overview
}\label{wxpropertyvalidatoroverview
}
1621 Class:
\helpref{wxPropertyValidator
}{wxpropertyvalidator
}
1623 This class is the root of all property validator classes. It contains a small
1624 amount of common functionality, including functions to convert between
1625 strings and C++ values.
1627 A validator is notionally an object which sits between a property and its displayed
1628 value, and checks that the value the user enters is correct, giving an error message
1629 if the validation fails. In fact, the validator does more than that, and is akin to
1630 a view class but at a finer level of detail. It is also responsible for
1631 loading the dialog box control with the value from the property, putting it back
1632 into the property, preparing special controls for editing the value, and
1633 may even invoke special dialogs for editing the value in a convenient way.
1635 In a property list dialog, there is quite a lot of scope for supplying custom dialogs,
1636 such as file or colour selectors. For a form dialog, there is less scope because
1637 there is no concept of `detailed editing' of a value: one control is associated with
1638 one property, and there is no provision for invoking further dialogs. The reader
1639 may like to work out how the form view could be extended to provide some of the
1640 functionality of the property list!
1642 Validator objects may be associated explictly with a wxProperty, or they may be
1643 indirectly associated by virtue of a property `kind' that matches validators having
1644 that kind. In the latter case, such validators are stored in a validator registry
1645 which is passed to the view before the dialog is shown. If the validator takes
1646 arguments, such as minimum and maximum values in the case of a wxIntegerListValidator,
1647 then the validator must be associated explicitly with the property. The validator
1648 will be deleted when the property is deleted.
1650 \subsection{wxPropertyListValidator overview
}\label{wxpropertylistvalidatoroverview
}
1652 Class:
\helpref{wxPropertyListValidator
}{wxpropertylistvalidator
}
1654 This class is the abstract base class for property list view validators.
1655 The list view acts upon a user interface containing a list of properties,
1656 a text item for direct property value editing, confirm/cancel buttons for the value,
1657 a pulldown list for making a choice between values, and OK/Cancel/Help buttons
1658 for the dialog (see
\helpref{property list appearance
}{appearance
}).
1660 By overriding virtual functions, the programmer can create custom
1661 behaviour for different kinds of property. Custom behaviour can use just the
1662 available controls on the property list dialog, or the validator can
1663 invoke custom editors with quite different controls, which pop up in
1664 `detailed editing' mode.
1666 See the detailed class documentation for the members you should override
1667 to give your validator appropriate behaviour.
1669 \subsection{wxPropertyFormValidator overview
}\label{wxpropertyformvalidatoroverview
}
1671 This class is the abstract base class for property form view validators.
1672 The form view acts upon an existing dialog box or panel, where either the
1673 panel item names correspond to property names, or the programmer has explicitly
1674 associated the panel item with the property.
1676 By overriding virtual functions, the programmer determines how
1677 values are displayed or retrieved, and the checking that the validator does.
1679 See the detailed class documentation for the members you should override
1680 to give your validator appropriate behaviour.
1682 \section{View classes overview
}\label{viewoverview
}
1684 Classes:
\helpref{View classes
}{viewclasses
}
1686 An instance of a view class relates a property sheet with an actual window.
1687 Currently, there are two classes of view: wxPropertyListView and wxPropertyFormView.
1689 \subsection{wxPropertyView overview
}\label{wxpropertyviewoverview
}
1691 Class:
\helpref{wxPropertyView
}{wxpropertyview
}
1693 This is the abstract base class for property views.
1695 \subsection{wxPropertyListView overview
}\label{wxpropertylistviewoverview
}
1697 Class:
\helpref{wxPropertyListView
}{wxpropertylistview
}
1699 The property list view defines the relationship between a property sheet and
1700 a property list dialog or panel. It manages user interface events such as
1701 clicking on a property, pressing return in the text edit field, and clicking
1702 on Confirm or Cancel. These events cause member functions of the
1703 class to be called, and these in turn may call member functions of
1704 the appropriate validator to be called, to prepare controls, check the property value,
1705 invoke detailed editing, etc.
1707 \subsection{wxPropertyFormView overview
}\label{wxpropertyformviewoverview
}
1709 Class:
\helpref{wxPropertyFormView
}{wxpropertyformview
}
1711 The property form view manages the relationship between a property sheet
1712 and an existing dialog or panel.
1714 You must first create a panel or dialog box for the view to work on.
1715 The panel should contain panel items with names that correspond to
1716 properties in your property sheet; or you can explicitly set the
1717 panel item for each property.
1719 Apart from any custom panel items that you wish to control independently
1720 of the property-editing items, wxPropertyFormView takes over the
1721 processing of item events. It can also control normal dialog behaviour such
1722 as OK, Cancel, so you should also create some standard buttons that the property view
1723 can recognise. Just create the buttons with standard names and the view
1724 will do the rest. The following button names are recognised:
1726 \begin{itemize
}\itemsep=
0pt
1727 \item {\bf ok
}: indicates the OK button. Calls wxPropertyFormView::OnOk. By default,
1728 checks and updates the form values, closes and deletes the frame or dialog, then deletes the view.
1729 \item {\bf cancel
}: indicates the Cancel button. Calls wxPropertyFormView::OnCancel. By default,
1730 closes and deletes the frame or dialog, then deletes the view.
1731 \item {\bf help
}: indicates the Help button. Calls wxPropertyFormView::OnHelp. This needs
1732 to be overridden by the application for anything interesting to happen.
1733 \item {\bf revert
}: indicates the Revert button. Calls wxPropertyFormView::OnRevert,
1734 which by default transfers the wxProperty values to the panel items (in effect
1735 undoing any unsaved changes in the items).
1736 \item {\bf update
}: indicates the Revert button. Calls wxPropertyFormView::OnUpdate, which
1737 by defaults transfers the displayed values to the wxProperty objects.
1740 \section{wxPropertySheet overview
}\label{wxpropertysheetoverview
}
1742 Classes:
\helpref{wxPropertySheet
}{wxpropertysheet
},
\helpref{wxProperty
}{wxproperty
},
\helpref{wxPropertyValue
}{wxpropertyvalue
}
1744 A property sheet defines zero or more properties. This is a bit like an explicit representation of
1745 a C++ object. wxProperty objects can have values which are pointers to C++ values, or they
1746 can allocate their own storage for values.
1748 Because the property sheet representation is explicit and can be manipulated by
1749 a program, it is a convenient form to be used for a variety of
1750 editing purposes. wxPropertyListView and wxPropertyFormView are two classes that
1751 specify the relationship between a property sheet and a user interface. You could imagine
1752 other uses for wxPropertySheet, for example to generate a form-like user interface without
1753 the need for GUI programming. Or for storing the names and values of command-line switches, with the
1754 option to subsequently edit these values using a wxPropertyListView.
1756 A typical use for a property sheet is to represent values of an object
1757 which are only implicit in the current representation of it. For
1758 example, in Visual Basic and similar programming environments, you can
1759 `edit a button', or rather, edit the button's properties. One of the
1760 properties you can edit is
{\it width
} - but there is no explicit
1761 representation of width in a wxWindows button; instead, you call SetSize
1762 and GetSize members. To translate this into a consisent,
1763 property-oriented scheme, we could derive a new class
1764 wxButtonWithProperties, which has two new functions: SetProperty and
1765 GetProperty. SetProperty accepts a property name and a value, and calls
1766 an appropriate function for the property that is being passed.
1767 GetProperty accepts a property name, returning a property value. So
1768 instead of having to use the usual arbitrary set of C++ member functions
1769 to set or access attributes of a window, programmer deals merely with
1770 SetValue/GetValue, and property names and values.
1771 We now have a single point at which we can modify or query an object by specifying
1772 names and values at run-time. (The implementation of SetProperty and GetProperty
1773 is probably quite messy and involves a large if-then-else statement to
1774 test the property name and act accordingly.)
1776 When the user invokes the property editor for a wxButtonWithProperties, the system
1777 creates a wxPropertySheet with `imaginary' properties such as width, height, font size
1778 and so on. For each property, wxButtonWithProperties::GetProperty is called, and the result is
1779 passed to the corresponding wxProperty. The wxPropertySheet is passed to a wxPropertyListView
1780 as described elsewhere, and the user edits away. When the user has finished editing, the system calls
1781 wxButtonWithProperties::SetProperty to transfer the wxProperty value back into the button
1782 by way of an appropriate call, wxWindow::SetSize in the case of width and height properties.