]> git.saurik.com Git - wxWidgets.git/blame - include/wx/valgen.h
Added back the missing Undo/Redo accelerators that unaccountably
[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
ce4169a4
RR
21#if wxUSE_VALIDATORS
22
89c684ef
JS
23class WXDLLEXPORT wxGenericValidator: public wxValidator
24{
25public:
26 wxGenericValidator(bool* val);
27 wxGenericValidator(int* val);
28 wxGenericValidator(wxString* val);
29 wxGenericValidator(wxArrayInt* val);
30 wxGenericValidator(const wxGenericValidator& copyFrom);
31
32 ~wxGenericValidator();
33
34 // Make a clone of this validator (or return NULL) - currently necessary
35 // if you're passing a reference to a validator.
36 // Another possibility is to always pass a pointer to a new validator
37 // (so the calling code can use a copy constructor of the relevant class).
74e3313b 38 virtual wxObject *Clone() const { return new wxGenericValidator(*this); }
89c684ef
JS
39 bool Copy(const wxGenericValidator& val);
40
41 // Called when the value in the window must be validated.
42 // This function can pop up an error message.
74e3313b 43 virtual bool Validate(wxWindow * WXUNUSED(parent)) { return TRUE; }
89c684ef
JS
44
45 // Called to transfer data to the window
74e3313b 46 virtual bool TransferToWindow();
89c684ef
JS
47
48 // Called to transfer data to the window
74e3313b 49 virtual bool TransferFromWindow();
89c684ef
JS
50
51protected:
52 void Initialize();
53
54 bool* m_pBool;
55 int* m_pInt;
56 wxString* m_pString;
57 wxArrayInt* m_pArrayInt;
58};
59
ce4169a4
RR
60#endif
61 // wxUSE_VALIDATORS
62
63#endif
64 // _WX_VALGENH__