git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14213
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
// Author: Vaclav Slavik
// (based on GTK & MSW implementations)
// RCS-ID: $Id$
// Author: Vaclav Slavik
// (based on GTK & MSW implementations)
// RCS-ID: $Id$
-// Copyright: (c) 2001 SciTech Software, Inc. (www.scitechsoft.com)
+// Copyright: (c) 2001-2002 SciTech Software, Inc. (www.scitechsoft.com)
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
// the window that has keyboard focus:
static wxWindowMGL *gs_focusedWindow = NULL;
// the window that has keyboard focus:
static wxWindowMGL *gs_focusedWindow = NULL;
+// the window that is about to be focused after currently focused
+// one looses focus:
+static wxWindow *gs_toBeFocusedWindow = NULL;
// the window that is currently under mouse cursor:
static wxWindowMGL *gs_windowUnderMouse = NULL;
// the window that has mouse capture
// the window that is currently under mouse cursor:
static wxWindowMGL *gs_windowUnderMouse = NULL;
// the window that has mouse capture
{
if ( gs_focusedWindow == this ) return;
{
if ( gs_focusedWindow == this ) return;
+ wxWindowMGL *oldFocusedWindow = gs_focusedWindow;
+
+ {
+ gs_toBeFocusedWindow = (wxWindow*)this;
gs_focusedWindow->KillFocus();
gs_focusedWindow->KillFocus();
+ gs_toBeFocusedWindow = NULL;
+ }
wxFocusEvent event(wxEVT_SET_FOCUS, GetId());
event.SetEventObject(this);
wxFocusEvent event(wxEVT_SET_FOCUS, GetId());
event.SetEventObject(this);
+ event.SetWindow((wxWindow*)oldFocusedWindow);
GetEventHandler()->ProcessEvent(event);
#if wxUSE_CARET
GetEventHandler()->ProcessEvent(event);
#if wxUSE_CARET
wxFocusEvent event(wxEVT_KILL_FOCUS, GetId());
event.SetEventObject(this);
wxFocusEvent event(wxEVT_KILL_FOCUS, GetId());
event.SetEventObject(this);
+ event.SetWindow(gs_toBeFocusedWindow);
GetEventHandler()->ProcessEvent(event);
}
GetEventHandler()->ProcessEvent(event);
}