- // 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);
-
-
- wxEvtHandler* evtHandler = focusWin ? focusWin->GetEventHandler() : GetEventHandler() ;