]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/tbar95.cpp
Add comment explaining the role of wxMacExecute
[wxWidgets.git] / src / msw / tbar95.cpp
index 491dafd1782210bc57fff5ffd518a82c72be21ee..7ea83bd343b65db73824bd93083091830e1092d1 100644 (file)
@@ -875,7 +875,30 @@ bool wxToolBar::Realize()
                             // radio items
                             button.fsState |= TBSTATE_CHECKED;
 
-                            tool->Toggle(true);
+                            if (tool->Toggle(true))
+                            {
+                                DoToggleTool(tool, true);
+                            }
+                        }
+                        else if (tool->IsToggled())
+                        {
+                            wxToolBarToolsList::compatibility_iterator nodePrev = node->GetPrevious();
+                            int prevIndex = i - 1;
+                            while ( nodePrev )
+                            {
+                                TBBUTTON& prevButton = buttons[prevIndex];
+                                wxToolBarToolBase *tool = nodePrev->GetData();
+                                if ( !tool->IsButton() || tool->GetKind() != wxITEM_RADIO )
+                                    break;
+                                
+                                if ( tool->Toggle(false) )
+                                {
+                                    DoToggleTool(tool, false);
+                                }
+                                prevButton.fsState = TBSTATE_ENABLED;
+                                nodePrev = nodePrev->GetPrevious();
+                                prevIndex--;
+                            }                            
                         }
 
                         isRadio = true;