Make wxMac wxSpinCtrl emit killfocus events

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56375 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
2008-10-16 19:19:48 +00:00
parent 0f278d7763
commit c016394bc2
2 changed files with 10 additions and 5 deletions

View File

@@ -288,6 +288,8 @@ static pascal OSStatus wxMacWindowControlEventHandler( EventHandlerCallRef handl
#endif #endif
wxLogTrace(_T("Focus"), _T("focus lost(%p)"), wx_static_cast(void*, thisWindow)); 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 // remove this as soon as posting the synthesized event works properly
static bool inKillFocusEvent = false ; static bool inKillFocusEvent = false ;

View File

@@ -60,7 +60,7 @@ public:
} }
protected: protected:
void OnKillFocus(wxFocusEvent& WXUNUSED(event)) void OnKillFocus(wxFocusEvent& event)
{ {
long l; long l;
if ( !GetValue().ToLong(&l) ) if ( !GetValue().ToLong(&l) )
@@ -88,13 +88,16 @@ protected:
m_spin->m_btn->SetValue( l ); m_spin->m_btn->SetValue( l );
// if not // if not
wxCommandEvent event(wxEVT_COMMAND_SPINCTRL_UPDATED, m_spin->GetId()); wxCommandEvent cevent(wxEVT_COMMAND_SPINCTRL_UPDATED, m_spin->GetId());
event.SetEventObject(m_spin); cevent.SetEventObject(m_spin);
event.SetInt(l); cevent.SetInt(l);
m_spin->HandleWindowEvent(event); m_spin->HandleWindowEvent(cevent);
m_spin->m_oldValue = l; m_spin->m_oldValue = l;
} }
event.SetEventObject( GetParent() );
GetParent()->HandleWindowEvent(event);
} }
void OnTextChange(wxCommandEvent& event) void OnTextChange(wxCommandEvent& event)