]>
Commit | Line | Data |
---|---|---|
23324ae1 FM |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: valgen.h | |
e54c96f1 | 3 | // Purpose: interface of wxGenericValidator |
23324ae1 FM |
4 | // Author: wxWidgets team |
5 | // RCS-ID: $Id$ | |
6 | // Licence: wxWindows license | |
7 | ///////////////////////////////////////////////////////////////////////////// | |
8 | ||
9 | /** | |
10 | @class wxGenericValidator | |
11 | @wxheader{valgen.h} | |
7c913512 | 12 | |
23324ae1 FM |
13 | wxGenericValidator performs data transfer (but not validation or filtering) for |
14 | the following | |
15 | basic controls: wxButton, wxCheckBox, wxListBox, wxStaticText, wxRadioButton, | |
16 | wxRadioBox, | |
17 | wxChoice, wxComboBox, wxGauge, wxSlider, wxScrollBar, wxSpinButton, wxTextCtrl, | |
18 | wxCheckListBox. | |
7c913512 | 19 | |
23324ae1 FM |
20 | It checks the type of the window and uses an appropriate type for that window. |
21 | For example, | |
22 | wxButton and wxTextCtrl transfer data to and from a wxString variable; | |
23 | wxListBox uses a | |
24 | wxArrayInt; wxCheckBox uses a bool. | |
7c913512 | 25 | |
23324ae1 FM |
26 | For more information, please see @ref overview_validatoroverview "Validator |
27 | overview". | |
7c913512 | 28 | |
23324ae1 FM |
29 | @library{wxcore} |
30 | @category{validator} | |
7c913512 | 31 | |
e54c96f1 | 32 | @see @ref overview_validatoroverview "Validator overview", wxValidator, |
23324ae1 FM |
33 | wxTextValidator |
34 | */ | |
35 | class wxGenericValidator : public wxValidator | |
36 | { | |
37 | public: | |
38 | //@{ | |
39 | /** | |
40 | Constructor taking a wxDateTime pointer. This will be | |
41 | used for wxDatePickerCtrl. | |
42 | ||
7c913512 | 43 | @param validator |
4cc4bfaf | 44 | Validator to copy. |
7c913512 | 45 | @param valPtr |
4cc4bfaf FM |
46 | A pointer to a variable that contains the value. This variable |
47 | should have a lifetime equal to or longer than the validator lifetime | |
48 | (which is usually | |
49 | determined by the lifetime of the window). | |
23324ae1 FM |
50 | */ |
51 | wxGenericValidator(const wxGenericValidator& validator); | |
7c913512 FM |
52 | wxGenericValidator(bool* valPtr); |
53 | wxGenericValidator(wxString* valPtr); | |
54 | wxGenericValidator(int* valPtr); | |
55 | wxGenericValidator(wxArrayInt* valPtr); | |
56 | wxGenericValidator(wxDateTime* valPtr); | |
23324ae1 FM |
57 | //@} |
58 | ||
59 | /** | |
60 | Destructor. | |
61 | */ | |
62 | ~wxGenericValidator(); | |
63 | ||
64 | /** | |
65 | Clones the generic validator using the copy constructor. | |
66 | */ | |
328f5751 | 67 | virtual wxValidator* Clone() const; |
23324ae1 FM |
68 | |
69 | /** | |
70 | Transfers the value from the window to the appropriate data type. | |
71 | */ | |
72 | virtual bool TransferFromWindow(); | |
73 | ||
74 | /** | |
75 | Transfers the value to the window. | |
76 | */ | |
77 | virtual bool TransferToWindow(); | |
78 | }; | |
e54c96f1 | 79 |