Fixed problem where kill focus event was sent to control
getting the focus. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@18946 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -242,10 +242,18 @@ void wxWindowMac::SetFocus()
|
|||||||
control->MacRedrawControl() ;
|
control->MacRedrawControl() ;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
// Without testing the window id, for some reason
|
||||||
|
// a kill focus event can still be sent to
|
||||||
|
// the control just being focussed.
|
||||||
|
int thisId = this->m_windowId;
|
||||||
|
int gFocusWindowId = gFocusWindow->m_windowId;
|
||||||
|
if (gFocusWindowId != thisId)
|
||||||
|
{
|
||||||
wxFocusEvent event(wxEVT_KILL_FOCUS, gFocusWindow->m_windowId);
|
wxFocusEvent event(wxEVT_KILL_FOCUS, gFocusWindow->m_windowId);
|
||||||
event.SetEventObject(gFocusWindow);
|
event.SetEventObject(gFocusWindow);
|
||||||
gFocusWindow->GetEventHandler()->ProcessEvent(event) ;
|
gFocusWindow->GetEventHandler()->ProcessEvent(event) ;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
gFocusWindow = this ;
|
gFocusWindow = this ;
|
||||||
{
|
{
|
||||||
#if wxUSE_CARET
|
#if wxUSE_CARET
|
||||||
|
@@ -242,10 +242,18 @@ void wxWindowMac::SetFocus()
|
|||||||
control->MacRedrawControl() ;
|
control->MacRedrawControl() ;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
// Without testing the window id, for some reason
|
||||||
|
// a kill focus event can still be sent to
|
||||||
|
// the control just being focussed.
|
||||||
|
int thisId = this->m_windowId;
|
||||||
|
int gFocusWindowId = gFocusWindow->m_windowId;
|
||||||
|
if (gFocusWindowId != thisId)
|
||||||
|
{
|
||||||
wxFocusEvent event(wxEVT_KILL_FOCUS, gFocusWindow->m_windowId);
|
wxFocusEvent event(wxEVT_KILL_FOCUS, gFocusWindow->m_windowId);
|
||||||
event.SetEventObject(gFocusWindow);
|
event.SetEventObject(gFocusWindow);
|
||||||
gFocusWindow->GetEventHandler()->ProcessEvent(event) ;
|
gFocusWindow->GetEventHandler()->ProcessEvent(event) ;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
gFocusWindow = this ;
|
gFocusWindow = this ;
|
||||||
{
|
{
|
||||||
#if wxUSE_CARET
|
#if wxUSE_CARET
|
||||||
|
Reference in New Issue
Block a user