X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/845a6bbf743a33a1975827f517fbd667c13ef6ac..a4f6fe43c33bd7933645d110ad2719871dab043d:/include/wx/gtk/spinctrl.h?ds=sidebyside diff --git a/include/wx/gtk/spinctrl.h b/include/wx/gtk/spinctrl.h index 53649b59ec..8890030a4b 100644 --- a/include/wx/gtk/spinctrl.h +++ b/include/wx/gtk/spinctrl.h @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: spinctrl.h +// Name: wx/gtk/spinctrl.h // Purpose: wxSpinCtrl class // Author: Robert Roebling // Modified by: @@ -73,13 +73,13 @@ protected: void GtkEnableEvents() const; virtual wxSize DoGetBestSize() const; + virtual wxSize DoGetSizeFromTextSize(int xlen, int ylen = -1) const; virtual GdkWindow *GTKGetWindow(wxArrayGdkWindows& windows) const; // Widgets that use the style->base colour for the BG colour should // override this and return true. virtual bool UseGTKStyleBase() const { return true; } - DECLARE_DYNAMIC_CLASS(wxSpinCtrlGTKBase) DECLARE_EVENT_TABLE() }; @@ -90,7 +90,7 @@ protected: class WXDLLIMPEXP_CORE wxSpinCtrl : public wxSpinCtrlGTKBase { public: - wxSpinCtrl() {} + wxSpinCtrl() { Init(); } wxSpinCtrl(wxWindow *parent, wxWindowID id = wxID_ANY, const wxString& value = wxEmptyString, @@ -100,6 +100,8 @@ public: int min = 0, int max = 100, int initial = 0, const wxString& name = wxS("wxSpinCtrl")) { + Init(); + Create(parent, id, value, pos, size, style, min, max, initial, name); } @@ -117,16 +119,28 @@ public: } // accessors - int GetValue() const { return wxRound( DoGetValue() ); } - int GetMin() const { return wxRound( DoGetMin() ); } - int GetMax() const { return wxRound( DoGetMax() ); } - int GetIncrement() const { return wxRound( DoGetIncrement() ); } + int GetValue() const { return int(DoGetValue()); } + int GetMin() const { return int(DoGetMin()); } + int GetMax() const { return int(DoGetMax()); } + int GetIncrement() const { return int(DoGetIncrement()); } // operations void SetValue(const wxString& value) { wxSpinCtrlGTKBase::SetValue(value); } // visibility problem w/ gcc void SetValue( int value ) { DoSetValue(value); } void SetRange( int minVal, int maxVal ) { DoSetRange(minVal, maxVal); } - void SetIncrement( double inc ) { DoSetIncrement(inc); } + void SetIncrement(int inc) { DoSetIncrement(inc); } + + virtual int GetBase() const { return m_base; } + virtual bool SetBase(int base); + +private: + // Common part of all ctors. + void Init() + { + m_base = 10; + } + + int m_base; DECLARE_DYNAMIC_CLASS(wxSpinCtrl) }; @@ -181,6 +195,9 @@ public: void SetIncrement(double inc) { DoSetIncrement(inc); } void SetDigits(unsigned digits); + virtual int GetBase() const { return 10; } + virtual bool SetBase(int WXUNUSED(base)) { return false; } + DECLARE_DYNAMIC_CLASS(wxSpinCtrlDouble) };