]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/proplist/classes.tex
Added some makefiles, fixed a BC++ problem in controls.cpp; changed some class
[wxWidgets.git] / docs / latex / proplist / classes.tex
CommitLineData
e3a43801
JS
1\chapter{Alphabetical class reference}\label{classref}
2\setheader{{\it CHAPTER \thechapter}}{}{}{}{}{{\it CHAPTER \thechapter}}%
3\setfooter{\thepage}{}{}{}{}{\thepage}%
4
5\overview{Property classes overview}{propertyoverview}
6
e3a43801
JS
7\section{\class{wxBoolFormValidator}: wxPropertyFormValidator}\label{wxboolformvalidator}
8
9\overview{Validator classes}{validatorclasses}
10
11This class validates a boolean value for a form view. The associated panel item must be a wxCheckBox.
12
13\membersection{wxBoolFormValidator::wxBoolFormValidator}
14
15\func{void}{wxBoolFormValidator}{\param{long }{flags=0}}
16
17Constructor.
18
19\section{\class{wxBoolListValidator}: wxPropertyListValidator}\label{wxboollistvalidator}
20
21\overview{Validator classes}{validatorclasses}
22
23This class validates a boolean value for a list view.
24
25\membersection{wxBoolListValidator::wxBoolListValidator}
26
27\func{void}{wxBoolListValidator}{\param{long }{flags=0}}
28
29Constructor.
30
31\section{\class{wxIntegerFormValidator}: wxPropertyFormValidator}\label{wxintegerformvalidator}
32
33\overview{Validator classes}{validatorclasses}
34
35This class validates a range of integer values for a form view. The associated panel item must be a wxText
36or wxSlider.
37
38\membersection{wxIntegerFormValidator::wxIntegerFormValidator}
39
40\func{void}{wxIntegerFormValidator}{\param{long }{min=0}, \param{long }{max=0},
41 \param{long}{ flags=0}}
42
43Constructor. Assigning zero to minimum and maximum values indicates that there is no range to check.
44
45
46\section{\class{wxIntegerListValidator}: wxPropertyListValidator}\label{wxintegerlistvalidator}
47
48\overview{Validator classes}{validatorclasses}
49
50This class validates a range of integer values for a list view.
51
52\membersection{wxIntegerListValidator::wxIntegerListValidator}
53
54\func{void}{wxIntegerListValidator}{\param{long }{min=0}, \param{long }{max=0},
55 \param{long}{ flags=wxPROP\_ALLOW\_TEXT\_EDITING}}
56
57Constructor. Assigning zero to minimum and maximum values indicates that there is no range to check.
58
59\section{\class{wxFilenameListValidator}: wxPropertyListValidator}\label{wxfilenamelistvalidator}
60
61\overview{Validator classes}{validatorclasses}
62
63This class validates a filename for a list view, allowing the user to edit it textually and also popping up
64a file selector in ``detailed editing" mode.
65
66\membersection{wxFilenameListValidator::wxFilenameListValidator}
67
68\func{void}{wxFilenameListValidator}{\param{wxString }{message = ``Select a file"}, \param{wxString }{wildcard = ``*.*"},
69 \param{long}{ flags=0}}
70
71Constructor. Supply an optional message and wildcard.
72
73\section{\class{wxListOfStringsListValidator}: wxPropertyListValidator}\label{wxlistofstringslistvalidator}
74
75\overview{Validator classes}{validatorclasses}
76
77This class validates a list of strings for a list view. When editing the property,
78a dialog box is presented for adding, deleting or editing entries in the list.
79At present no constraints may be supplied.
80
81You can construct a string list property value by constructing a wxStringList object.
82
83For example:
84
85\begin{verbatim}
86 myListValidatorRegistry.RegisterValidator((wxString)"stringlist",
87 new wxListOfStringsListValidator);
88
89 wxStringList *strings = new wxStringList("earth", "fire", "wind", "water", NULL);
90
91 sheet->AddProperty(new wxProperty("fred", strings, "stringlist"));
92\end{verbatim}
93
94\membersection{wxListOfStringsListValidator::wxListofStringsListValidator}
95
96\func{void}{wxListOfStringsListValidator}{\param{long}{ flags=0}}
97
98Constructor.
99
100\section{\class{wxProperty}: wxObject}\label{wxproperty}
101
102The {\bf wxProperty} class represents a property, with a \helpref{wxPropertyValue}{wxpropertyvalue}\rtfsp
103containing the actual value, a name a role, an optional validator, and
104an optional associated window.
105
106A property might correspond to an actual C++ data member, or it
107might correspond to a conceptual property, such as the width of a window.
108There is no explicit data member {\it wxWindow::width}, but it may be convenient
109to invent such a property for the purposes of editing attributes of the window.
110The properties in the property sheet can be mapped to ``reality" by
111whatever means (in this case by calling wxWindow::SetSize when the user has
112finished editing the property sheet).
113
114A validator may be associated with the property in order to ensure that this and
115only this validator will be used for editing and validating the property.
116An alternative method is to use the {\it role} parameter to specify what kind
117of validator would be appropriate; for example, specifying ``filename" for the role
118would allow the property view to find an appropriate validator at edit time.
119
120
121\membersection{wxProperty::wxProperty}
122
123\func{void}{wxProperty}{\void}
124
125\func{void}{wxProperty}{\param{wxProperty\& }{prop}}
126
127\func{void}{wxProperty}{\param{wxString}{ name}, \param{wxString}{ role}, \param{wxPropertyValidator *}{validator=NULL}}
128
129\func{void}{wxProperty}{\param{wxString}{ name}, \param{const wxPropertyValue\&}{ val}, \param{wxString}{ role}, \param{wxPropertyValidator *}{validator=NULL}}
130
131Constructors.
132
133\membersection{wxProperty::\destruct{wxProperty}}
134
135\func{void}{\destruct{wxProperty}}{\void}
136
137Destructor. Destroys the wxPropertyValue, and the property validator if there is one. However, if the
138actual C++ value in the wxPropertyValue is a pointer, the data in that variable is not destroyed.
139
140\membersection{wxProperty::GetValue}
141
142\func{wxPropertyValue\&}{GetValue}{\void}
143
144Returns a reference to the property value.
145
146\membersection{wxProperty::GetValidator}
147
148\func{wxPropertyValidator *}{GetValidator}{\void}
149
150Returns a pointer to the associated property validator (if any).
151
152\membersection{wxProperty::GetName}
153
154\func{wxString\&}{GetName}{\void}
155
156Returns the name of the property.
157
158\membersection{wxProperty::GetRole}
159
160\func{wxRole\&}{GetRole}{\void}
161
162Returns the role of the property, to be used when choosing an appropriate validator.
163
164\membersection{wxProperty::GetWindow}
165
166\func{wxWindow *}{GetWindow}{\void}
167
168Returns the window associated with the property (if any).
169
170\membersection{wxProperty::SetValue}
171
172\func{void}{SetValue}{\param{wxPropertyValue\&}{ val}}
173
174Sets the value of the property.
175
176\membersection{wxProperty::SetName}
177
178\func{void}{SetName}{\param{wxString\&}{ name}}
179
180Sets the name of the property.
181
182\membersection{wxProperty::SetRole}
183
184\func{void}{SetRole}{\param{wxString\&}{ role}}
185
186Sets the role of the property.
187
188\membersection{wxProperty::SetValidator}
189
190\func{void}{SetValidator}{\param{wxPropertyValidator *}{validator}}
191
192Sets the validator: this will be deleted when the property is deleted.
193
194\membersection{wxProperty::SetWindow}
195
196\func{void}{SetWindow}{\param{wxWindow *}{win}}
197
198Sets the window associated with the property.
199
200\membersection{wxProperty::operator $=$}
201
202\func{void}{operator $=$}{\param{const wxPropertyValue\&}{ val}}
203
204Assignment operator.
205
206\section{\class{wxPropertyFormValidator}: wxPropertyValidator}\label{wxpropertyformvalidator}
207
208The {\bf wxPropertyFormValidator} abstract class is the root of classes that define validation
209for a wxPropertyFormView.
210
211
212\section{\class{wxPropertyFormDialog}: wxDialogBox}\label{wxpropertyformdialog}
213
214The {\bf wxPropertyFormDialog} class is a prepackaged dialog which can
215be used for viewing a form property sheet. Pass a property form view object, and the dialog
216will pass OnClose and OnDefaultAction listbox messages to the view class for
217processing.
218
219\membersection{wxPropertyFormDialog::wxPropertyFormDialog}
220
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"}}
224
225Constructor.
226
227\membersection{wxPropertyFormDialog::\destruct{wxPropertyFormDialog}}
228
229\func{void}{\destruct{wxPropertyFormDialog}}{\void}
230
231Destructor.
232
233
234\section{\class{wxPropertyFormFrame}: wxFrame}\label{wxpropertyformframe}
235
236The {\bf wxPropertyFormFrame} class is a prepackaged frame which can
237be used for viewing a property form. Pass a property form view object, and the frame
238will pass OnClose messages to the view class for processing.
239
240Call Initialize to create the panel and associate the view; override OnCreatePanel
241if you wish to use a panel class other than the default wxPropertyFormPanel.
242
243\membersection{wxPropertyFormFrame::wxPropertyFormFrame}
244
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"}}
248
249Constructor.
250
251\membersection{wxPropertyFormFrame::\destruct{wxPropertyFormFrame}}
252
253\func{void}{\destruct{wxPropertyFormFrame}}{\void}
254
255Destructor.
256
257\membersection{wxPropertyFormFrame::GetPropertyPanel}
258
259\func{wxPanel *}{GetPropertyPanel}{\void}
260
261Returns the panel associated with the frame.
262
263\membersection{wxPropertyFormFrame::Initialize}
264
265\func{Bool}{Initialize}{\void}
266
267Must be called to create the panel and associate the view with the panel and frame.
268
269\membersection{wxPropertyFormFrame::OnCreatePanel}
270
271\func{wxPanel *}{OnCreatePanel}{\param{wxFrame *}{parent}, \param{wxPropertyFormView *}{view}}
272
273Creates a panel. Override this to create a panel type other than wxPropertyFormPanel.
274
275
276\section{\class{wxPropertyFormPanel}: wxPanel}\label{wxpropertyformpanel}
277
278The {\bf wxPropertyFormPanel} class is a prepackaged panel which can
279be used for viewing a property form. Pass a property form view object, and the panel
280will pass OnDefaultAction listbox messages to the view class for
281processing.
282
283\membersection{wxPropertyFormPanel::wxPropertyFormPanel}
284
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"}}
288
289Constructor.
290
291\membersection{wxPropertyFormPanel::\destruct{wxPropertyFormPanel}}
292
293\func{void}{\destruct{wxPropertyFormPanel}}{\void}
294
295Destructor.
296
297
298
299\section{\class{wxPropertyFormValidator}: wxPropertyValidator}\label{wxpropertyformvalidatir}
300
301\overview{wxPropertyFormValidator overview}{wxpropertyformvalidatoroverview}
302
303The {\bf wxPropertyFormValidator} class defines a base class for form validators. By overriding virtual functions,
304the programmer can create custom behaviour for kinds of property.
305
306\membersection{wxPropertyFormValidator::wxPropertyFormValidator}
307
308\func{void}{wxPropertyFormValidator}{\param{long}{ flags = 0}}
309
310Constructor.
311
312\membersection{wxPropertyFormValidator::\destruct{wxPropertyFormValidator}}
313
314\func{void}{\destruct{wxPropertyFormValidator}}{\void}
315
316Destructor.
317
318\membersection{wxPropertyFormValidator::OnCommand}
319
320\func{Bool}{OnCommand}{\param{wxProperty *}{property}, \param{wxPropertyFormView *}{view},
321 \param{wxWindow *}{parentWindow}, \param{wxCommandEvent\& }{event}}
322
323Called when the control corresponding to the property receives a command (if not intercepted
324by a callback associated with the actual control).
325
326\membersection{wxPropertyFormValidator::OnCheckValue}
327
328\func{Bool}{OnCheckValue}{\param{wxProperty *}{property}, \param{wxPropertyFormView *}{view},
329 \param{wxWindow *}{parentWindow}}
330
331Called when the view checks the property value. The value checked by this validator should be taken from the
332panel item corresponding to the property.
333
334\membersection{wxPropertyFormValidator::OnDisplayValue}
335
336\func{Bool}{OnDisplayValue}{\param{wxProperty *}{property}, \param{wxPropertyFormView *}{view},
337 \param{wxWindow *}{parentWindow}}
338
339Should display the property value in the appropriate control.
340
341\membersection{wxPropertyFormValidator::OnDoubleClick}
342
343\func{Bool}{OnDoubleClick}{\param{wxProperty *}{property}, \param{wxPropertyFormView *}{view},
344 \param{wxWindow *}{parentWindow}}
345
346Called when the control corresponding to the property is double clicked (listboxes only).
347
348\membersection{wxPropertyFormValidator::OnRetrieveValue}
349
350\func{Bool}{OnRetrieveValue}{\param{wxProperty *}{property}, \param{wxPropertyFormView *}{view},
351 \param{wxWindow *}{parentWindow}}
352
353Should do the transfer from the property editing area to the property itself.
354
355
356\section{\class{wxPropertyFormView}: wxPropertyView}\label{wxpropertyformview}
357
358\overview{wxPropertyFormView overview}{wxpropertyformviewoverview}
359
360The {\bf wxPropertyFormView} class shows a wxPropertySheet as a view onto a panel or dialog
361box which has already been created.
362
363\membersection{wxPropertyFormView::wxPropertyFormView}
364
365\func{void}{wxPropertyFormView}{\param{long}{ flags = 0}}
366
367Constructor.
368
369\membersection{wxPropertyFormView::\destruct{wxPropertyFormView}}
370
371\func{void}{\destruct{wxPropertyFormView}}{\void}
372
373Destructor.
374
375\membersection{wxPropertyFormView::AssociateNames}\label{wxpropertyformviewassociatenames}
376
377\func{void}{AssociateNames}{\void}
378
379Associates the properties with the controls on the panel. For each panel item, if the
380panel item name is the same as a property name, the two objects will be associated.
381This function should be called manually since the programmer may wish to do the
382association manually.
383
384\membersection{wxPropertyFormView::Check}\label{wxpropertyformviewcheck}
385
386\func{Bool}{Check}{\void}
387
388Checks all properties by calling the appropriate validators; returns FALSE if a validation failed.
389
390\membersection{wxPropertyFormView::GetPanel}\label{wxpropertyformviewgetpanel}
391
392\func{wxPanel *}{GetPanel}{\void}
393
394Returns the panel associated with the view.
395
396\membersection{wxPropertyFormView::GetManagedWindow}\label{wxpropertyformviewgetmanagedwindow}
397
398\func{wxWindow *}{GetManagedWindow}{\void}
399
400Returns the managed window (a frame or dialog) associated with the view.
401
402\membersection{wxPropertyFormView::OnOk}\label{wxpropertyformviewonok}
403
404\func{void}{OnOk}{\void}
405
406Virtual function that will be called when the OK button on the physical window is pressed.
407By default, checks and updates the form values, closes and deletes the frame or dialog, then deletes the view.
408
409\membersection{wxPropertyFormView::OnCancel}\label{wxpropertyformviewoncancel}
410
411\func{void}{OnCancel}{\void}
412
413Virtual function that will be called when the Cancel button on the physical window is pressed.
414By default, closes and deletes the frame or dialog, then deletes the view.
415
416\membersection{wxPropertyFormView::OnHelp}\label{wxpropertyformviewonhelp}
417
418\func{void}{OnHelp}{\void}
419
420Virtual function that will be called when the Help button on the physical window is pressed.
421This needs to be overridden by the application for anything interesting to happen.
422
423\membersection{wxPropertyFormView::OnRevert}\label{wxpropertyformviewonrevert}
424
425\func{void}{OnRevert}{\void}
426
427Virtual function that will be called when the Revert button on the physical window is pressed.
428By default transfers the wxProperty values to the panel items (in effect
429undoing any unsaved changes in the items).
430
431\membersection{wxPropertyFormView::OnUpdate}\label{wxpropertyformviewonupdate}
432
433\func{void}{OnUpdate}{\void}
434
435Virtual function that will be called when the Update button on the physical window is pressed.
436By defaults transfers the displayed values to the wxProperty objects.
437
438\membersection{wxPropertyFormView::SetManagedWindow}\label{wxpropertyformviewsetmanagedwindow}
439
440\func{void}{SetManagedWindow}{\param{wxWindow *}{win}}
441
442Sets the managed window (a frame or dialog) associated with the view.
443
444\membersection{wxPropertyFormView::TransferToDialog}\label{wxpropertyformviewtransfertodialog}
445
446\func{Bool}{TransferToDialog}{\void}
447
448Transfers property values to the controls in the dialog.
449
450\membersection{wxPropertyFormView::TransferToPropertySheet}\label{wxpropertyformviewtransfertopropertysheet}
451
452\func{Bool}{TransferToPropertySheet}{\void}
453
454Transfers property values from the controls in the dialog to the property sheet.
455
456
457\section{\class{wxPropertyListDialog}: wxDialogBox}\label{wxpropertylistdialog}
458
459The {\bf wxPropertyListDialog} class is a prepackaged dialog which can
460be used for viewing a property list. Pass a property list view object, and the dialog
461will pass OnClose and OnDefaultAction listbox messages to the view class for
462processing.
463
464\membersection{wxPropertyListDialog::wxPropertyListDialog}
465
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"}}
469
470Constructor.
471
472\membersection{wxPropertyListDialog::\destruct{wxPropertyListDialog}}
473
474\func{void}{\destruct{wxPropertyListDialog}}{\void}
475
476Destructor.
477
478
479\section{\class{wxPropertyListFrame}: wxFrame}\label{wxpropertylistframe}
480
481The {\bf wxPropertyListFrame} class is a prepackaged frame which can
482be used for viewing a property list. Pass a property list view object, and the frame
483will pass OnClose messages to the view class for processing.
484
485Call Initialize to create the panel and associate the view; override OnCreatePanel
486if you wish to use a panel class other than the default wxPropertyListPanel.
487
488\membersection{wxPropertyListFrame::wxPropertyListFrame}
489
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"}}
493
494Constructor.
495
496\membersection{wxPropertyListFrame::\destruct{wxPropertyListFrame}}
497
498\func{void}{\destruct{wxPropertyListFrame}}{\void}
499
500Destructor.
501
502\membersection{wxPropertyListFrame::GetPropertyPanel}
503
504\func{wxPanel *}{GetPropertyPanel}{\void}
505
506Returns the panel associated with the frame.
507
508\membersection{wxPropertyListFrame::Initialize}
509
510\func{Bool}{Initialize}{\void}
511
512Must be called to create the panel and associate the view with the panel and frame.
513
514\membersection{wxPropertyListFrame::OnCreatePanel}
515
516\func{wxPanel *}{OnCreatePanel}{\param{wxFrame *}{parent}, \param{wxPropertyListView *}{view}}
517
518Creates a panel. Override this to create a panel type other than wxPropertyListPanel.
519
520
521\section{\class{wxPropertyListPanel}: wxPanel}\label{wxpropertylistpanel}
522
523The {\bf wxPropertyListPanel} class is a prepackaged panel which can
524be used for viewing a property list. Pass a property list view object, and the panel
525will pass OnDefaultAction listbox messages to the view class for
526processing.
527
528\membersection{wxPropertyListPanel::wxPropertyListPanel}
529
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"}}
533
534Constructor.
535
536\membersection{wxPropertyListPanel::\destruct{wxPropertyListPanel}}
537
538\func{void}{\destruct{wxPropertyListPanel}}{\void}
539
540Destructor.
541
542
543
544
545\section{\class{wxPropertyListValidator}: wxPropertyValidator}\label{wxpropertylistvalidator}
546
547\overview{wxPropertyListValidator overview}{wxpropertylistvalidatoroverview}
548
549The {\bf wxPropertyListValidator} abstract class is the base class for
550deriving validators for property lists.
551
552\membersection{wxPropertyListValidator::wxPropertyListValidator}
553
554\func{void}{wxPropertyListValidator}{\param{long}{ flags = wxPROP\_ALLOW\_TEXT\_EDITING}}
555
556Constructor.
557
558\membersection{wxPropertyListValidator::\destruct{wxPropertyListValidator}}
559
560\func{void}{\destruct{wxPropertyListValidator}}{\void}
561
562Destructor.
563
564\membersection{wxPropertyListValidator::OnCheckValue}
565
566\func{Bool}{OnCheckValue}{\param{wxProperty *}{property}, \param{wxPropertyListView *}{view},
567 \param{wxWindow *}{parentWindow}}
568
569Called when the Tick (Confirm) button is pressed or focus is list. Return FALSE if the value
570was invalid, which is a signal restores the old value. Return TRUE if the value was valid.
571
572\membersection{wxPropertyListValidator::OnClearControls}
573
574\func{Bool}{OnClearControls}{\param{wxProperty *}{property}, \param{wxPropertyListView *}{view},
575 \param{wxWindow *}{parentWindow}}
576
577Allows the clearing (enabling, disabling) of property list controls, when the focus leaves the current property.
578
579\membersection{wxPropertyListValidator::OnClearDetailControls}
580
581\func{Bool}{OnClearDetailControls}{\param{wxProperty *}{property}, \param{wxPropertyListView *}{view},
582 \param{wxWindow *}{parentWindow}}
583
584Called when the focus is lost, if the validator is in detailed editing mode.
585
586\membersection{wxPropertyListValidator::OnDisplayValue}
587
588\func{Bool}{OnDisplayValue}{\param{wxProperty *}{property}, \param{wxPropertyListView *}{view},
589 \param{wxWindow *}{parentWindow}}
590
591Should display the value in the appropriate controls. The default implementation gets the
592textual value from the property and inserts it into the text edit control.
593
594\membersection{wxPropertyListValidator::OnDoubleClick}
595
596\func{Bool}{OnDoubleClick}{\param{wxProperty *}{property}, \param{wxPropertyListView *}{view},
597 \param{wxWindow *}{parentWindow}}
598
599Called when the property is double clicked. Extra functionality can be provided,
600such as cycling through possible values.
601
602\membersection{wxPropertyListValidator::OnEdit}
603
604\func{Bool}{OnEdit}{\param{wxProperty *}{property}, \param{wxPropertyListView *}{view},
605 \param{wxWindow *}{parentWindow}}
606
607Called when the Edit (detailed editing) button is pressed. The default implementation
608calls wxPropertyListView::BeginDetailedEditing; a filename validator (for example) overrides
609this function to show the file selector.
610
611\membersection{wxPropertyListValidator::OnPrepareControls}
612
613\func{Bool}{OnPrepareControls}{\param{wxProperty *}{property}, \param{wxPropertyListView *}{view},
614 \param{wxWindow *}{parentWindow}}
615
616Called to allow the validator to setup the display, such enabling or disabling buttons, and
617setting the values and selection in the standard listbox control (the one optionally used for displaying
618value options).
619
620\membersection{wxPropertyListValidator::OnPrepareDetailControls}
621
622\func{Bool}{OnPrepareDetailControls}{\param{wxProperty *}{property}, \param{wxPropertyListView *}{view},
623 \param{wxWindow *}{parentWindow}}
624
625Called when the property is edited `in detail', i.e. when the Edit button is pressed.
626
627\membersection{wxPropertyListValidator::OnRetrieveValue}
628
629\func{Bool}{OnRetrieveValue}{\param{wxProperty *}{property}, \param{wxPropertyListView *}{view},
630 \param{wxWindow *}{parentWindow}}
631
632Called when Tick (Confirm) is pressed or focus is lost or view wants to update
633the property list. Should do the transfer from the property editing area to the property itself
634
635\membersection{wxPropertyListValidator::OnSelect}
636
637\func{Bool}{OnSelect}{\param{Bool}{ select}, \param{wxProperty *}{property}, \param{wxPropertyListView *}{view},
638 \param{wxWindow *}{parentWindow}}
639
640Called when the property is selected or deselected: typically displays the value
641in the edit control (having chosen a suitable control to display: (non)editable text or listbox).
642
643\membersection{wxPropertyListValidator::OnValueListSelect}
644
645\func{Bool}{OnValueListSelect}{\param{wxProperty *}{property}, \param{wxPropertyListView *}{view},
646 \param{wxWindow *}{parentWindow}}
647
648Called when the value listbox is selected. The default behaviour is to copy
649string to text control, and retrieve the value into the property.
650
651
652
653\section{\class{wxPropertyListView}: wxPropertyView}\label{wxpropertylistview}
654
655\overview{wxPropertyListView overview}{wxpropertylistviewoverview}
656
657The {\bf wxPropertyListView} class shows a wxPropertySheet as a Visual Basic-style property list.
658
659\membersection{wxPropertyListView::wxPropertyListView}
660
661\func{void}{wxPropertyListView}{\param{long}{ flags = wxPROP\_BUTTON\_DEFAULT}}
662
663Constructor.
664
665The {\it flags} argument can be a bit list of the following:
666
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
675\end{itemize}
676
677\membersection{wxPropertyListView::\destruct{wxPropertyListView}}
678
679\func{void}{\destruct{wxPropertyListView}}{\void}
680
681Destructor.
682
683\membersection{wxPropertyListView::AssociatePanel}\label{wxpropertylistviewassociatepanel}
684
685\func{void}{AssociatePanel}{\param{wxPanel *}{panel}}
686
687Associates the window on which the controls will be displayed, with the view (sets an internal pointer to the window).
688
689\membersection{wxPropertyListView::BeginShowingProperty}\label{wxpropertylistviewbeginshowingproperty}
690
691\func{Bool}{BeginShowingProperty}{\param{wxProperty *}{property}}
692
693Finds the appropriate validator and loads the property into the controls, by calling
694wxPropertyValidator::OnPrepareControls and then wxPropertyListView::DisplayProperty.
695
696\membersection{wxPropertyListView::DisplayProperty}\label{wxpropertylistviewdisplayproperty}
697
698\func{Bool}{DisplayProperty}{\param{wxProperty *}{property}}
699
700Calls wxPropertyValidator::OnDisplayValue for the current property's validator. This function
701gets called by wxPropertyListView::BeginShowingProperty, which is in turn called
702from ShowProperty, called by OnPropertySelect, called by the listbox callback when selected.
703
704\membersection{wxPropertyListView::EndShowingProperty}\label{wxpropertylistviewendshowingproperty}
705
706\func{Bool}{EndShowingProperty}{\param{wxProperty *}{property}}
707
708Finds the appropriate validator and unloads the property from the controls, by calling
709wxPropertyListView::RetrieveProperty, wxPropertyValidator::OnClearControls and (if we're in
710detailed editing mdoe) wxPropertyValidator::OnClearDetailControls.
711
712\membersection{wxPropertyListView::GetPanel}\label{wxpropertylistviewgetpanel}
713
714\func{wxPanel *}{GetPanel}{\void}
715
716Returns the panel associated with the view.
717
718\membersection{wxPropertyListView::GetManagedWindow}\label{wxpropertylistviewgetmanagedwindow}
719
720\func{wxWindow *}{GetManagedWindow}{\void}
721
722Returns the managed window (a frame or dialog) associated with the view.
723
724\membersection{wxPropertyListView::GetWindowCancelButton}\label{wxpropertylistviewgetwindowcancelbutton}
725
726\func{wxButton *}{GetWindowCancelButton}{\void}
727
728Returns the window cancel button, if any.
729
730\membersection{wxPropertyListView::GetWindowCloseButton}\label{wxpropertylistviewgetwindowclosebutton}
731
732\func{wxButton *}{GetWindowCloseButton}{\void}
733
734Returns the window close or OK button, if any.
735
736\membersection{wxPropertyListView::GetWindowHelpButton}\label{wxpropertylistviewgetwindowhelpbutton}
737
738\func{wxButton *}{GetWindowHelpButton}{\void}
739
740Returns the window help button, if any.
741
742\membersection{wxPropertyListView::SetManagedWindow}\label{wxpropertylistviewsetmanagedwindow}
743
744\func{void}{SetManagedWindow}{\param{wxWindow *}{win}}
745
746Sets the managed window (a frame or dialog) associated with the view.
747
748\membersection{wxPropertyListView::UpdatePropertyDisplayInList}\label{wxpropertylistviewupdatepropdisplay}
749
750\func{Bool}{UpdatePropertyDisplayInList}{\param{wxProperty *}{property}}
751
752Updates the display for the given changed property.
753
754\membersection{wxPropertyListView::UpdatePropertyList}\label{wxpropertylistviewupdateproplist}
755
756\func{Bool}{UpdatePropertyList}{\param{Bool }{clearEditArea = TRUE}}
757
758Updates the whole property list display.
759
760
761\section{\class{wxPropertySheet}: wxObject}\label{wxpropertysheet}
762
763\overview{wxPropertySheet overview}{wxpropertysheetoverview}
764
765The {\bf wxPropertySheet} class is used for storing a number of
766wxProperty objects (essentially names and values).
767
768\membersection{wxPropertySheet::wxPropertySheet}
769
f3a65071 770\func{void}{wxPropertySheet}{\param{const wxString}{ name = ""}}
e3a43801 771
f3a65071 772Constructor. Sets property sheet's name to name if present.
e3a43801
JS
773
774\membersection{wxPropertySheet::\destruct{wxPropertySheet}}
775
776\func{void}{\destruct{wxPropertySheet}}{\void}
777
778Destructor. Destroys all contained properties.
779
780\membersection{wxPropertySheet::AddProperty}\label{wxpropertysheetaddproperty}
781
782\func{void}{AddProperty}{\param{wxProperty *}{property}}
783
784Adds a property to the sheet.
785
786\membersection{wxPropertySheet::Clear}\label{wxpropertysheetclear}
787
788\func{void}{Clear}{\void}
789
790Clears all the properties from the sheet (deleting them).
791
f3a65071
JS
792\membersection{wxPropertySheet::GetName}\label{wxpropertysheetgetname}
793
794\func{wxString}{GetName}{\void}
795
796Gets the sheet's name.
797
798\membersection{wxPropertySheet::GetProperty}\label{wxpropertysheetgetproperty}
799
800\func{wxProperty *}{GetProperty}{\param{wxString}{ name}}
801
802Gets a property by name.
803
e3a43801
JS
804\membersection{wxPropertySheet::GetProperties}\label{wxpropertysheetgetproperties}
805
806\func{wxList\&}{GetProperties}{\void}
807
808Returns a reference to the internal list of properties.
809
f3a65071 810\membersection{wxPropertySheet::HasProperty}\label{wxpropertysheethasproperty}
e3a43801 811
f3a65071 812\func{bool}{HasProperty}{\param{wxString}{ propname}}
e3a43801 813
f3a65071
JS
814Returns true if sheet contains property propname.
815
816\membersection{wxPropertySheet::RemoveProperty}\label{wxpropertysheetremoveproperty}
817
818\func{void}{RemoveProperty}{\param{wxString}{ propname}}
819
820Removes property propname from sheet, deleting it.
821
822\membersection{wxPropertySheet::SetName}\label{wxpropertysheetsetname}
823
824\func{void}{SetName}{\param{wxString}{ sheetname}}
825
826Set the sheet's name to sheetname
827
828\membersection{wxPropertySheet::SetProperty}\label{wxpropertysheetsetproperty}
829
830\func{bool}{SetProperty}{\param{wxString}{ propname}, \param{wxPropertyValue}{ value}}
831
832Sets property propname to value. Returns false if property is not a member of sheet.
e3a43801
JS
833
834\membersection{wxPropertySheet::SetAllModified}
835
836\func{void}{SetAllModified}{\param{Bool}{ flag}}
837
838Sets the `modified' flag of each property value.
839
840
841
842\section{\class{wxPropertyValidator}: wxEvtHandler}\label{wxpropertyvalidator}
843
844\overview{wxPropertyValidator overview}{wxpropertyvalidatoroverview}
845
846The {\bf wxPropertyValidator} abstract class is the base class for deriving
847validators for properties.
848
849\membersection{wxPropertyValidator::wxPropertyValidator}
850
851\func{void}{wxPropertyValidator}{\param{long}{ flags = 0}}
852
853Constructor.
854
855\membersection{wxPropertyValidator::\destruct{wxPropertyValidator}}
856
857\func{void}{\destruct{wxPropertyValidator}}{\void}
858
859Destructor.
860
861\membersection{wxPropertyValidator::GetFlags}
862
863\func{long}{GetFlags}{\void}
864
865Returns the flags for the validator.
866
867\membersection{wxPropertyValidator::GetValidatorProperty}
868
869\func{wxProperty *}{GetValidatorProperty}{\void}
870
871Gets the property for the validator.
872
873\membersection{wxPropertyValidator::SetValidatorProperty}
874
875\func{void}{SetValidatorProperty}{\param{wxProperty *}{property}}
876
877Sets the property for the validator.
878
879
880\section{\class{wxPropertyValidatorRegistry}: wxHashTable}\label{wxpropertyvalidatorregistry}
881
882The {\bf wxPropertyValidatorRegistry} class is used for storing validators,
883indexed by the `role name' of the property, by which groups of property
884can be identified for the purpose of validation and editing.
885
886\membersection{wxPropertyValidatorRegistry::wxPropertyValidatorRegistry}
887
888\func{void}{wxPropertyValidatorRegistry}{\void}
889
890Constructor.
891
892\membersection{wxPropertyValidatorRegistry::\destruct{wxPropertyValidatorRegistry}}
893
894\func{void}{\destruct{wxPropertyValidatorRegistry}}{\void}
895
896Destructor.
897
898\membersection{wxPropertyValidatorRegistry::Clear}
899
900\func{void}{ClearRegistry}{\void}
901
902Clears the registry, deleting the validators.
903
904\membersection{wxPropertyValidatorRegistry::GetValidator}
905
906\func{wxPropertyValidator *}{GetValidator}{\param{wxString\& }{roleName}}
907
908Retrieve a validator by the property role name.
909
910\membersection{wxPropertyValidatorRegistry::RegisterValidator}\label{wxpropertyvalidatorregistervalidator}
911
912\func{void}{RegisterValidator}{\param{wxString\& }{roleName}, \param{wxPropertyValidator *}{validator}}
913
914Register a validator with the registry. {\it roleName} is a name indicating the
915role of the property, such as ``filename''. Later, when a validator is chosen for
916editing a property, this role name is matched against the class names of the property,
917if the property does not already have a validator explicitly associated with it.
918
919
920\section{\class{wxPropertyValue}: wxObject}\label{wxpropertyvalue}
921
922The {\bf wxPropertyValue} class represents the value of a property,
923and is normally associated with a wxProperty object.
924
925A wxPropertyValue has one of the following types:
926
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
938\end{itemize}
939
940\membersection{wxPropertyValue::wxPropertyValue}
941
942\func{void}{wxPropertyValue}{\void}
943
944Default constructor.
945
946\func{void}{wxPropertyValue}{\param{const wxPropertyValue\& }{copyFrom}}
947
948Copy constructor.
949
950\func{void}{wxPropertyValue}{\param{char *}{val}}
951
952Construction from a string value.
953
954\func{void}{wxPropertyValue}{\param{long}{ val}}
955
956Construction from an integer value. You may need to cast to (long) to
957avoid confusion with other constructors (such as the Bool constructor).
958
959\func{void}{wxPropertyValue}{\param{Bool}{ val}}
960
961Construction from a boolean value.
962
963\func{void}{wxPropertyValue}{\param{float}{ val}}
964
965Construction from a floating point value.
966
967\func{void}{wxPropertyValue}{\param{double}{ val}}
968
969Construction from a floating point value.
970
971\func{void}{wxPropertyValue}{\param{wxList *}{ val}}
972
973Construction from a list of wxPropertyValue objects. The
974list, but not each contained wxPropertyValue, will be deleted
975by the constructor. The wxPropertyValues will be assigned to
976this wxPropertyValue list. In other words, so do not delete wxList or
977its data after calling this constructor.
978
979\func{void}{wxPropertyValue}{\param{wxStringList *}{ val}}
980
981Construction from a list of strings. The list (including the strings
982contained in it) will be deleted by the constructor, so do not
983destroy {\it val} explicitly.
984
985\func{void}{wxPropertyValue}{\param{char **}{val}}
986
987Construction from a string pointer.
988
989\func{void}{wxPropertyValue}{\param{long *}{val}}
990
991Construction from an integer pointer.
992
993\func{void}{wxPropertyValue}{\param{Bool *}{val}}
994
995Construction from an boolean pointer.
996
997\func{void}{wxPropertyValue}{\param{float *}{val}}
998
999Construction from a floating point pointer.
1000
1001The last four constructors use pointers to various C++ types, and do not
1002store the types themselves; this allows the values to stand in for actual
1003data values defined elsewhere.
1004
1005\membersection{wxPropertyValue::\destruct{wxPropertyValue}}
1006
1007\func{void}{\destruct{wxPropertyValue}}{\void}
1008
1009Destructor.
1010
1011\membersection{wxPropertyValue::Append}
1012
1013\func{void}{Append}{\param{wxPropertyValue *}{expr}}
1014
1015Appends a property value to the list.
1016
1017\membersection{wxPropertyValue::BoolValue}
1018
1019\func{Bool}{BoolValue}{\void}
1020
1021Returns the boolean value.
1022
1023\membersection{wxPropertyValue::BoolValuePtr}
1024
1025\func{Bool *}{BoolValuePtr}{\void}
1026
1027Returns the pointer to the boolean value.
1028
1029\membersection{wxPropertyValue::ClearList}
1030
1031\func{void}{ClearList}{\void}
1032
1033Deletes the contents of the list.
1034
1035\membersection{wxPropertyValue::Delete}
1036
1037\func{void}{Delete}{\param{wxPropertyValue *}{expr}}
1038
1039Deletes {\it expr} from this list.
1040
1041\membersection{wxPropertyValue::GetFirst}
1042
1043\func{wxPropertyValue *}{GetFirst}{\void}
1044
1045Gets the first value in the list.
1046
1047\membersection{wxPropertyValue::GetLast}
1048
1049\func{wxPropertyValue *}{GetFirst}{\void}
1050
1051Gets the last value in the list.
1052
1053\membersection{wxPropertyValue::GetModified}
1054
1055\func{Bool}{GetModified}{\void}
1056
1057Returns TRUE if the value was modified since being created
1058(or since SetModified was called).
1059
1060\membersection{wxPropertyValue::GetNext}
1061
1062\func{wxPropertyValue *}{GetNext}{\void}
1063
1064Gets the next value in the list (the one after `this').
1065
1066\membersection{wxPropertyValue::GetStringRepresentation}
1067
1068\func{wxString}{GetStringRepresentation}{\void}
1069
1070Gets a string representation of the value.
1071
1072\membersection{wxPropertyValue::IntegerValue}
1073
1074\func{long}{IntegerValue}{\void}
1075
1076Returns the integer value.
1077
1078\membersection{wxPropertyValue::Insert}
1079
1080\func{void}{Insert}{\param{wxPropertyValue *}{expr}}
1081
1082Inserts a property value at the front of a list.
1083
1084\membersection{wxPropertyValue::IntegerValuePtr}
1085
1086\func{long *}{IntegerValuePtr}{\void}
1087
1088Returns the pointer to the integer value.
1089
1090\membersection{wxPropertyValue::Nth}
1091
1092\func{wxPropertyValue *}{Nth}{\param{int}{ n}}
1093
1094Returns the nth value of a list expression (starting from zero).
1095
1096\membersection{wxPropertyValue::Number}
1097
1098\func{int}{Number}{\void}
1099
1100Returns the number of elements in a list expression.
1101
1102\membersection{wxPropertyValue::RealValue}
1103
1104\func{float}{RealValue}{\void}
1105
1106Returns the floating point value.
1107
1108\membersection{wxPropertyValue::RealValuePtr}
1109
1110\func{float *}{RealValuePtr}{\void}
1111
1112Returns the pointer to the floating point value.
1113
1114\membersection{wxPropertyValue::SetModified}
1115
1116\func{void}{SetModified}{\param{Bool}{ flag}}
1117
1118Sets the `modified' flag.
1119
1120\membersection{wxPropertyValue::StringValue}
1121
1122\func{char *}{StringValue}{\void}
1123
1124Returns the string value.
1125
1126\membersection{wxPropertyValue::StringValuePtr}
1127
1128\func{char **}{StringValuePtr}{\void}
1129
1130Returns the pointer to the string value.
1131
1132\membersection{wxPropertyValue::Type}
1133
1134\func{wxPropertyValueType}{Type}{\void}
1135
1136Returns the value type.
1137
1138\membersection{wxPropertyValue::operator $=$}
1139
1140\func{void}{operator $=$}{\param{const wxPropertyValue\& }{val}}
1141
1142\func{void}{operator $=$}{\param{const char *}{val}}
1143
1144\func{void}{operator $=$}{\param{const long }{val}}
1145
1146\func{void}{operator $=$}{\param{const Bool }{val}}
1147
1148\func{void}{operator $=$}{\param{const float }{val}}
1149
1150\func{void}{operator $=$}{\param{const char **}{val}}
1151
1152\func{void}{operator $=$}{\param{const long *}{val}}
1153
1154\func{void}{operator $=$}{\param{const Bool *}{val}}
1155
1156\func{void}{operator $=$}{\param{const float *}{val}}
1157
1158Assignment operators.
1159
1160
1161
1162\section{\class{wxPropertyView}: wxEvtHandler}\label{wxpropertyview}
1163
1164\overview{wxPropertyView overview}{wxpropertyviewoverview}
1165
1166The {\bf wxPropertyView} abstract class is the base class for views
1167of property sheets, acting as intermediaries between properties and
1168actual windows.
1169
1170\membersection{wxPropertyView::wxPropertyView}
1171
1172\func{void}{wxPropertyView}{\param{long}{ flags = wxPROP\_BUTTON\_DEFAULT}}
1173
1174Constructor.
1175
1176The {\it flags} argument can be a bit list of the following:
1177
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
1186\end{itemize}
1187
1188\membersection{wxPropertyView::\destruct{wxPropertyView}}
1189
1190\func{void}{\destruct{wxPropertyView}}{\void}
1191
1192Destructor.
1193
1194\membersection{wxPropertyView::AddRegistry}\label{wxpropertyviewaddregistry}
1195
1196\func{void}{AddRegistry}{\param{wxPropertyValidatorRegistry *}{registry}}
1197
1198Adds a registry (list of property validators) the view's list of registries, which is initially empty.
1199
1200\membersection{wxPropertyView::FindPropertyValidator}\label{wxpropertyviewfindpropertyvalidator}
1201
1202\func{wxPropertyValidator *}{FindPropertyValidator}{\param{wxProperty *}{property}}
1203
1204Finds the property validator that is most appropriate to this property.
1205
1206\membersection{wxPropertyView::GetPropertySheet}\label{wxpropertyviewgetpropertysheet}
1207
1208\func{wxPropertySheet *}{GetPropertySheet}{\void}
1209
1210Gets the property sheet for this view.
1211
1212\membersection{wxPropertyView::GetRegistryList}\label{wxpropertyviewgetregistrylist}
1213
1214\func{wxList\&}{GetRegistryList}{\void}
1215
1216Returns a reference to the list of property validator registries.
1217
1218\membersection{wxPropertyView::OnOk}\label{wxpropertyviewonok}
1219
1220\func{void}{OnOk}{\void}
1221
1222Virtual function that will be called when the OK button on the physical window is pressed (if it exists).
1223
1224\membersection{wxPropertyView::OnCancel}\label{wxpropertyviewoncancel}
1225
1226\func{void}{OnCancel}{\void}
1227
1228Virtual function that will be called when the Cancel button on the physical window is pressed (if it exists).
1229
1230\membersection{wxPropertyView::OnClose}\label{wxpropertyviewonclose}
1231
1232\func{Bool}{OnClose}{\void}
1233
1234Virtual function that will be called when the physical window is closed. The default implementation returns FALSE.
1235
1236\membersection{wxPropertyView::OnHelp}\label{wxpropertyviewonhelp}
1237
1238\func{void}{OnHelp}{\void}
1239
1240Virtual function that will be called when the Help button on the physical window is pressed (if it exists).
1241
1242\membersection{wxPropertyView::OnPropertyChanged}\label{wxpropertyviewonpropertychanged}
1243
1244\func{void}{OnPropertyChanged}{\param{wxProperty *}{property}}
1245
1246Virtual function called by a view or validator when a property's value changed. Validators
1247must be written correctly for this to be called. You can override this function
1248to respond immediately to property value changes.
1249
1250\membersection{wxPropertyView::OnUpdateView}\label{wxpropertyviewonupdateview}
1251
1252\func{Bool}{OnUpdateView}{\void}
1253
1254Called by the viewed object to update the view. The default implementation just returns
1255FALSE.
1256
1257\membersection{wxPropertyView::SetPropertySheet}\label{wxpropertyviewsetpropertysheet}
1258
1259\func{void}{SetPropertySheet}{\param{wxPropertySheet *}{sheet}}
1260
1261Sets the property sheet for this view.
1262
1263\membersection{wxPropertyView::ShowView}\label{wxpropertyviewshowview}
1264
1265\func{void}{ShowView}{\param{wxPropertySheet *}{sheet}, \param{wxPanel *}{panel}}
1266
1267Associates this view with the given panel, and shows the view.
1268
1269\section{\class{wxRealFormValidator}: wxPropertyFormValidator}\label{wxrealformvalidator}
1270
1271\overview{Validator classes}{validatorclasses}
1272
1273This class validates a range of real values for form views. The associated panel item must be a wxText.
1274
1275\membersection{wxRealFormValidator::wxRealFormValidator}
1276
1277\func{void}{wxRealFormValidator}{\param{float }{min=0.0}, \param{float }{max=0.0},
1278 \param{long}{ flags=0}}
1279
1280Constructor. Assigning zero to minimum and maximum values indicates that there is no range to check.
1281
1282
1283\section{\class{wxStringFormValidator}: wxPropertyFormValidator}\label{wxstringformvalidator}
1284
1285\overview{Validator classes}{validatorclasses}
1286
1287This class validates a string value for a form view, with an optional choice of possible values.
1288The associated panel item must be a wxText, wxListBox or wxChoice. For wxListBox and wxChoice items,
1289if the item is empty, the validator attempts to initialize the item from the strings in
1290the validator. Note that this does not happen for XView wxChoice items since XView cannot reinitialize a wxChoice.
1291
1292\membersection{wxStringFormValidator::wxStringFormValidator}
1293
1294\func{void}{wxStringFormValidator}{\param{wxStringList *}{list=NULL}, \param{long}{ flags=0}}
1295
1296Constructor. Supply a list of strings to indicate a choice, or no strings to allow the
1297user to freely edit the string. The string list will be deleted when the validator is deleted.
1298
1299
1300\section{\class{wxRealListValidator}: wxPropertyListValidator}\label{wxreallistvalidator}
1301
1302\overview{Validator classes}{validatorclasses}
1303
1304This class validates a range of real values for property lists.
1305
1306\membersection{wxRealListValidator::wxreallistvalidator}
1307
1308\func{void}{wxRealListValidator}{\param{float }{min=0.0}, \param{float }{max=0.0},
1309 \param{long}{ flags=wxPROP\_ALLOW\_TEXT\_EDITING}}
1310
1311Constructor. Assigning zero to minimum and maximum values indicates that there is no range to check.
1312
1313
1314\section{\class{wxStringListValidator}: wxPropertyListValidator}\label{wxstringlistvalidator}
1315
1316\overview{Validator classes}{validatorclasses}
1317
1318This class validates a string value, with an optional choice of possible values.
1319
1320\membersection{wxStringListValidator::wxStringListValidator}
1321
1322\func{void}{wxStringListValidator}{\param{wxStringList *}{list=NULL}, \param{long}{ flags=0}}
1323
1324Constructor. Supply a list of strings to indicate a choice, or no strings to allow the
1325user to freely edit the string. The string list will be deleted when the validator is deleted.
1326
1327
1328\chapter{Classes by category}\label{classesbycat}
1329
1330A classification of property sheet classes by category.
1331
1332\section{Data classes}
1333
1334\begin{itemize}\itemsep=0pt
1335\item \helpref{wxProperty}{wxproperty}
1336\item \helpref{wxPropertyValue}{wxpropertyvalue}
1337\item \helpref{wxPropertySheet}{wxpropertysheet}
1338\end{itemize}
1339
1340
1341\section{Validator classes}\label{validatorclasses}
1342
1343Validators check that the values the user has entered for a property are
1344valid. They can also define specific ways of entering data, such as a
1345file selector for a filename, and they are responsible for transferring
1346values between the wxProperty and the physical display.
1347
1348Base classes:
1349
1350\begin{itemize}\itemsep=0pt
1351\item \helpref{wxPropertyValidator}{wxproperty}
1352\item \helpref{wxPropertyListValidator}{wxpropertylistvalidator}
1353\item \helpref{wxPropertyFormValidator}{wxpropertyformvalidator}
1354\end{itemize}
1355
1356List view validators:
1357
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}
1365\end{itemize}
1366
1367Form view validators:
1368
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}
1374\end{itemize}
1375
1376\section{View classes}\label{viewclasses}
1377
1378View classes mediate between a property sheet and a physical window.
1379
1380\begin{itemize}\itemsep=0pt
1381\item \helpref{wxPropertyView}{wxpropertyview}
1382\item \helpref{wxPropertyListView}{wxpropertylistview}
1383\item \helpref{wxPropertyFormView}{wxpropertyformview}
1384\end{itemize}
1385
1386\section{Window classes}\label{windowclasses}
1387
1388The class library defines some window classes that can be used as-is with a suitable
1389view class and property sheet.
1390
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}
1398\end{itemize}
1399
1400\section{Registry classes}
1401
1402A validator registry is a list of validators that can be applied to properties in a property sheet.
1403There may be one or more registries per property view.
1404
1405\begin{itemize}\itemsep=0pt
1406\item \helpref{wxPropertyValidatorRegistry}{wxpropertyvalidatorregistry}
1407\end{itemize}
1408
1409
1410\chapter{Topic overviews}\label{overviews}
1411
1412This chapter contains a selection of topic overviews.
1413
1414\section{Property classes overview}\label{propertyoverview}
1415
1416The property classes help a programmer to express relationships between
1417data and physical windows, in particular:
1418
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
1422types of data;
1423\item the validation of data, notifying the user when incorrect data is entered,
1424or even better, constraining the input so only valid data can be entered.
1425\end{itemize}
1426
1427With a consistent framework, the programmer should be able to use existing
1428components and design new ones in a principled manner, to solve many data entry
1429requirements.
1430
1431Each datum is represented in a \helpref{wxProperty}{wxproperty}, which has a name and a value.
1432Various C++ types are permitted in the value of a property, and the property can store a pointer
1433to the data instead of a copy of the data. A \helpref{wxPropertySheet}{wxpropertysheet} represents a number of these properties.
1434
1435These two classes are independent from the way in which the data is visually manipulated. To
1436mediate between property sheets and windows, the abstract class \helpref{wxPropertyView}{wxpropertyview} is
1437available for programmers to derive new kinds of view. One kind of view that is available is the \helpref{wxPropertyListView}{wxpropertylistview},
1438which displays the data in a Visual Basic-style list, with a small number of controls for editing
1439the currently selected property. Another is \helpref{wxPropertyFormView}{wxpropertyformview} which
1440mediates between an existing dialog or panel and the property sheet.
1441
1442The hard work of mediation is actually performed by validators, which are instances of classes
1443derived from \helpref{wxPropertyValidator}{wxpropertyvalidator}. A validator is associated with
1444a particular property and is responsible for
1445responding to user interface events, and displaying, updating and checking the property value.
1446Because a validator's behaviour depends largely on the kind of view being used, there has to be
1447a separate hierarchy of validators for each class of view. So for wxPropertyListView, there is
1448an abstract class \helpref{wxPropertyListValidator}{wxpropertylistvalidator} from which concrete
1449classes are derived, such as \helpref{wxRealListValidator}{wxreallistvalidator} and
1450\rtfsp\helpref{wxStringListValidator}{wxstringlistvalidator}.
1451
1452A validator can be explicitly set for a property, so there is no doubt which validator
1453should be used to edit that property. However, it is also possible to define a registry
1454of validators, and have the validator chosen on the basis of the {\it role} of the property.
1455So a property with a ``filename" role would match the ``filename" validator, which pops
1456up a file selector when the user double clicks on the property.
1457
1458You don't have to define your own frame or window classes: there are some predefined
1459that will work with the property list view. See \helpref{Window classes}{windowclasses} for
1460further details.
1461
1462\subsection{Example 1: Property list view}
1463
1464The following code fragment shows the essentials of creating a registry of
1465standard validators, a property sheet containing some properties, and
1466a property list view and dialog or frame. RegisterValidators will be
1467called on program start, and PropertySheetTest is called in response to a
1468menu command.
1469
1470Note how some properties are created with an explicit reference to
1471a validator, and others are provided with a ``role'' which can be matched
1472against a validator in the registry.
1473
1474The interface generated by this test program is shown in the section \helpref{Appearance and
1475behaviour of a property list view}{appearance}.
1476
1477\begin{verbatim}
1478void RegisterValidators(void)
1479{
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);
1484}
1485
1486void PropertyListTest(Bool useDialog)
1487{
1488 wxPropertySheet *sheet = new wxPropertySheet;
1489
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)));
1498
1499 wxPropertyListView *view =
1500 new wxPropertyListView(NULL,
1501 wxPROP_BUTTON_CHECK_CROSS|wxPROP_DYNAMIC_VALUE_FIELD|wxPROP_PULLDOWN);
1502
1503 wxDialogBox *propDialog = NULL;
1504 wxPropertyListFrame *propFrame = NULL;
1505 if (useDialog)
1506 {
1507 propDialog = new wxPropertyListDialog(view, NULL, "Property Sheet Test", TRUE, -1, -1, 400, 500);
1508 }
1509 else
1510 {
1511 propFrame = new wxPropertyListFrame(view, NULL, "Property Sheet Test", -1, -1, 400, 500);
1512 }
1513
1514 view->AddRegistry(&myListValidatorRegistry);
1515
1516 if (useDialog)
1517 {
1518 view->ShowView(sheet, propDialog);
1519 propDialog->Centre(wxBOTH);
1520 propDialog->Show(TRUE);
1521 }
1522 else
1523 {
1524 propFrame->Initialize();
1525 view->ShowView(sheet, propFrame->GetPropertyPanel());
1526 propFrame->Centre(wxBOTH);
1527 propFrame->Show(TRUE);
1528 }
1529}
1530\end{verbatim}
1531
1532\subsection{Example 2: Property form view}
1533
1534This example is similar to Example 1, but uses a property form view to
1535edit a property sheet using a predefined dialog box.
1536
1537\begin{verbatim}
1538void RegisterValidators(void)
1539{
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);
1544}
1545
1546void PropertyFormTest(Bool useDialog)
1547{
1548 wxPropertySheet *sheet = new wxPropertySheet;
1549
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)));
1556
1557 wxPropertyFormView *view = new wxPropertyFormView(NULL);
1558
1559 wxDialogBox *propDialog = NULL;
1560 wxPropertyFormFrame *propFrame = NULL;
1561 if (useDialog)
1562 {
1563 propDialog = new wxPropertyFormDialog(view, NULL, "Property Form Test", TRUE, -1, -1, 400, 300);
1564 }
1565 else
1566 {
1567 propFrame = new wxPropertyFormFrame(view, NULL, "Property Form Test", -1, -1, 400, 300);
1568 propFrame->Initialize();
1569 }
1570
1571 wxPanel *panel = propDialog ? propDialog : propFrame->GetPropertyPanel();
1572 panel->SetLabelPosition(wxVERTICAL);
1573
1574 // Add items to the panel
1575
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");
1580 panel->NewLine();
1581
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");
1586 panel->NewLine();
1587 (void) new wxListBox(panel, (wxFunction)NULL, "Constrained", wxSINGLE, -1, -1, 100, 90, 0, NULL, 0, "constrained");
1588
1589 view->AddRegistry(&myFormValidatorRegistry);
1590
1591 if (useDialog)
1592 {
1593 view->ShowView(sheet, propDialog);
1594 view->AssociateNames();
1595 view->TransferToDialog();
1596 propDialog->Centre(wxBOTH);
1597 propDialog->Show(TRUE);
1598 }
1599 else
1600 {
1601 view->ShowView(sheet, propFrame->GetPropertyPanel());
1602 view->AssociateNames();
1603 view->TransferToDialog();
1604 propFrame->Centre(wxBOTH);
1605 propFrame->Show(TRUE);
1606 }
1607}
1608\end{verbatim}
1609
1610\section{Validator classes overview}\label{validatoroverview}
1611
1612Classes: \helpref{Validator classes}{validatorclasses}
1613
1614The validator classes provide functionality for mediating between a wxProperty and
1615the actual display. There is a separate family of validator classes for each
1616class of view, since the differences in user interface for these views implies
1617that little common functionality can be shared amongst validators.
1618
1619\subsection{wxPropertyValidator overview}\label{wxpropertyvalidatoroverview}
1620
1621Class: \helpref{wxPropertyValidator}{wxpropertyvalidator}
1622
1623This class is the root of all property validator classes. It contains a small
1624amount of common functionality, including functions to convert between
1625strings and C++ values.
1626
1627A validator is notionally an object which sits between a property and its displayed
1628value, and checks that the value the user enters is correct, giving an error message
1629if the validation fails. In fact, the validator does more than that, and is akin to
1630a view class but at a finer level of detail. It is also responsible for
1631loading the dialog box control with the value from the property, putting it back
1632into the property, preparing special controls for editing the value, and
1633may even invoke special dialogs for editing the value in a convenient way.
1634
1635In a property list dialog, there is quite a lot of scope for supplying custom dialogs,
1636such as file or colour selectors. For a form dialog, there is less scope because
1637there is no concept of `detailed editing' of a value: one control is associated with
1638one property, and there is no provision for invoking further dialogs. The reader
1639may like to work out how the form view could be extended to provide some of the
1640functionality of the property list!
1641
1642Validator objects may be associated explictly with a wxProperty, or they may be
1643indirectly associated by virtue of a property `kind' that matches validators having
1644that kind. In the latter case, such validators are stored in a validator registry
1645which is passed to the view before the dialog is shown. If the validator takes
1646arguments, such as minimum and maximum values in the case of a wxIntegerListValidator,
1647then the validator must be associated explicitly with the property. The validator
1648will be deleted when the property is deleted.
1649
1650\subsection{wxPropertyListValidator overview}\label{wxpropertylistvalidatoroverview}
1651
1652Class: \helpref{wxPropertyListValidator}{wxpropertylistvalidator}
1653
1654This class is the abstract base class for property list view validators.
1655The list view acts upon a user interface containing a list of properties,
1656a text item for direct property value editing, confirm/cancel buttons for the value,
1657a pulldown list for making a choice between values, and OK/Cancel/Help buttons
1658for the dialog (see \helpref{property list appearance}{appearance}).
1659
1660By overriding virtual functions, the programmer can create custom
1661behaviour for different kinds of property. Custom behaviour can use just the
1662available controls on the property list dialog, or the validator can
1663invoke custom editors with quite different controls, which pop up in
1664`detailed editing' mode.
1665
1666See the detailed class documentation for the members you should override
1667to give your validator appropriate behaviour.
1668
1669\subsection{wxPropertyFormValidator overview}\label{wxpropertyformvalidatoroverview}
1670
1671This class is the abstract base class for property form view validators.
1672The form view acts upon an existing dialog box or panel, where either the
1673panel item names correspond to property names, or the programmer has explicitly
1674associated the panel item with the property.
1675
1676By overriding virtual functions, the programmer determines how
1677values are displayed or retrieved, and the checking that the validator does.
1678
1679See the detailed class documentation for the members you should override
1680to give your validator appropriate behaviour.
1681
1682\section{View classes overview}\label{viewoverview}
1683
1684Classes: \helpref{View classes}{viewclasses}
1685
1686An instance of a view class relates a property sheet with an actual window.
1687Currently, there are two classes of view: wxPropertyListView and wxPropertyFormView.
1688
1689\subsection{wxPropertyView overview}\label{wxpropertyviewoverview}
1690
1691Class: \helpref{wxPropertyView}{wxpropertyview}
1692
1693This is the abstract base class for property views.
1694
1695\subsection{wxPropertyListView overview}\label{wxpropertylistviewoverview}
1696
1697Class: \helpref{wxPropertyListView}{wxpropertylistview}
1698
1699The property list view defines the relationship between a property sheet and
1700a property list dialog or panel. It manages user interface events such as
1701clicking on a property, pressing return in the text edit field, and clicking
1702on Confirm or Cancel. These events cause member functions of the
1703class to be called, and these in turn may call member functions of
1704the appropriate validator to be called, to prepare controls, check the property value,
1705invoke detailed editing, etc.
1706
1707\subsection{wxPropertyFormView overview}\label{wxpropertyformviewoverview}
1708
1709Class: \helpref{wxPropertyFormView}{wxpropertyformview}
1710
1711The property form view manages the relationship between a property sheet
1712and an existing dialog or panel.
1713
1714You must first create a panel or dialog box for the view to work on.
1715The panel should contain panel items with names that correspond to
1716properties in your property sheet; or you can explicitly set the
1717panel item for each property.
1718
1719Apart from any custom panel items that you wish to control independently
1720of the property-editing items, wxPropertyFormView takes over the
1721processing of item events. It can also control normal dialog behaviour such
1722as OK, Cancel, so you should also create some standard buttons that the property view
1723can recognise. Just create the buttons with standard names and the view
1724will do the rest. The following button names are recognised:
1725
1726\begin{itemize}\itemsep=0pt
1727\item {\bf ok}: indicates the OK button. Calls wxPropertyFormView::OnOk. By default,
1728checks 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,
1730closes and deletes the frame or dialog, then deletes the view.
1731\item {\bf help}: indicates the Help button. Calls wxPropertyFormView::OnHelp. This needs
1732to be overridden by the application for anything interesting to happen.
1733\item {\bf revert}: indicates the Revert button. Calls wxPropertyFormView::OnRevert,
1734which by default transfers the wxProperty values to the panel items (in effect
1735undoing any unsaved changes in the items).
1736\item {\bf update}: indicates the Revert button. Calls wxPropertyFormView::OnUpdate, which
1737by defaults transfers the displayed values to the wxProperty objects.
1738\end{itemize}
1739
1740\section{wxPropertySheet overview}\label{wxpropertysheetoverview}
1741
1742Classes: \helpref{wxPropertySheet}{wxpropertysheet}, \helpref{wxProperty}{wxproperty}, \helpref{wxPropertyValue}{wxpropertyvalue}
1743
1744A property sheet defines zero or more properties. This is a bit like an explicit representation of
1745a C++ object. wxProperty objects can have values which are pointers to C++ values, or they
1746can allocate their own storage for values.
1747
1748Because the property sheet representation is explicit and can be manipulated by
1749a program, it is a convenient form to be used for a variety of
1750editing purposes. wxPropertyListView and wxPropertyFormView are two classes that
1751specify the relationship between a property sheet and a user interface. You could imagine
1752other uses for wxPropertySheet, for example to generate a form-like user interface without
1753the need for GUI programming. Or for storing the names and values of command-line switches, with the
1754option to subsequently edit these values using a wxPropertyListView.
1755
1756A typical use for a property sheet is to represent values of an object
1757which are only implicit in the current representation of it. For
1758example, in Visual Basic and similar programming environments, you can
1759`edit a button', or rather, edit the button's properties. One of the
1760properties you can edit is {\it width} - but there is no explicit
1761representation of width in a wxWindows button; instead, you call SetSize
1762and GetSize members. To translate this into a consisent,
1763property-oriented scheme, we could derive a new class
1764wxButtonWithProperties, which has two new functions: SetProperty and
1765GetProperty. SetProperty accepts a property name and a value, and calls
1766an appropriate function for the property that is being passed.
1767GetProperty accepts a property name, returning a property value. So
1768instead of having to use the usual arbitrary set of C++ member functions
1769to set or access attributes of a window, programmer deals merely with
1770SetValue/GetValue, and property names and values.
1771We now have a single point at which we can modify or query an object by specifying
1772names and values at run-time. (The implementation of SetProperty and GetProperty
1773is probably quite messy and involves a large if-then-else statement to
1774test the property name and act accordingly.)
1775
1776When the user invokes the property editor for a wxButtonWithProperties, the system
1777creates a wxPropertySheet with `imaginary' properties such as width, height, font size
1778and so on. For each property, wxButtonWithProperties::GetProperty is called, and the result is
1779passed to the corresponding wxProperty. The wxPropertySheet is passed to a wxPropertyListView
1780as described elsewhere, and the user edits away. When the user has finished editing, the system calls
1781wxButtonWithProperties::SetProperty to transfer the wxProperty value back into the button
1782by way of an appropriate call, wxWindow::SetSize in the case of width and height properties.
1783
1784
1785