]> git.saurik.com Git - wxWidgets.git/blob - interface/wx/valgen.h
avoid populating the array with NULL controls during creation (SetWindowVariant calli...
[wxWidgets.git] / interface / wx / valgen.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: valgen.h
3 // Purpose: interface of wxGenericValidator
4 // Author: wxWidgets team
5 // RCS-ID: $Id$
6 // Licence: wxWindows licence
7 /////////////////////////////////////////////////////////////////////////////
8
9 /**
10 @class wxGenericValidator
11
12 wxGenericValidator performs data transfer (but not validation or filtering)
13 for many type of controls.
14
15 wxGenericValidator supports:
16 - wxButton, wxRadioButton, wxToggleButton, wxBitmapToggleButton, wxSpinButton
17 - wxCheckBox, wxRadioBox, wxComboBox, wxListBox, wxCheckListBox
18 - wxGauge, wxSlider, wxScrollBar, wxChoice, wxStaticText
19 - wxSpinCtrl, wxTextCtrl
20
21 It checks the type of the window and uses an appropriate type for it.
22 For example, wxButton and wxTextCtrl transfer data to and from a
23 wxString variable; wxListBox uses a wxArrayInt; wxCheckBox uses a boolean.
24
25 For more information, please see @ref overview_validator.
26
27 @library{wxcore}
28 @category{validator}
29
30 @see @ref overview_validator, wxValidator, wxTextValidator,
31 wxIntegerValidator, wxFloatingPointValidator
32 */
33 class wxGenericValidator : public wxValidator
34 {
35 public:
36 /**
37 Copy constructor.
38
39 @param validator
40 Validator to copy.
41 */
42 wxGenericValidator(const wxGenericValidator& validator);
43 /**
44 Constructor taking a bool pointer. This will be used for wxCheckBox,
45 wxRadioButton, wxToggleButton and wxBitmapToggleButton.
46
47 @param valPtr
48 A pointer to a variable that contains the value. This variable
49 should have a lifetime equal to or longer than the validator
50 lifetime (which is usually determined by the lifetime of the
51 window).
52 */
53 wxGenericValidator(bool* valPtr);
54 /**
55 Constructor taking a wxString pointer. This will be used for wxButton,
56 wxComboBox, wxStaticText, wxTextCtrl.
57
58 @param valPtr
59 A pointer to a variable that contains the value. This variable
60 should have a lifetime equal to or longer than the validator
61 lifetime (which is usually determined by the lifetime of the
62 window).
63 */
64 wxGenericValidator(wxString* valPtr);
65 /**
66 Constructor taking an integer pointer. This will be used for wxChoice,
67 wxGauge, wxScrollBar, wxRadioBox, wxSlider, wxSpinButton and
68 wxSpinCtrl.
69
70 @param valPtr
71 A pointer to a variable that contains the value. This variable
72 should have a lifetime equal to or longer than the validator
73 lifetime (which is usually determined by the lifetime of the
74 window).
75 */
76 wxGenericValidator(int* valPtr);
77 /**
78 Constructor taking a wxArrayInt pointer. This will be used for
79 wxListBox, wxCheckListBox.
80
81 @param valPtr
82 A pointer to a variable that contains the value. This variable
83 should have a lifetime equal to or longer than the validator
84 lifetime (which is usually determined by the lifetime of the
85 window).
86 */
87 wxGenericValidator(wxArrayInt* valPtr);
88 /**
89 Constructor taking a wxDateTime pointer. This will be used for
90 wxDatePickerCtrl.
91
92 @param valPtr
93 A pointer to a variable that contains the value. This variable
94 should have a lifetime equal to or longer than the validator
95 lifetime (which is usually determined by the lifetime of the
96 window).
97 */
98 wxGenericValidator(wxDateTime* valPtr);
99
100 /**
101 Destructor.
102 */
103 virtual ~wxGenericValidator();
104
105 /**
106 Clones the generic validator using the copy constructor.
107 */
108 virtual wxObject* Clone() const;
109
110 /**
111 Transfers the value from the window to the appropriate data type.
112 */
113 virtual bool TransferFromWindow();
114
115 /**
116 Transfers the value to the window.
117 */
118 virtual bool TransferToWindow();
119 };
120