00001
00004 #ifndef _IntegerValidator_h
00005 #define _IntegerValidator_h
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 class IntegerValidator
00021 : public wxValidator
00022 {
00023 public:
00024
00025
00034 IntegerValidator(long& rValue,
00035 long min = LONG_MIN,
00036 long max = LONG_MAX,
00037 const wxString& format = wxT("%ld"));
00038
00043 IntegerValidator(const IntegerValidator& from);
00044
00045
00048 ~IntegerValidator(void);
00049
00050
00051
00052
00053
00054
00056 virtual wxObject* Clone() const;
00057
00059 virtual bool Validate(wxWindow* pParent);
00060
00063 virtual bool TransferToWindow();
00064
00067 virtual bool TransferFromWindow();
00068
00069
00073 void OnChar(wxKeyEvent& event);
00074
00075
00076
00077
00078 protected:
00079 private:
00080 DECLARE_EVENT_TABLE()
00081
00082
00084 void ShowError(wxWindow* pParent,
00085 const wxString& message);
00086
00087 long& mrValue;
00088 const wxString mFormat;
00089 long mMin;
00090 long mMax;
00091 };
00092
00093
00094
00095
00096
00097
00098
00099 #endif // _IntegerValidator_h