+ return wxSize(m_maxWidth, m_maxHeight);
+}
+
+void wxToolBar::DoSetSize(int x, int y, int width, int height, int sizeFlags)
+{
+ int old_width, old_height;
+ GetSize(&old_width, &old_height);
+
+ wxToolBarBase::DoSetSize(x, y, width, height, sizeFlags);
+
+ // Correct width and height if needed.
+ if ( width == -1 || height == -1 )
+ {
+ int tmp_width, tmp_height;
+ GetSize(&tmp_width, &tmp_height);
+
+ if ( width == -1 )
+ width = tmp_width;
+ if ( height == -1 )
+ height = tmp_height;
+ }
+
+ // 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() )
+ {
+ rend->DrawHorizontalLine(dc, 0, 0, GetClientSize().x);
+ }