]> git.saurik.com Git - wxWidgets.git/blob - interface/valgen.h
change longs used for bitmap types to wxBitmapType (#9126)
[wxWidgets.git] / interface / valgen.h
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 @wxheader{valgen.h}
12
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.
17
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.
21
22 For more information, please see @ref overview_validator.
23
24 @library{wxcore}
25 @category{validator}
26
27 @see @ref overview_validator, wxValidator, wxTextValidator
28 */
29 class wxGenericValidator : public wxValidator
30 {
31 public:
32 /**
33 Copy constructor.
34
35 @param validator
36 Validator to copy.
37 */
38 wxGenericValidator(const wxGenericValidator& validator);
39 /**
40 Constructor taking a bool pointer. This will be used for wxCheckBox,
41 wxRadioButton, wxToggleButton and wxBitmapToggleButton.
42
43 @param valPtr
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
47 window).
48 */
49 wxGenericValidator(bool* valPtr);
50 /**
51 Constructor taking a wxString pointer. This will be used for wxButton,
52 wxComboBox, wxStaticText, wxTextCtrl.
53
54 @param valPtr
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
58 window).
59 */
60 wxGenericValidator(wxString* valPtr);
61 /**
62 Constructor taking an integer pointer. This will be used for wxChoice,
63 wxGauge, wxScrollBar, wxRadioBox, wxSlider, wxSpinButton and
64 wxSpinCtrl.
65
66 @param valPtr
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
70 window).
71 */
72 wxGenericValidator(int* valPtr);
73 /**
74 Constructor taking a wxArrayInt pointer. This will be used for
75 wxListBox, wxCheckListBox.
76
77 @param valPtr
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
81 window).
82 */
83 wxGenericValidator(wxArrayInt* valPtr);
84 /**
85 Constructor taking a wxDateTime pointer. This will be used for
86 wxDatePickerCtrl.
87
88 @param valPtr
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
92 window).
93 */
94 wxGenericValidator(wxDateTime* valPtr);
95
96 /**
97 Destructor.
98 */
99 ~wxGenericValidator();
100
101 /**
102 Clones the generic validator using the copy constructor.
103 */
104 virtual wxValidator* Clone() const;
105
106 /**
107 Transfers the value from the window to the appropriate data type.
108 */
109 virtual bool TransferFromWindow();
110
111 /**
112 Transfers the value to the window.
113 */
114 virtual bool TransferToWindow();
115 };
116