]>
Commit | Line | Data |
---|---|---|
1 | ///////////////////////////////////////////////////////////////////////////// | |
2 | // Name: valgen.h | |
3 | // Purpose: interface of wxGenericValidator | |
4 | // Author: wxWidgets team | |
5 | // RCS-ID: $Id$ | |
6 | // Licence: wxWindows license | |
7 | ///////////////////////////////////////////////////////////////////////////// | |
8 | ||
9 | /** | |
10 | @class wxGenericValidator | |
11 | ||
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. | |
16 | ||
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. | |
20 | ||
21 | For more information, please see @ref overview_validator. | |
22 | ||
23 | @library{wxcore} | |
24 | @category{validator} | |
25 | ||
26 | @see @ref overview_validator, wxValidator, wxTextValidator | |
27 | */ | |
28 | class wxGenericValidator : public wxValidator | |
29 | { | |
30 | public: | |
31 | /** | |
32 | Copy constructor. | |
33 | ||
34 | @param validator | |
35 | Validator to copy. | |
36 | */ | |
37 | wxGenericValidator(const wxGenericValidator& validator); | |
38 | /** | |
39 | Constructor taking a bool pointer. This will be used for wxCheckBox, | |
40 | wxRadioButton, wxToggleButton and wxBitmapToggleButton. | |
41 | ||
42 | @param valPtr | |
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 | |
46 | window). | |
47 | */ | |
48 | wxGenericValidator(bool* valPtr); | |
49 | /** | |
50 | Constructor taking a wxString pointer. This will be used for wxButton, | |
51 | wxComboBox, wxStaticText, wxTextCtrl. | |
52 | ||
53 | @param valPtr | |
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 | |
57 | window). | |
58 | */ | |
59 | wxGenericValidator(wxString* valPtr); | |
60 | /** | |
61 | Constructor taking an integer pointer. This will be used for wxChoice, | |
62 | wxGauge, wxScrollBar, wxRadioBox, wxSlider, wxSpinButton and | |
63 | wxSpinCtrl. | |
64 | ||
65 | @param valPtr | |
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 | |
69 | window). | |
70 | */ | |
71 | wxGenericValidator(int* valPtr); | |
72 | /** | |
73 | Constructor taking a wxArrayInt pointer. This will be used for | |
74 | wxListBox, wxCheckListBox. | |
75 | ||
76 | @param valPtr | |
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 | |
80 | window). | |
81 | */ | |
82 | wxGenericValidator(wxArrayInt* valPtr); | |
83 | /** | |
84 | Constructor taking a wxDateTime pointer. This will be used for | |
85 | wxDatePickerCtrl. | |
86 | ||
87 | @param valPtr | |
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 | |
91 | window). | |
92 | */ | |
93 | wxGenericValidator(wxDateTime* valPtr); | |
94 | ||
95 | /** | |
96 | Destructor. | |
97 | */ | |
98 | virtual ~wxGenericValidator(); | |
99 | ||
100 | /** | |
101 | Clones the generic validator using the copy constructor. | |
102 | */ | |
103 | virtual wxObject* Clone() const; | |
104 | ||
105 | /** | |
106 | Transfers the value from the window to the appropriate data type. | |
107 | */ | |
108 | virtual bool TransferFromWindow(); | |
109 | ||
110 | /** | |
111 | Transfers the value to the window. | |
112 | */ | |
113 | virtual bool TransferToWindow(); | |
114 | }; | |
115 |