X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e63fdcd600e2eb717a19f9fa2895e9256e83c890..081eb1b120c1bc9147582cff84de756b4a3a63af:/src/common/tbarbase.cpp diff --git a/src/common/tbarbase.cpp b/src/common/tbarbase.cpp index 526c883fcc..93e0bab7c7 100644 --- a/src/common/tbarbase.cpp +++ b/src/common/tbarbase.cpp @@ -53,6 +53,8 @@ END_EVENT_TABLE() #endif +IMPLEMENT_CLASS(wxToolBarBase, wxControl) + #include "wx/listimpl.cpp" WX_DEFINE_LIST(wxToolBarToolsList); @@ -468,7 +470,12 @@ bool wxToolBarBase::OnLeftClick(int id, bool toggleDown) { wxCommandEvent event(wxEVT_COMMAND_TOOL_CLICKED, id); event.SetEventObject(this); - event.SetExtraLong((long) toggleDown); + + // we use SetInt() to make wxCommandEvent::IsChecked() return toggleDown + event.SetInt((int)toggleDown); + + // and SetExtraLong() for backwards compatibility + event.SetExtraLong((long)toggleDown); // Send events to this toolbar instead (and thence up the window hierarchy) GetEventHandler()->ProcessEvent(event); @@ -530,7 +537,11 @@ void wxToolBarBase::DoToolbarUpdates() while (parent->GetParent()) parent = parent->GetParent(); +#ifdef __WXMSW__ wxWindow* focusWin = wxFindFocusDescendant(parent); +#else + wxWindow* focusWin = (wxWindow*) NULL; +#endif wxEvtHandler* evtHandler = focusWin ? focusWin->GetEventHandler() : GetEventHandler() ;