]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/spinctrl.cpp
just added a comment
[wxWidgets.git] / src / mac / carbon / spinctrl.cpp
index e1c2f58cbe8d59328394effe3e262e48b706153a..bbdee58bbf5492ed3f928e2c7a9b51ffa3e74ea8 100644 (file)
@@ -8,11 +8,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
 // 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
 
 
 #if wxUSE_SPINCTRL
 
@@ -55,6 +51,15 @@ protected:
         {
             m_spin->GetSpinButton()->SetValue(val);
 
         {
             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);
             // Send event that the text was manually changed
             wxCommandEvent event(wxEVT_COMMAND_TEXT_UPDATED, m_spin->GetId());
             event.SetEventObject(m_spin);