X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9a83f860948059b0273b5cc6d9e43fadad3ebfca..ff534ba469473a9ace193e736ca131144df307f9:/src/osx/spinctrl_osx.cpp diff --git a/src/osx/spinctrl_osx.cpp b/src/osx/spinctrl_osx.cpp index 1e56099b01..acd16fac55 100644 --- a/src/osx/spinctrl_osx.cpp +++ b/src/osx/spinctrl_osx.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: src/osx/carbon/spinbutt.cpp +// Name: src/osx/spinctrl_osx.cpp // Purpose: wxSpinCtrl // Author: Robert // Modified by: Mark Newsam (Based on GTK file) @@ -196,15 +196,6 @@ BEGIN_EVENT_TABLE(wxSpinCtrlButton, wxSpinButton) EVT_SPIN(wxID_ANY, wxSpinCtrlButton::OnSpinButton) END_EVENT_TABLE() -IMPLEMENT_DYNAMIC_CLASS(wxSpinCtrl, wxControl) - -BEGIN_EVENT_TABLE(wxSpinCtrl, wxControl) - WX_EVENT_TABLE_CONTROL_CONTAINER(wxSpinCtrl) -END_EVENT_TABLE() - -WX_DELEGATE_TO_CONTROL_CONTAINER(wxSpinCtrl, wxControl) - - // ============================================================================ // implementation // ============================================================================ @@ -217,7 +208,6 @@ void wxSpinCtrl::Init() { m_text = NULL; m_btn = NULL; - WX_INIT_CONTROL_CONTAINER(); } bool wxSpinCtrl::Create(wxWindow *parent, @@ -231,7 +221,6 @@ bool wxSpinCtrl::Create(wxWindow *parent, int initial, const wxString& name) { - m_macIsUserPane = true; if ( !wxControl::Create(parent, id, pos, size, style, wxDefaultValidator, name) ) { @@ -281,10 +270,8 @@ wxSpinCtrl::~wxSpinCtrl() // delete the controls now, don't leave them alive even though they would // still be eventually deleted by our parent - but it will be too late, the // user code expects them to be gone now - delete m_text; - m_text = NULL ; - delete m_btn; - m_btn = NULL ; + wxDELETE(m_text); + wxDELETE(m_btn); } // ---------------------------------------------------------------------------- @@ -333,6 +320,8 @@ bool wxSpinCtrl::Enable(bool enable) { if ( !wxControl::Enable(enable) ) return false; + m_text->Enable(enable); + m_btn->Enable(enable); return true; } @@ -395,6 +384,8 @@ void wxSpinCtrl::SetTextValue(int val) // select all text m_text->SetSelection(0, -1); + m_text->SetInsertionPointEnd(); + // and give focus to the control! // m_text->SetFocus(); Why???? TODO. }