#if wxUSE_STATUSBAR
// get the borders around the status bar fields (x and y fields of the
- // return value) and also, optionally, the border between the fields
- virtual wxSize GetStatusBarBorders(wxCoord *borderBetweenFields) const = 0;
+ // return value)
+ virtual wxSize GetStatusBarBorders() const = 0;
+
+ // get the border between the status bar fields
+ virtual wxCoord GetStatusBarBorderBetweenFields() const = 0;
+
+ // get the mergin between a field and its border
+ virtual wxSize GetStatusBarFieldMargins() const = 0;
#endif // wxUSE_STATUSBAR
// get client area rectangle of top level window (i.e. subtract
#endif // wxUSE_MENUS
#if wxUSE_STATUSBAR
- virtual wxSize GetStatusBarBorders(wxCoord *borderBetweenFields) const
- { return m_renderer->GetStatusBarBorders(borderBetweenFields); }
+ virtual wxSize GetStatusBarBorders() const
+ { return m_renderer->GetStatusBarBorders(); }
+ virtual wxCoord GetStatusBarBorderBetweenFields() const
+ { return m_renderer->GetStatusBarBorderBetweenFields(); }
+ virtual wxSize GetStatusBarFieldMargins() const
+ { return m_renderer->GetStatusBarFieldMargins(); }
#endif // wxUSE_STATUSBAR
+
virtual wxRect GetFrameClientArea(const wxRect& rect, int flags) const
{ return m_renderer->GetFrameClientArea(rect, flags); }
virtual wxSize GetFrameTotalSize(const wxSize& clientSize, int flags) const
const wxString& label,
int flags = 0, int style = 0);
- virtual wxSize GetStatusBarBorders(wxCoord *borderBetweenFields) const;
+ virtual wxSize GetStatusBarBorders() const;
+
+ virtual wxCoord GetStatusBarBorderBetweenFields() const;
+
+ virtual wxSize GetStatusBarFieldMargins() const;
#endif // wxUSE_STATUSBAR
virtual wxCoord GetCheckItemMargin() const { return 0; }
// no, don't do this - the borders are meant to be inside this rect
// wxSize sizeBorders =
- m_renderer->GetStatusBarBorders(borderBetweenFields);
+ if ( borderBetweenFields )
+ *borderBetweenFields = m_renderer->GetStatusBarBorderBetweenFields();
//rect.Deflate(sizeBorders.x, sizeBorders.y);
// recalc the field widths if needed
int wxStatusBarUniv::GetBorderX() const
{
- return m_renderer->GetStatusBarBorders(NULL).x;
+ return m_renderer->GetStatusBarBorders().x +
+ m_renderer->GetStatusBarFieldMargins().x;
}
int wxStatusBarUniv::GetBorderY() const
{
- return m_renderer->GetStatusBarBorders(NULL).y;
+ return m_renderer->GetStatusBarBorders().y +
+ m_renderer->GetStatusBarFieldMargins().y;
}
#endif // wxUSE_STATUSBAR
#if wxUSE_STATUSBAR
-wxSize wxStdRenderer::GetStatusBarBorders(wxCoord *borderBetweenFields) const
+wxSize wxStdRenderer::GetStatusBarBorders() const
{
- if ( borderBetweenFields )
- *borderBetweenFields = 2;
+ // Rendered border may be different depending on field's style, we use
+ // the largest value so that any field certainly fits into the borders
+ // we return:
+ wxRect raised = GetBorderDimensions(wxBORDER_RAISED);
+ wxRect flat = GetBorderDimensions(wxBORDER_STATIC);
+ wxASSERT_MSG( raised.x == raised.width && raised.y == raised.height &&
+ flat.x == flat.width && flat.y == flat.height,
+ _T("this code expects uniform borders, you must override GetStatusBarBorders") );
+
+ // take the larger of flat/raised values:
+ wxSize border(wxMax(raised.x, flat.x), wxMax(raised.y, flat.y));
+
+ return border;
+}
+wxCoord wxStdRenderer::GetStatusBarBorderBetweenFields() const
+{
+ return 2;
+}
+
+wxSize wxStdRenderer::GetStatusBarFieldMargins() const
+{
return wxSize(2, 2);
}
else if ( style != wxSB_FLAT )
DrawBorder(dc, wxBORDER_STATIC, rect, flags, &rectIn);
- rectIn.Deflate(GetStatusBarBorders(NULL));
+ rectIn.Deflate(GetStatusBarFieldMargins());
wxDCClipper clipper(dc, rectIn);
DrawLabel(dc, label, rectIn, flags, wxALIGN_LEFT | wxALIGN_CENTRE_VERTICAL);