]> git.saurik.com Git - wxWidgets.git/commitdiff
wxCommandEvent::IsChecked() now returns the toolbar button checked status as well
authorVadim Zeitlin <vadim@wxwidgets.org>
Tue, 22 May 2001 14:02:17 +0000 (14:02 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Tue, 22 May 2001 14:02:17 +0000 (14:02 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10269 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/tbarbase.cpp

index d904ff91949b1412732f40df617a08c293fc47f7..93e0bab7c7d989db72edcfb6ff2a02016dc074fa 100644 (file)
@@ -470,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);