]>
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
);
103 virtual ~wxGenericValidator();
106 Clones the generic validator using the copy constructor.
108 virtual wxObject
* Clone() const;
111 Transfers the value from the window to the appropriate data type.
113 virtual bool TransferFromWindow();
116 Transfers the value to the window.
118 virtual bool TransferToWindow();