+ OnLeftClick(event.GetId(), false);
+
+ if (tool->GetKind() == wxITEM_RADIO)
+ UnToggleRadioGroup(tool);
+
+ if (tool->CanBeToggled())
+ Refresh();
+}
+
+// paints a border
+void wxButtonToolBar::OnPaint(wxPaintEvent& event)
+{
+ wxPaintDC dc(this);
+
+ for ( wxToolBarToolsList::compatibility_iterator node = m_tools.GetFirst();
+ node;
+ node = node->GetNext() )
+ {
+ wxButtonToolBarTool *tool = (wxButtonToolBarTool*) node->GetData();
+ if (tool->IsToggled())
+ {
+ wxRect rectTool = GetToolRect(tool);
+ rectTool.y = 0; rectTool.height = GetClientSize().y;
+ wxBrush brush(wxColour(220, 220, 220));
+ wxPen pen(*wxLIGHT_GREY);
+ dc.SetBrush(brush);
+ dc.SetPen(pen);
+ dc.DrawRectangle(rectTool);
+ }
+ }
+
+ if ((GetWindowStyle() & wxTB_NODIVIDER) == 0)
+ {
+ wxPen pen(*wxLIGHT_GREY);
+ dc.SetPen(pen);
+ int x1 = 0;
+ int y1 = GetClientSize().y-1;
+ int x2 = GetClientSize().x;
+ int y2 = y1;
+ dc.DrawLine(x1, y1, x2, y2);
+ }