]>
git.saurik.com Git - wxWidgets.git/blob - interface/wx/valgen.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: interface of wxGenericValidator
4 // Author: wxWidgets team
5 // Licence: wxWindows licence
6 /////////////////////////////////////////////////////////////////////////////
9 @class wxGenericValidator
11 wxGenericValidator performs data transfer (but not validation or filtering)
12 for many type of controls.
14 wxGenericValidator supports:
15 - wxButton, wxRadioButton, wxToggleButton, wxBitmapToggleButton, wxSpinButton
16 - wxCheckBox, wxRadioBox, wxComboBox, wxListBox, wxCheckListBox
17 - wxGauge, wxSlider, wxScrollBar, wxChoice, wxStaticText
18 - wxSpinCtrl, wxTextCtrl
20 It checks the type of the window and uses an appropriate type for it.
21 For example, wxButton and wxTextCtrl transfer data to and from a
22 wxString variable; wxListBox uses a wxArrayInt; wxCheckBox uses a boolean.
24 For more information, please see @ref overview_validator.
29 @see @ref overview_validator, wxValidator, wxTextValidator,
30 wxIntegerValidator, wxFloatingPointValidator
32 class wxGenericValidator
: public wxValidator
41 wxGenericValidator(const wxGenericValidator
& validator
);
43 Constructor taking a bool pointer. This will be used for wxCheckBox,
44 wxRadioButton, wxToggleButton and wxBitmapToggleButton.
47 A pointer to a variable that contains the value. This variable
48 should have a lifetime equal to or longer than the validator
49 lifetime (which is usually determined by the lifetime of the
52 wxGenericValidator(bool* valPtr
);
54 Constructor taking a wxString pointer. This will be used for wxButton,
55 wxComboBox, wxStaticText, wxTextCtrl.
58 A pointer to a variable that contains the value. This variable
59 should have a lifetime equal to or longer than the validator
60 lifetime (which is usually determined by the lifetime of the
63 wxGenericValidator(wxString
* valPtr
);
65 Constructor taking an integer pointer. This will be used for wxChoice,
66 wxGauge, wxScrollBar, wxRadioBox, wxSlider, wxSpinButton and
70 A pointer to a variable that contains the value. This variable
71 should have a lifetime equal to or longer than the validator
72 lifetime (which is usually determined by the lifetime of the
75 wxGenericValidator(int* valPtr
);
77 Constructor taking a wxArrayInt pointer. This will be used for
78 wxListBox, wxCheckListBox.
81 A pointer to a variable that contains the value. This variable
82 should have a lifetime equal to or longer than the validator
83 lifetime (which is usually determined by the lifetime of the
86 wxGenericValidator(wxArrayInt
* valPtr
);
88 Constructor taking a wxDateTime pointer. This will be used for
92 A pointer to a variable that contains the value. This variable
93 should have a lifetime equal to or longer than the validator
94 lifetime (which is usually determined by the lifetime of the
97 wxGenericValidator(wxDateTime
* valPtr
);
99 Constructor taking a wxFileName pointer. This will be used for
103 A pointer to a variable that contains the value. This variable
104 should have a lifetime equal to or longer than the validator
105 lifetime (which is usually determined by the lifetime of the
109 wxGenericValidator(wxFileName
* valPtr
);
111 Constructor taking a float pointer. This will be used for
115 A pointer to a variable that contains the value. This variable
116 should have a lifetime equal to or longer than the validator
117 lifetime (which is usually determined by the lifetime of the
121 wxGenericValidator(float* valPtr
);
123 Constructor taking a double pointer. This will be used for
127 A pointer to a variable that contains the value. This variable
128 should have a lifetime equal to or longer than the validator
129 lifetime (which is usually determined by the lifetime of the
133 wxGenericValidator(double* valPtr
);
138 virtual ~wxGenericValidator();
141 Clones the generic validator using the copy constructor.
143 virtual wxObject
* Clone() const;
146 Transfers the value from the window to the appropriate data type.
148 virtual bool TransferFromWindow();
151 Transfers the value to the window.
153 virtual bool TransferToWindow();