00001
00007 #ifndef _DoubleValidator_h
00008 #define _DoubleValidator_h
00009
00010
00011
00012
00013
00014
00015 #include <wx/validate.h>
00016
00017
00018
00019
00020
00021
00022
00023
00024 class DoubleValidator
00025 : public wxValidator
00026 {
00027 public:
00028
00029
00030
00033 DoubleValidator(double& rValue, const wxString& format = wxT("%.6g"));
00034
00039 DoubleValidator(const DoubleValidator& from);
00040
00043 ~DoubleValidator(void);
00044
00045
00046
00047
00048
00049
00050 virtual wxObject* Clone() const;
00051
00052 virtual bool TransferToWindow();
00053
00054 virtual bool TransferFromWindow();
00055
00056 virtual bool Validate(wxWindow* pParent);
00057
00058 void OnChar(wxKeyEvent& event);
00059
00060
00061
00062 protected:
00063 private:
00064 double& mrValue;
00065 const wxString mFormat;
00066
00067 static wxChar mDecimalSeparator;
00068
00069 DECLARE_EVENT_TABLE()
00070
00071 wxChar DiscoverDecimalSeparator() const;
00072 };
00073
00074
00075
00076
00077
00078
00079
00080 #endif // _DoubleValidator_h