]> git.saurik.com Git - wxWidgets.git/blob - interface/valgen.h
non owned window implementation
[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) for
14 the following
15 basic controls: wxButton, wxCheckBox, wxListBox, wxStaticText, wxRadioButton,
16 wxRadioBox,
17 wxChoice, wxComboBox, wxGauge, wxSlider, wxScrollBar, wxSpinButton, wxTextCtrl,
18 wxCheckListBox.
19
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.
25
26 For more information, please see @ref overview_validatoroverview "Validator
27 overview".
28
29 @library{wxcore}
30 @category{validator}
31
32 @see @ref overview_validatoroverview "Validator overview", wxValidator,
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
43 @param validator
44 Validator to copy.
45 @param valPtr
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).
50 */
51 wxGenericValidator(const wxGenericValidator& validator);
52 wxGenericValidator(bool* valPtr);
53 wxGenericValidator(wxString* valPtr);
54 wxGenericValidator(int* valPtr);
55 wxGenericValidator(wxArrayInt* valPtr);
56 wxGenericValidator(wxDateTime* valPtr);
57 //@}
58
59 /**
60 Destructor.
61 */
62 ~wxGenericValidator();
63
64 /**
65 Clones the generic validator using the copy constructor.
66 */
67 virtual wxValidator* Clone() const;
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 };
79