]> git.saurik.com Git - wxWidgets.git/commitdiff
Make wxMac wxSpinCtrl emit killfocus events
authorRobert Roebling <robert@roebling.de>
Thu, 16 Oct 2008 19:19:48 +0000 (19:19 +0000)
committerRobert Roebling <robert@roebling.de>
Thu, 16 Oct 2008 19:19:48 +0000 (19:19 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56375 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/osx/carbon/window.cpp
src/osx/spinctrl_osx.cpp

index 084f7b7d6d25cd6660feb2d953feb0a931605035..64ceced9dd51efeeceff2b29a6dd209ada771d00 100644 (file)
@@ -288,6 +288,8 @@ static pascal OSStatus wxMacWindowControlEventHandler( EventHandlerCallRef handl
 #endif
 
                     wxLogTrace(_T("Focus"), _T("focus lost(%p)"), wx_static_cast(void*, thisWindow));
+                    
+                    wxPrintf( "Focus lost %s\n", thisWindow->GetClassInfo()->GetClassName() );
 
                     // remove this as soon as posting the synthesized event works properly
                     static bool inKillFocusEvent = false ;
index 3d2ed855aaa673a713e42490de7487d85c0db8a8..841b946616729721ec5b10442cf04de5b501f125 100644 (file)
@@ -60,7 +60,7 @@ public:
     }
 
 protected:
-     void OnKillFocus(wxFocusEvent& WXUNUSED(event))
+     void OnKillFocus(wxFocusEvent& event)
      {
          long l;
          if ( !GetValue().ToLong(&l) )
@@ -88,13 +88,16 @@ protected:
              m_spin->m_btn->SetValue( l );
 
              // if not
-             wxCommandEvent event(wxEVT_COMMAND_SPINCTRL_UPDATED, m_spin->GetId());
-             event.SetEventObject(m_spin);
-             event.SetInt(l);
-             m_spin->HandleWindowEvent(event);
+             wxCommandEvent cevent(wxEVT_COMMAND_SPINCTRL_UPDATED, m_spin->GetId());
+             cevent.SetEventObject(m_spin);
+             cevent.SetInt(l);
+             m_spin->HandleWindowEvent(cevent);
 
              m_spin->m_oldValue = l;
          }
+         
+         event.SetEventObject( GetParent() );
+         GetParent()->HandleWindowEvent(event);
     }
 
     void OnTextChange(wxCommandEvent& event)