]> git.saurik.com Git - wxWidgets.git/commitdiff
fix for toolbar radio buttons event generation
authorVadim Zeitlin <vadim@wxwidgets.org>
Tue, 26 Mar 2002 16:23:35 +0000 (16:23 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Tue, 26 Mar 2002 16:23:35 +0000 (16:23 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14796 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/tbar95.cpp

index 721124a0aaa7c7805d587c799832b6fefe815a59..9c0ec1320949f348c253620bba430daf83dcfe89 100644 (file)
@@ -630,6 +630,8 @@ bool wxToolBar::Realize()
                             // default to be consistent with wxGTK and the menu
                             // radio items
                             button.fsState |= TBSTATE_CHECKED;
                             // default to be consistent with wxGTK and the menu
                             // radio items
                             button.fsState |= TBSTATE_CHECKED;
+
+                            tool->Toggle(TRUE);
                         }
 
                         isRadio = TRUE;
                         }
 
                         isRadio = TRUE;
@@ -829,6 +831,13 @@ bool wxToolBar::MSWCommand(WXUINT WXUNUSED(cmd), WXWORD id)
 
     bool toggled = tool->IsToggled();
 
 
     bool toggled = tool->IsToggled();
 
+    // avoid sending the event when a radio button is released, this is not
+    // interesting
+    if ( tool->CanBeToggled() && tool->GetKind() == wxITEM_RADIO && !toggled )
+    {
+        return;
+    }
+
     // OnLeftClick() can veto the button state change - for buttons which may
     // be toggled only, of couse
     if ( !OnLeftClick((int)id, toggled) && tool->CanBeToggled() )
     // OnLeftClick() can veto the button state change - for buttons which may
     // be toggled only, of couse
     if ( !OnLeftClick((int)id, toggled) && tool->CanBeToggled() )