X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2456792140d99250515d32a5b7d5a9857c993640..bf473da729e2be34f890d8b9c9af4a4143f1647b:/src/mac/carbon/spinctrl.cpp diff --git a/src/mac/carbon/spinctrl.cpp b/src/mac/carbon/spinctrl.cpp index 6e68e34316..bbdee58bbf 100644 --- a/src/mac/carbon/spinctrl.cpp +++ b/src/mac/carbon/spinctrl.cpp @@ -8,11 +8,7 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma implementation "spinctrl.h" -#endif - -#include "wx/defs.h" +#include "wx/wxprec.h" #if wxUSE_SPINCTRL @@ -55,6 +51,15 @@ protected: { m_spin->GetSpinButton()->SetValue(val); + // If we're already processing a text update from m_spin, + // don't send it again, since we could end up recursing + // infinitely. + if (event.GetId() == m_spin->GetId()) + { + event.Skip(); + return; + } + // Send event that the text was manually changed wxCommandEvent event(wxEVT_COMMAND_TEXT_UPDATED, m_spin->GetId()); event.SetEventObject(m_spin); @@ -267,6 +272,13 @@ bool wxSpinCtrl::Show(bool show) return TRUE; } +void wxSpinCtrl::SetFocus() +{ + if ( m_text != NULL) { + m_text->SetFocus(); + } +} + // ---------------------------------------------------------------------------- // value and range access // ----------------------------------------------------------------------------