event.SetEventObject(this);
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;
-
// Send events to this toolbar instead (and thence up the window hierarchy)
GetEventHandler()->ProcessEvent(event);
void wxToolBarBase::AddSeparator ()
{
wxToolBarTool *tool = new wxToolBarTool;
+ tool->m_index = -1;
tool->m_toolStyle = wxTOOL_STYLE_SEPARATOR;
m_tools.Append(-1, tool);
}
// Do the toolbar button updates (check for EVT_UPDATE_UI handlers)
void wxToolBarBase::DoToolbarUpdates()
{
- // 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() ;
+ wxEvtHandler* evtHandler = GetEventHandler() ;
wxNode* node = GetTools().First();
while (node)