]>
git.saurik.com Git - wxWidgets.git/blob - interface/valgen.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: interface of wxGenericValidator
4 // Author: wxWidgets team
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
10 @class wxGenericValidator
13 wxGenericValidator performs data transfer (but not validation or filtering)
14 for the following basic controls: wxButton, wxCheckBox, wxListBox,
15 wxStaticText, wxRadioButton, wxRadioBox, wxChoice, wxComboBox, wxGauge,
16 wxSlider, wxScrollBar, wxSpinButton, wxTextCtrl, wxCheckListBox.
18 It checks the type of the window and uses an appropriate type for that
19 window. For example, wxButton and wxTextCtrl transfer data to and from a
20 wxString variable; wxListBox uses a wxArrayInt; wxCheckBox uses a bool.
22 For more information, please see @ref overview_validator.
27 @see @ref overview_validator, wxValidator, wxTextValidator
29 class wxGenericValidator
: public wxValidator
38 wxGenericValidator(const wxGenericValidator
& validator
);
40 Constructor taking a bool pointer. This will be used for wxCheckBox,
41 wxRadioButton, wxToggleButton and wxBitmapToggleButton.
44 A pointer to a variable that contains the value. This variable
45 should have a lifetime equal to or longer than the validator
46 lifetime (which is usually determined by the lifetime of the
49 wxGenericValidator(bool* valPtr
);
51 Constructor taking a wxString pointer. This will be used for wxButton,
52 wxComboBox, wxStaticText, wxTextCtrl.
55 A pointer to a variable that contains the value. This variable
56 should have a lifetime equal to or longer than the validator
57 lifetime (which is usually determined by the lifetime of the
60 wxGenericValidator(wxString
* valPtr
);
62 Constructor taking an integer pointer. This will be used for wxChoice,
63 wxGauge, wxScrollBar, wxRadioBox, wxSlider, wxSpinButton and
67 A pointer to a variable that contains the value. This variable
68 should have a lifetime equal to or longer than the validator
69 lifetime (which is usually determined by the lifetime of the
72 wxGenericValidator(int* valPtr
);
74 Constructor taking a wxArrayInt pointer. This will be used for
75 wxListBox, wxCheckListBox.
78 A pointer to a variable that contains the value. This variable
79 should have a lifetime equal to or longer than the validator
80 lifetime (which is usually determined by the lifetime of the
83 wxGenericValidator(wxArrayInt
* valPtr
);
85 Constructor taking a wxDateTime pointer. This will be used for
89 A pointer to a variable that contains the value. This variable
90 should have a lifetime equal to or longer than the validator
91 lifetime (which is usually determined by the lifetime of the
94 wxGenericValidator(wxDateTime
* valPtr
);
99 ~wxGenericValidator();
102 Clones the generic validator using the copy constructor.
104 virtual wxValidator
* Clone() const;
107 Transfers the value from the window to the appropriate data type.
109 virtual bool TransferFromWindow();
112 Transfers the value to the window.
114 virtual bool TransferToWindow();