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 WXDLLEXPORT wxGenericValidator
: public wxValidator
21 DECLARE_CLASS(wxGenericValidator
)
23 wxGenericValidator(bool* val
);
24 wxGenericValidator(int* val
);
25 wxGenericValidator(wxString
* val
);
26 wxGenericValidator(wxArrayInt
* val
);
27 wxGenericValidator(const wxGenericValidator
& copyFrom
);
29 ~wxGenericValidator(){}
31 // Make a clone of this validator (or return NULL) - currently necessary
32 // if you're passing a reference to a validator.
33 // Another possibility is to always pass a pointer to a new validator
34 // (so the calling code can use a copy constructor of the relevant class).
35 virtual wxObject
*Clone() const { return new wxGenericValidator(*this); }
36 bool Copy(const wxGenericValidator
& val
);
38 // Called when the value in the window must be validated.
39 // This function can pop up an error message.
40 virtual bool Validate(wxWindow
* WXUNUSED(parent
)) { return true; }
42 // Called to transfer data to the window
43 virtual bool TransferToWindow();
45 // Called to transfer data to the window
46 virtual bool TransferFromWindow();
54 wxArrayInt
* m_pArrayInt
;
58 // DECLARE_NO_COPY_CLASS(wxGenericValidator)
59 // because copy constructor is explicitly declared above;
60 // but no copy assignment operator is defined, so declare
61 // it private to prevent the compiler from defining it:
62 wxGenericValidator
& operator=(const wxGenericValidator
&);