]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/toolbar.cpp
added wxMouseState::GetPosition(), for consistency with wxMouseEvent
[wxWidgets.git] / src / msw / toolbar.cpp
index 3bfec13c6487d4ff2d0a2db4c6b231cee58ccec6..1c30b4ffa8be7c26f1470f288edea1ec0cdf2cf0 100644 (file)
@@ -473,12 +473,11 @@ WXDWORD wxToolBar::MSWGetStyle(long style, WXDWORD *exstyle) const
 // adding/removing tools
 // ----------------------------------------------------------------------------
 
-bool wxToolBar::DoInsertTool(size_t WXUNUSED(pos), wxToolBarToolBase *tool)
+bool wxToolBar::DoInsertTool(size_t WXUNUSED(pos),
+                             wxToolBarToolBase * WXUNUSED(tool))
 {
     // nothing special to do here - we really create the toolbar buttons in
     // Realize() later
-    tool->Attach(this);
-
     InvalidateBestSize();
     return true;
 }
@@ -524,7 +523,6 @@ bool wxToolBar::DoDeleteTool(size_t pos, wxToolBarToolBase *tool)
     {
         nButtonsToDelete = ((wxToolBarTool *)tool)->GetSeparatorsCount();
         width *= nButtonsToDelete;
-        tool->GetControl()->Destroy();
     }
 
     // do delete all buttons
@@ -539,8 +537,6 @@ bool wxToolBar::DoDeleteTool(size_t pos, wxToolBarToolBase *tool)
         }
     }
 
-    tool->Detach();
-
     // and finally reposition all the controls after this button (the toolbar
     // takes care of all normal items)
     for ( /* node -> first after deleted */ ; node; node = node->GetNext() )