From: Vadim Zeitlin Date: Thu, 17 Mar 2005 22:58:31 +0000 (+0000) Subject: revert togglable tools to previous state if the change was vetoed by OnLeftClick() X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/0356c2597ec9f604918c880e3057650a7bf467f6 revert togglable tools to previous state if the change was vetoed by OnLeftClick() git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32874 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/msw/tbar95.cpp b/src/msw/tbar95.cpp index 5890b3ec97..56df126fa4 100644 --- a/src/msw/tbar95.cpp +++ b/src/msw/tbar95.cpp @@ -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;