]> git.saurik.com Git - wxWidgets.git/commitdiff
revert togglable tools to previous state if the change was vetoed by OnLeftClick()
authorVadim Zeitlin <vadim@wxwidgets.org>
Thu, 17 Mar 2005 22:58:31 +0000 (22:58 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Thu, 17 Mar 2005 22:58:31 +0000 (22:58 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32874 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/tbar95.cpp

index 5890b3ec971bc76c793f826e98abdd84b775b276..56df126fa4f3eac1fb03e289e0f2b9271bcdff91 100644 (file)
@@ -963,8 +963,8 @@ bool wxToolBar::MSWCommand(WXUINT WXUNUSED(cmd), WXWORD id)
         LRESULT state = ::SendMessage(GetHwnd(), TB_GETSTATE, id, 0);
         toggled = (state & TBSTATE_CHECKED) != 0;
 
-        // ignore the event when a radio button is released, as this doesn't seem to
-        // happen at all, and is handled otherwise
+        // ignore the event when a radio button is released, as this doesn't
+        // seem to happen at all, and is handled otherwise
         if ( tool->GetKind() == wxITEM_RADIO && !toggled )
             return true;
 
@@ -979,7 +979,7 @@ bool wxToolBar::MSWCommand(WXUINT WXUNUSED(cmd), WXWORD id)
         // revert back
         tool->Toggle(!toggled);
 
-        ::SendMessage(GetHwnd(), TB_CHECKBUTTON, id, MAKELONG(toggled, 0));
+        ::SendMessage(GetHwnd(), TB_CHECKBUTTON, id, MAKELONG(!toggled, 0));
     }
 
     return true;