X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0fa8508d0c6343d11178758f00fa68ae00721809..0d5eaa50960aa239d910fc271f5282f24c0937cb:/src/mac/carbon/spinctrl.cpp diff --git a/src/mac/carbon/spinctrl.cpp b/src/mac/carbon/spinctrl.cpp index 2a2b77c91d..40e5211fbd 100644 --- a/src/mac/carbon/spinctrl.cpp +++ b/src/mac/carbon/spinctrl.cpp @@ -12,7 +12,7 @@ #pragma implementation "spinctrl.h" #endif -#include "wx/defs.h" +#include "wx/wxprec.h" #if wxUSE_SPINCTRL @@ -27,7 +27,7 @@ // the focus rect around a text may have 4 pixels in each direction // we handle these problems right now in an extended vis region of a window -static const wxCoord TEXTBORDER = 0 ; +static const wxCoord TEXTBORDER = 4 ; // the margin between the text control and the spin static const wxCoord MARGIN = 8 - TEXTBORDER; @@ -54,6 +54,13 @@ protected: if ( m_spin->GetTextValue(&val) ) { m_spin->GetSpinButton()->SetValue(val); + + // Send event that the text was manually changed + wxCommandEvent event(wxEVT_COMMAND_TEXT_UPDATED, m_spin->GetId()); + event.SetEventObject(m_spin); + event.SetInt(val); + + m_spin->GetEventHandler()->ProcessEvent(event); } event.Skip(); @@ -187,7 +194,7 @@ bool wxSpinCtrl::Create(wxWindow *parent, //SetSize(csize); - MacPostControlCreate(pos, csize); + //MacPostControlCreate(pos, csize); SetInitialBestSize(csize); return TRUE; @@ -260,6 +267,13 @@ bool wxSpinCtrl::Show(bool show) return TRUE; } +void wxSpinCtrl::SetFocus() +{ + if ( m_text != NULL) { + m_text->SetFocus(); + } +} + // ---------------------------------------------------------------------------- // value and range access // ----------------------------------------------------------------------------