]>
git.saurik.com Git - wxWidgets.git/blob - interface/wx/valgen.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: interface of wxGenericValidator
4 // Author: wxWidgets team
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
10 @class wxGenericValidator
12 wxGenericValidator performs data transfer (but not validation or filtering)
13 for the following basic controls: wxButton, wxCheckBox, wxListBox,
14 wxStaticText, wxRadioButton, wxRadioBox, wxChoice, wxComboBox, wxGauge,
15 wxSlider, wxScrollBar, wxSpinButton, wxTextCtrl, wxCheckListBox.
17 It checks the type of the window and uses an appropriate type for that
18 window. For example, wxButton and wxTextCtrl transfer data to and from a
19 wxString variable; wxListBox uses a wxArrayInt; wxCheckBox uses a bool.
21 For more information, please see @ref overview_validator.
26 @see @ref overview_validator, wxValidator, wxTextValidator
28 class wxGenericValidator
: public wxValidator
37 wxGenericValidator(const wxGenericValidator
& validator
);
39 Constructor taking a bool pointer. This will be used for wxCheckBox,
40 wxRadioButton, wxToggleButton and wxBitmapToggleButton.
43 A pointer to a variable that contains the value. This variable
44 should have a lifetime equal to or longer than the validator
45 lifetime (which is usually determined by the lifetime of the
48 wxGenericValidator(bool* valPtr
);
50 Constructor taking a wxString pointer. This will be used for wxButton,
51 wxComboBox, wxStaticText, wxTextCtrl.
54 A pointer to a variable that contains the value. This variable
55 should have a lifetime equal to or longer than the validator
56 lifetime (which is usually determined by the lifetime of the
59 wxGenericValidator(wxString
* valPtr
);
61 Constructor taking an integer pointer. This will be used for wxChoice,
62 wxGauge, wxScrollBar, wxRadioBox, wxSlider, wxSpinButton and
66 A pointer to a variable that contains the value. This variable
67 should have a lifetime equal to or longer than the validator
68 lifetime (which is usually determined by the lifetime of the
71 wxGenericValidator(int* valPtr
);
73 Constructor taking a wxArrayInt pointer. This will be used for
74 wxListBox, wxCheckListBox.
77 A pointer to a variable that contains the value. This variable
78 should have a lifetime equal to or longer than the validator
79 lifetime (which is usually determined by the lifetime of the
82 wxGenericValidator(wxArrayInt
* valPtr
);
84 Constructor taking a wxDateTime pointer. This will be used for
88 A pointer to a variable that contains the value. This variable
89 should have a lifetime equal to or longer than the validator
90 lifetime (which is usually determined by the lifetime of the
93 wxGenericValidator(wxDateTime
* valPtr
);
98 virtual ~wxGenericValidator();
101 Clones the generic validator using the copy constructor.
103 virtual wxObject
* Clone() const;
106 Transfers the value from the window to the appropriate data type.
108 virtual bool TransferFromWindow();
111 Transfers the value to the window.
113 virtual bool TransferToWindow();