]> git.saurik.com Git - wxWidgets.git/blob - include/wx/valgen.h
unused parameter warnings suppressed
[wxWidgets.git] / include / wx / valgen.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: valgen.h
3 // Purpose: wxGenericValidator class
4 // Author: Kevin Smith
5 // Modified by:
6 // Created: Jan 22 1999
7 // RCS-ID:
8 // Copyright: (c) 1999 Kevin Smith
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_VALGENH__
13 #define _WX_VALGENH__
14
15 #ifdef __GNUG__
16 #pragma interface "valgen.h"
17 #endif
18
19 #include "wx/validate.h"
20
21 class WXDLLEXPORT wxGenericValidator: public wxValidator
22 {
23 public:
24 wxGenericValidator(bool* val);
25 wxGenericValidator(int* val);
26 wxGenericValidator(wxString* val);
27 wxGenericValidator(wxArrayInt* val);
28 wxGenericValidator(const wxGenericValidator& copyFrom);
29
30 ~wxGenericValidator();
31
32 // Make a clone of this validator (or return NULL) - currently necessary
33 // if you're passing a reference to a validator.
34 // Another possibility is to always pass a pointer to a new validator
35 // (so the calling code can use a copy constructor of the relevant class).
36 virtual wxObject *Clone() const { return new wxGenericValidator(*this); }
37 bool Copy(const wxGenericValidator& val);
38
39 // Called when the value in the window must be validated.
40 // This function can pop up an error message.
41 virtual bool Validate(wxWindow * WXUNUSED(parent)) { return TRUE; }
42
43 // Called to transfer data to the window
44 virtual bool TransferToWindow();
45
46 // Called to transfer data to the window
47 virtual bool TransferFromWindow();
48
49 protected:
50 void Initialize();
51
52 bool* m_pBool;
53 int* m_pInt;
54 wxString* m_pString;
55 wxArrayInt* m_pArrayInt;
56 };
57
58 #endif // _WX_VALGENH__