+
+ // We must refresh the frame size when the toolbar changes size
+ // otherwise the toolbar can be shown incorrectly
+ if ( old_width != width || old_height != height )
+ {
+ // But before we send the size event check it
+ // we have a frame that is not being deleted.
+ wxFrame *frame = wxDynamicCast(GetParent(), wxFrame);
+ if ( frame && !frame->IsBeingDeleted() )
+ {
+ frame->SendSizeEvent();
+ }
+ }
+}
+
+// ----------------------------------------------------------------------------
+// wxToolBar drawing
+// ----------------------------------------------------------------------------
+
+void wxToolBar::RefreshTool(wxToolBarToolBase *tool)
+{
+ RefreshRect(GetToolRect(tool));
+}
+
+void wxToolBar::GetRectLimits(const wxRect& rect,
+ wxCoord *start,
+ wxCoord *end) const
+{
+ wxCHECK_RET( start && end, _T("NULL pointer in GetRectLimits") );
+
+ if ( IsVertical() )
+ {
+ *start = rect.GetTop();
+ *end = rect.GetBottom();
+ }
+ else // horizontal
+ {
+ *start = rect.GetLeft();
+ *end = rect.GetRight();
+ }
+}
+
+void wxToolBar::DoDraw(wxControlRenderer *renderer)
+{
+ // prepare the variables used below
+ wxDC& dc = renderer->GetDC();
+ wxRenderer *rend = renderer->GetRenderer();
+ // dc.SetFont(GetFont()); -- uncomment when we support labels
+
+ // draw the border separating us from the menubar (if there is no menubar
+ // we probably shouldn't draw it?)
+ if ( !IsVertical() )