+ if (m_hBitmap)
+ {
+ ::DeleteObject((HBITMAP) m_hBitmap);
+ }
+}
+
+void wxToolBar95::ClearTools()
+{
+ // TODO: Don't know how to reset the toolbar bitmap, as yet.
+ // But adding tools and calling CreateTools should probably
+ // recreate a buttonbar OK.
+ wxToolBarBase::ClearTools();
+}
+
+bool wxToolBar95::AddControl(wxControl *control)
+{
+ wxCHECK_MSG( control, FALSE, _T("toolbar: can't insert NULL control") );
+
+ wxCHECK_MSG( control->GetParent() == this, FALSE,
+ _T("control must have toolbar as parent") );
+
+ wxToolBarTool *tool = new wxToolBarTool(control);
+
+ m_tools.Append(control->GetId(), tool);
+
+ return TRUE;
+}
+
+wxToolBarTool *wxToolBar95::AddTool(int index,
+ const wxBitmap& bitmap,
+ const wxBitmap& pushedBitmap,
+ bool toggle,
+ long xPos, long yPos,
+ wxObject *clientData,
+ const wxString& helpString1,
+ const wxString& helpString2)
+{
+ wxToolBarTool *tool = new wxToolBarTool(index, bitmap, wxNullBitmap,
+ toggle, xPos, yPos,
+ helpString1, helpString2);
+ tool->m_clientData = clientData;
+
+ if (xPos > -1)
+ tool->m_x = xPos;
+ else
+ tool->m_x = m_xMargin;
+
+ if (yPos > -1)
+ tool->m_y = yPos;
+ else
+ tool->m_y = m_yMargin;
+
+ tool->SetSize(GetToolSize().x, GetToolSize().y);
+
+ m_tools.Append((long)index, tool);
+
+ return tool;