From: Robert Roebling Date: Thu, 16 Oct 2008 19:19:48 +0000 (+0000) Subject: Make wxMac wxSpinCtrl emit killfocus events X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/c016394bc2c558f2e59bbb2b99ecc4df87730bd9?ds=sidebyside Make wxMac wxSpinCtrl emit killfocus events git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56375 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/osx/carbon/window.cpp b/src/osx/carbon/window.cpp index 084f7b7d6d..64ceced9dd 100644 --- a/src/osx/carbon/window.cpp +++ b/src/osx/carbon/window.cpp @@ -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 ; diff --git a/src/osx/spinctrl_osx.cpp b/src/osx/spinctrl_osx.cpp index 3d2ed855aa..841b946616 100644 --- a/src/osx/spinctrl_osx.cpp +++ b/src/osx/spinctrl_osx.cpp @@ -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)