fix compile against newer giflib
[rofl0r-obeditor.git] / src / common__validators.h
blobd536c9eab95b508e03e98b04b0f958c1abd71b9f
1 /*
2 * common__validators.h
4 * Created on: 27 avr. 2009
5 * Author: pat
6 */
8 #ifndef COMMON__VALIDATORS_H_
9 #define COMMON__VALIDATORS_H_
11 #include <wx/wxprec.h>
12 #include <wx/validate.h>
15 //******************************
16 // Validator which only allow a set of characters
18 class wxValidator_Restrict : public wxValidator
20 public:
21 wxValidator_Restrict( const wxString& _only_those, wxString* valPtr = NULL );
22 wxValidator_Restrict(const wxValidator_Restrict& from);
24 DECLARE_EVENT_TABLE();
26 private:
27 wxString only_those;
28 wxString* valPtr;
30 wxObject* Clone() const;
31 bool Validate(wxWindow* parent);
32 bool TransferToWindow();
33 bool TransferFromWindow();
34 bool CharAccepted( int kc );
36 void OnChar(wxKeyEvent& event);
41 //******************************
42 // Validator which only allow a set of characters
44 class wxValidator_Restrict_Range : public wxValidator
46 public:
47 wxValidator_Restrict_Range(wxChar _from_here, wxChar _to_here, wxString* valPtr = NULL );
48 wxValidator_Restrict_Range(const wxValidator_Restrict_Range& from);
50 DECLARE_EVENT_TABLE();
52 private:
53 wxChar from_here;
54 wxChar to_here;
55 wxString* valPtr;
57 wxObject* Clone() const;
58 bool Validate(wxWindow* parent);
59 bool TransferToWindow();
60 bool TransferFromWindow();
61 bool CharAccepted( int kc );
63 void OnChar(wxKeyEvent& event);
73 //******************************
74 // Validator which not allow White spaces
76 class wxTextValidator_NoWhiteSpace : public wxValidator
78 public:
79 wxTextValidator_NoWhiteSpace( wxString* valPtr = NULL );
80 wxTextValidator_NoWhiteSpace(const wxTextValidator_NoWhiteSpace& from);
82 DECLARE_EVENT_TABLE();
84 private:
85 wxString* valPtr;
87 wxObject* Clone() const;
88 bool Validate(wxWindow* parent);
89 bool TransferToWindow();
90 bool TransferFromWindow();
92 void OnChar(wxKeyEvent& event);
97 //******************************
100 class wxValidatorIntegerRelative : public wxValidator
102 public:
103 wxValidatorIntegerRelative( wxString* valPtr = NULL );
104 wxValidatorIntegerRelative(const wxValidatorIntegerRelative& from);
106 DECLARE_EVENT_TABLE();
108 protected:
109 wxString* valPtr;
111 wxObject* Clone() const;
112 bool Validate(wxWindow* parent);
113 bool TransferToWindow();
114 bool TransferFromWindow();
116 void OnChar(wxKeyEvent& event);
121 //******************************
124 class wxValidatorIntegerNegative : public wxValidatorIntegerRelative
126 public:
127 wxValidatorIntegerNegative( wxString* valPtr = NULL );
128 wxValidatorIntegerNegative(const wxValidatorIntegerNegative& from);
130 DECLARE_EVENT_TABLE();
131 void OnChar( wxKeyEvent& event );
133 protected:
134 wxObject* Clone() const;
135 bool Validate(wxWindow* parent);
140 //******************************
143 class wxValidatorFloat : public wxValidator
145 public:
146 wxValidatorFloat( wxString* valPtr = NULL );
147 wxValidatorFloat(const wxValidatorFloat& from);
149 DECLARE_EVENT_TABLE();
151 protected:
152 wxString* valPtr;
154 wxObject* Clone() const;
155 bool Validate(wxWindow* parent);
156 bool TransferToWindow();
157 bool TransferFromWindow();
159 void OnChar(wxKeyEvent& event);
164 //******************************
167 class wxValidatorFloatPositive : public wxValidatorFloat
169 public:
170 wxValidatorFloatPositive( wxString* valPtr = NULL );
171 wxValidatorFloatPositive(const wxValidatorFloatPositive& from);
173 DECLARE_EVENT_TABLE();
175 protected:
176 wxString* valPtr;
178 wxObject* Clone() const;
179 bool Validate(wxWindow* parent);
180 bool TransferToWindow();
181 bool TransferFromWindow();
183 void OnChar(wxKeyEvent& event);
187 #endif /* COMMON__VALIDATORS_H_ */