X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/62f96636b57d44bb8f4d7a3bac482f2c8c482f82..9c34a216817028bc533e07873d047208a96b05a2:/include/wx/generic/spinctlg.h?ds=sidebyside diff --git a/include/wx/generic/spinctlg.h b/include/wx/generic/spinctlg.h index 4492bedef0..ff30a8ef9d 100644 --- a/include/wx/generic/spinctlg.h +++ b/include/wx/generic/spinctlg.h @@ -22,6 +22,8 @@ #if wxUSE_SPINBTN +#include "wx/compositewin.h" + class WXDLLIMPEXP_FWD_CORE wxSpinButton; class WXDLLIMPEXP_FWD_CORE wxTextCtrl; @@ -40,7 +42,8 @@ class wxSpinCtrlTextGeneric; // wxTextCtrl used for the wxSpinCtrlGenericBase // function ambiguity. // ---------------------------------------------------------------------------- -class WXDLLIMPEXP_CORE wxSpinCtrlGenericBase : public wxSpinCtrlBase +class WXDLLIMPEXP_CORE wxSpinCtrlGenericBase + : public wxNavigationEnabled > { public: wxSpinCtrlGenericBase() { Init(); } @@ -85,6 +88,8 @@ public: virtual void DoSetToolTip(wxToolTip *tip); #endif // wxUSE_TOOLTIPS + virtual bool SetBackgroundColour(const wxColour& colour); + // get the subcontrols wxTextCtrl *GetText() const { return m_textCtrl; } wxSpinButton *GetSpinButton() const { return m_spinButton; } @@ -105,6 +110,7 @@ public: protected: // override the base class virtuals involved into geometry calculations virtual wxSize DoGetBestSize() const; + virtual wxSize DoGetSizeFromTextSize(int xlen, int ylen = -1) const; virtual void DoMoveWindow(int x, int y, int width, int height); #ifdef __WXMSW__ @@ -156,6 +162,9 @@ private: // common part of all ctors void Init(); + // Implement pure virtual function inherited from wxCompositeWindow. + virtual wxWindowList GetCompositeWindowParts() const; + DECLARE_EVENT_TABLE() }; @@ -260,7 +269,7 @@ protected: class WXDLLIMPEXP_CORE wxSpinCtrl : public wxSpinCtrlGenericBase { public: - wxSpinCtrl() {} + wxSpinCtrl() { Init(); } wxSpinCtrl(wxWindow *parent, wxWindowID id = wxID_ANY, const wxString& value = wxEmptyString, @@ -270,6 +279,8 @@ public: int min = 0, int max = 100, int initial = 0, const wxString& name = wxT("wxSpinCtrl")) { + Init(); + Create(parent, id, value, pos, size, style, min, max, initial, name); } @@ -299,11 +310,24 @@ public: void SetRange( int minVal, int maxVal ) { DoSetRange(minVal, maxVal); } void SetIncrement(int inc) { DoSetIncrement(inc); } + virtual int GetBase() const { return m_base; } + virtual bool SetBase(int base); + protected: virtual void DoSendEvent(); virtual bool DoTextToValue(const wxString& text, double *val); virtual wxString DoValueToText(double val); + +private: + // Common part of all ctors. + void Init() + { + m_base = 10; + } + + int m_base; + DECLARE_DYNAMIC_CLASS(wxSpinCtrl) }; @@ -363,6 +387,11 @@ public: void SetIncrement(double inc) { DoSetIncrement(inc); } void SetDigits(unsigned digits); + // We don't implement bases support for floating point numbers, this is not + // very useful in practice. + virtual int GetBase() const { return 10; } + virtual bool SetBase(int WXUNUSED(base)) { return 0; } + protected: virtual void DoSendEvent();