X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f0e9f0d3ff8552bcbb19b323714471f06711c00e..fa8dca8dd1ba0d6ee9b2c5919a3a944ecde68a50:/src/common/tbarbase.cpp?ds=sidebyside diff --git a/src/common/tbarbase.cpp b/src/common/tbarbase.cpp index 3bb374eecb..04b15b075d 100644 --- a/src/common/tbarbase.cpp +++ b/src/common/tbarbase.cpp @@ -28,6 +28,8 @@ #pragma hdrstop #endif +#if wxUSE_TOOLBAR + #ifndef WX_PRECOMP #include "wx/wx.h" #endif @@ -39,19 +41,17 @@ #include #endif -#if wxUSE_TOOLBAR - #include "wx/tbarbase.h" // ---------------------------------------------------------------------------- // wxWindows macros // ---------------------------------------------------------------------------- -#if !USE_SHARED_LIBRARY - BEGIN_EVENT_TABLE(wxToolBarBase, wxControl) - EVT_IDLE(wxToolBarBase::OnIdle) - END_EVENT_TABLE() -#endif +IMPLEMENT_CLASS(wxToolBarBase, wxControl) + +BEGIN_EVENT_TABLE(wxToolBarBase, wxControl) + EVT_IDLE(wxToolBarBase::OnIdle) +END_EVENT_TABLE() #include "wx/listimpl.cpp" @@ -468,7 +468,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);