Changed the focus-window event handling back
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2070 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -655,10 +655,7 @@ void wxFrame::Command( int id )
|
||||
bar->Check(id,!bar->Checked(id)) ;
|
||||
}
|
||||
|
||||
// Process events starting with the window with the focus, if any.
|
||||
wxWindow* focusWin = wxFindFocusDescendant(this);
|
||||
|
||||
wxEvtHandler* evtHandler = focusWin ? focusWin->GetEventHandler() : GetEventHandler();
|
||||
wxEvtHandler* evtHandler = GetEventHandler();
|
||||
|
||||
evtHandler->ProcessEvent(commandEvent);
|
||||
}
|
||||
|
@@ -169,28 +169,6 @@ bool wxToolBar::OnLeftClick( int toolIndex, bool toggleDown )
|
||||
event.SetInt( toolIndex );
|
||||
event.SetExtraLong((long) toggleDown);
|
||||
|
||||
// First try sending the command to a window that has the focus, within a frame that
|
||||
// also contains this toolbar.
|
||||
wxFrame* frame = (wxFrame*) NULL;
|
||||
wxWindow* win = this;
|
||||
wxWindow* focusWin = (wxWindow*) NULL;
|
||||
|
||||
while (win)
|
||||
{
|
||||
if (win->IsKindOf(CLASSINFO(wxFrame)))
|
||||
{
|
||||
frame = (wxFrame*) win;
|
||||
break;
|
||||
}
|
||||
else
|
||||
win = win->GetParent();
|
||||
}
|
||||
if (frame)
|
||||
focusWin = wxFindFocusDescendant(frame);
|
||||
|
||||
if (focusWin && focusWin->GetEventHandler()->ProcessEvent(event))
|
||||
return TRUE;
|
||||
|
||||
GetEventHandler()->ProcessEvent(event);
|
||||
|
||||
return TRUE;
|
||||
|
Reference in New Issue
Block a user