]> git.saurik.com Git - wxWidgets.git/blame - include/wx/valgen.h
compilation fix for cygwin
[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
af49c4b8 15#if defined(__GNUG__) && !defined(__APPLE__)
89c684ef
JS
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{
5cf69f76 25DECLARE_CLASS(wxGenericValidator)
89c684ef
JS
26public:
27 wxGenericValidator(bool* val);
28 wxGenericValidator(int* val);
29 wxGenericValidator(wxString* val);
30 wxGenericValidator(wxArrayInt* val);
31 wxGenericValidator(const wxGenericValidator& copyFrom);
32
33 ~wxGenericValidator();
34
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).
74e3313b 39 virtual wxObject *Clone() const { return new wxGenericValidator(*this); }
89c684ef
JS
40 bool Copy(const wxGenericValidator& val);
41
42 // Called when the value in the window must be validated.
43 // This function can pop up an error message.
74e3313b 44 virtual bool Validate(wxWindow * WXUNUSED(parent)) { return TRUE; }
89c684ef
JS
45
46 // Called to transfer data to the window
74e3313b 47 virtual bool TransferToWindow();
89c684ef
JS
48
49 // Called to transfer data to the window
74e3313b 50 virtual bool TransferFromWindow();
89c684ef
JS
51
52protected:
53 void Initialize();
54
55 bool* m_pBool;
56 int* m_pInt;
57 wxString* m_pString;
58 wxArrayInt* m_pArrayInt;
59};
60
ce4169a4
RR
61#endif
62 // wxUSE_VALIDATORS
63
64#endif
65 // _WX_VALGENH__