1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxGenericValidator class
6 // Created: Jan 22 1999
8 // Copyright: (c) 1999 Kevin Smith
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
15 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
16 #pragma interface "valgen.h"
19 #include "wx/validate.h"
23 class WXDLLEXPORT wxGenericValidator
: public wxValidator
25 DECLARE_CLASS(wxGenericValidator
)
27 wxGenericValidator(bool* val
);
28 wxGenericValidator(int* val
);
29 wxGenericValidator(wxString
* val
);
30 wxGenericValidator(wxArrayInt
* val
);
31 wxGenericValidator(const wxGenericValidator
& copyFrom
);
33 ~wxGenericValidator();
35 // Make a clone of this validator (or return NULL) - currently necessary
36 // if you're passing a reference to a validator.
37 // Another possibility is to always pass a pointer to a new validator
38 // (so the calling code can use a copy constructor of the relevant class).
39 virtual wxObject
*Clone() const { return new wxGenericValidator(*this); }
40 bool Copy(const wxGenericValidator
& val
);
42 // Called when the value in the window must be validated.
43 // This function can pop up an error message.
44 virtual bool Validate(wxWindow
* WXUNUSED(parent
)) { return true; }
46 // Called to transfer data to the window
47 virtual bool TransferToWindow();
49 // Called to transfer data to the window
50 virtual bool TransferFromWindow();
58 wxArrayInt
* m_pArrayInt
;
62 // DECLARE_NO_COPY_CLASS(wxGenericValidator)
63 // because copy constructor is explicitly declared above;
64 // but no copy assignment operator is defined, so declare
65 // it private to prevent the compiler from defining it:
66 wxGenericValidator
& operator=(const wxGenericValidator
&);