]> git.saurik.com Git - wxWidgets.git/blame - include/wx/valgen.h
Made GetLabel/SetLabel() virtual
[wxWidgets.git] / include / wx / valgen.h
CommitLineData
89c684ef
JS
1/////////////////////////////////////////////////////////////////////////////
2// Name: valgen.h
3// Purpose: wxGenericValidator class
4// Author: Kevin Smith
5// Modified by:
6// Created: Jan 22 1999
ca298c88 7// RCS-ID:
89c684ef 8// Copyright: (c) 1999 Kevin Smith
74e3313b 9// Licence: wxWindows licence
89c684ef
JS
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
21class WXDLLEXPORT wxGenericValidator: public wxValidator
22{
23public:
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).
74e3313b 36 virtual wxObject *Clone() const { return new wxGenericValidator(*this); }
89c684ef
JS
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.
74e3313b 41 virtual bool Validate(wxWindow * WXUNUSED(parent)) { return TRUE; }
89c684ef
JS
42
43 // Called to transfer data to the window
74e3313b 44 virtual bool TransferToWindow();
89c684ef
JS
45
46 // Called to transfer data to the window
74e3313b 47 virtual bool TransferFromWindow();
89c684ef
JS
48
49protected:
50 void Initialize();
51
52 bool* m_pBool;
53 int* m_pInt;
54 wxString* m_pString;
55 wxArrayInt* m_pArrayInt;
56};
57
74e3313b 58#endif // _WX_VALGENH__