1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxGenericValidator class
6 // Created: Jan 22 1999
8 // Copyright: (c) 1999 Julian Smart (assigned from Kevin)
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
15 #include "wx/validate.h"
19 class WXDLLIMPEXP_FWD_BASE wxDateTime
;
21 class WXDLLEXPORT wxGenericValidator
: public wxValidator
23 DECLARE_CLASS(wxGenericValidator
)
25 wxGenericValidator(bool* val
);
26 wxGenericValidator(int* val
);
27 wxGenericValidator(wxString
* val
);
28 wxGenericValidator(wxArrayInt
* val
);
30 wxGenericValidator(wxDateTime
* val
);
31 #endif // wxUSE_DATETIME
32 wxGenericValidator(const wxGenericValidator
& copyFrom
);
34 virtual ~wxGenericValidator(){}
36 // Make a clone of this validator (or return NULL) - currently necessary
37 // if you're passing a reference to a validator.
38 // Another possibility is to always pass a pointer to a new validator
39 // (so the calling code can use a copy constructor of the relevant class).
40 virtual wxObject
*Clone() const { return new wxGenericValidator(*this); }
41 bool Copy(const wxGenericValidator
& val
);
43 // Called when the value in the window must be validated.
44 // This function can pop up an error message.
45 virtual bool Validate(wxWindow
* WXUNUSED(parent
)) { return true; }
47 // Called to transfer data to the window
48 virtual bool TransferToWindow();
50 // Called to transfer data to the window
51 virtual bool TransferFromWindow();
59 wxArrayInt
* m_pArrayInt
;
61 wxDateTime
* m_pDateTime
;
62 #endif // wxUSE_DATETIME
66 // DECLARE_NO_COPY_CLASS(wxGenericValidator)
67 // because copy constructor is explicitly declared above;
68 // but no copy assignment operator is defined, so declare
69 // it private to prevent the compiler from defining it:
70 wxGenericValidator
& operator=(const wxGenericValidator
&);