]> git.saurik.com Git - wxWidgets.git/blob - interface/valgen.h
854507dcece83bc0a19e75de883e390c8a5b48d8
[wxWidgets.git] / interface / valgen.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: valgen.h
3 // Purpose: documentation for wxGenericValidator class
4 // Author: wxWidgets team
5 // RCS-ID: $Id$
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
8
9 /**
10 @class wxGenericValidator
11 @wxheader{valgen.h}
12
13 wxGenericValidator performs data transfer (but not validation or filtering) for
14 the following
15 basic controls: wxButton, wxCheckBox, wxListBox, wxStaticText, wxRadioButton,
16 wxRadioBox,
17 wxChoice, wxComboBox, wxGauge, wxSlider, wxScrollBar, wxSpinButton, wxTextCtrl,
18 wxCheckListBox.
19
20 It checks the type of the window and uses an appropriate type for that window.
21 For example,
22 wxButton and wxTextCtrl transfer data to and from a wxString variable;
23 wxListBox uses a
24 wxArrayInt; wxCheckBox uses a bool.
25
26 For more information, please see @ref overview_validatoroverview "Validator
27 overview".
28
29 @library{wxcore}
30 @category{validator}
31
32 @seealso
33 @ref overview_validatoroverview "Validator overview", wxValidator,
34 wxTextValidator
35 */
36 class wxGenericValidator : public wxValidator
37 {
38 public:
39 //@{
40 /**
41 Constructor taking a wxDateTime pointer. This will be
42 used for wxDatePickerCtrl.
43
44 @param validator
45 Validator to copy.
46 @param valPtr
47 A pointer to a variable that contains the value. This variable
48 should have a lifetime equal to or longer than the validator lifetime
49 (which is usually
50 determined by the lifetime of the window).
51 */
52 wxGenericValidator(const wxGenericValidator& validator);
53 wxGenericValidator(bool* valPtr);
54 wxGenericValidator(wxString* valPtr);
55 wxGenericValidator(int* valPtr);
56 wxGenericValidator(wxArrayInt* valPtr);
57 wxGenericValidator(wxDateTime* valPtr);
58 //@}
59
60 /**
61 Destructor.
62 */
63 ~wxGenericValidator();
64
65 /**
66 Clones the generic validator using the copy constructor.
67 */
68 virtual wxValidator* Clone();
69
70 /**
71 Transfers the value from the window to the appropriate data type.
72 */
73 virtual bool TransferFromWindow();
74
75 /**
76 Transfers the value to the window.
77 */
78 virtual bool TransferToWindow();
79 };