]>
git.saurik.com Git - wxWidgets.git/blob - interface/wx/valgen.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: interface of wxGenericValidator
4 // Author: wxWidgets team
6 // Licence: wxWindows licence
7 /////////////////////////////////////////////////////////////////////////////
10 @class wxGenericValidator
12 wxGenericValidator performs data transfer (but not validation or filtering)
13 for many type of controls.
15 wxGenericValidator supports:
16 - wxButton, wxRadioButton, wxToggleButton, wxBitmapToggleButton, wxSpinButton
17 - wxCheckBox, wxRadioBox, wxComboBox, wxListBox, wxCheckListBox
18 - wxGauge, wxSlider, wxScrollBar, wxChoice, wxStaticText
19 - wxSpinCtrl, wxTextCtrl
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.
25 For more information, please see @ref overview_validator.
30 @see @ref overview_validator, wxValidator, wxTextValidator,
31 wxIntegerValidator, wxFloatingPointValidator
33 class wxGenericValidator
: public wxValidator
42 wxGenericValidator(const wxGenericValidator
& validator
);
44 Constructor taking a bool pointer. This will be used for wxCheckBox,
45 wxRadioButton, wxToggleButton and wxBitmapToggleButton.
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
53 wxGenericValidator(bool* valPtr
);
55 Constructor taking a wxString pointer. This will be used for wxButton,
56 wxComboBox, wxStaticText, wxTextCtrl.
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
64 wxGenericValidator(wxString
* valPtr
);
66 Constructor taking an integer pointer. This will be used for wxChoice,
67 wxGauge, wxScrollBar, wxRadioBox, wxSlider, wxSpinButton and
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
76 wxGenericValidator(int* valPtr
);
78 Constructor taking a wxArrayInt pointer. This will be used for
79 wxListBox, wxCheckListBox.
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
87 wxGenericValidator(wxArrayInt
* valPtr
);
89 Constructor taking a wxDateTime pointer. This will be used for
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
98 wxGenericValidator(wxDateTime
* valPtr
);
100 Constructor taking a wxFileName pointer. This will be used for
104 A pointer to a variable that contains the value. This variable
105 should have a lifetime equal to or longer than the validator
106 lifetime (which is usually determined by the lifetime of the
110 wxGenericValidator(wxFileName
* valPtr
);
112 Constructor taking a float pointer. This will be used for
116 A pointer to a variable that contains the value. This variable
117 should have a lifetime equal to or longer than the validator
118 lifetime (which is usually determined by the lifetime of the
122 wxGenericValidator(float* valPtr
);
124 Constructor taking a double pointer. This will be used for
128 A pointer to a variable that contains the value. This variable
129 should have a lifetime equal to or longer than the validator
130 lifetime (which is usually determined by the lifetime of the
134 wxGenericValidator(double* valPtr
);
139 virtual ~wxGenericValidator();
142 Clones the generic validator using the copy constructor.
144 virtual wxObject
* Clone() const;
147 Transfers the value from the window to the appropriate data type.
149 virtual bool TransferFromWindow();
152 Transfers the value to the window.
154 virtual bool TransferToWindow();