X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/669a6e11aed1f150d1f67ed963039c4af1cd90bc..2aeec9ecccdb1b051848768f45a4ac1859ded5f3:/include/wx/generic/spinctlg.h diff --git a/include/wx/generic/spinctlg.h b/include/wx/generic/spinctlg.h index 8d791d1106..c7eb2758ef 100644 --- a/include/wx/generic/spinctlg.h +++ b/include/wx/generic/spinctlg.h @@ -21,10 +21,40 @@ class WXDLLEXPORT wxSpinCtrl : public wxTextCtrl { public: - wxSpinCtrlBase() { Init(); } + wxSpinCtrl() { Init(); } + + wxSpinCtrl(wxWindow *parent, + wxWindowID id = -1, + const wxString& value = wxEmptyString, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long style = wxSP_ARROW_KEYS, + int min = 0, int max = 100, int initial = 0, + const wxString& name = _T("wxSpinCtrl")) + { + Create(parent, id, value, pos, size, style, min, max, initial, name); + } + + bool Create(wxWindow *parent, + wxWindowID id = -1, + const wxString& value = wxEmptyString, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long style = wxSP_ARROW_KEYS, + int min = 0, int max = 100, int initial = 0, + const wxString& name = _T("wxSpinCtrl")) + { + SetRange(min, max); + + bool ok = wxTextCtrl::Create(parent, id, value, pos, size, style, + wxDefaultValidator, name); + SetValue(initial); + + return ok; + } // accessors - int GetValue() const + int GetValue(int WXUNUSED(dummy) = 1) const { int n; if ( (wxSscanf(wxTextCtrl::GetValue(), wxT("%d"), &n) != 1) ) @@ -47,6 +77,9 @@ protected: int m_min; int m_max; + +private: + DECLARE_DYNAMIC_CLASS(wxSpinCtrl) }; #endif // _WX_GENERIC_SPINCTRL_H_