+ dc.SetFont(GetFont());
+ dc.SetBackgroundMode(wxTRANSPARENT);
+
+ for ( wxToolBarToolsList::compatibility_iterator node = m_tools.GetFirst();
+ node;
+ node = node->GetNext() )
+ {
+ wxButtonToolBarTool *tool = (wxButtonToolBarTool*) node->GetData();
+ wxRect rectTool = GetToolRect(tool);
+ if (tool->IsToggled())
+ {
+ wxRect backgroundRect = rectTool;
+ backgroundRect.y = -1; backgroundRect.height = GetClientSize().y + 1;
+ wxBrush brush(wxColour(219, 219, 219));
+ wxPen pen(wxColour(159, 159, 159));
+ dc.SetBrush(brush);
+ dc.SetPen(pen);
+ dc.DrawRectangle(backgroundRect);
+ }
+
+ if (m_labelHeight > 0 && !tool->GetShortHelp().empty())
+ {
+ int tw, th;
+ dc.GetTextExtent(tool->GetShortHelp(), & tw, & th);
+
+ int x = tool->m_x;
+ dc.DrawText(tool->GetShortHelp(), x, tool->m_y + tool->GetButton()->GetSize().y + m_labelMargin);
+ }
+ }
+
+ if ((GetWindowStyle() & wxTB_NODIVIDER) == 0)
+ {
+ wxPen pen(wxColour(159, 159, 159));
+ dc.SetPen(pen);
+ int x1 = 0;
+ int y1 = GetClientSize().y-1;
+ int x2 = GetClientSize().x;
+ int y2 = y1;
+ dc.DrawLine(x1, y1, x2, y2);
+ }
+}
+
+// detects mouse clicks outside buttons
+void wxButtonToolBar::OnLeftUp(wxMouseEvent& event)
+{
+ if (m_labelHeight > 0)
+ {
+ wxButtonToolBarTool* tool = (wxButtonToolBarTool*) FindToolForPosition(event.GetX(), event.GetY());
+ if (tool && tool->GetButton() && (event.GetY() > (tool->m_y + tool->GetButton()->GetSize().y)))
+ {
+ wxCommandEvent event(wxEVT_BUTTON, tool->GetId());
+ event.SetEventObject(tool->GetButton());
+ if (!GetEventHandler()->ProcessEvent(event))
+ event.Skip();
+ }
+ }
+}
+
+#endif // wxUSE_TOOLBAR && wxUSE_BMPBUTTON