static const int FRAME_BUTTON_WIDTH = 16;
static const int FRAME_BUTTON_HEIGHT = 14;
+// the margin between listbox item text and its rectangle
+static const int ITEM_MARGIN = 1;
+
// ============================================================================
// wxStdRenderer implementation
// ============================================================================
int WXUNUSED(flags),
wxWindow *window)
{
- wxColour colBg = col.Ok() ? col
- : window ? m_scheme->GetBackground(window)
- : wxSCHEME_COLOUR(m_scheme, CONTROL);
+ wxColour colBg;
+
+ if (col.Ok())
+ {
+ colBg = col;
+ }
+ else if (window)
+ {
+ colBg = m_scheme->GetBackground(window);
+ }
+ else
+ {
+ colBg = wxSCHEME_COLOUR(m_scheme, CONTROL);
+ }
DrawSolidRect(dc, colBg, rect);
}
// text
// ----------------------------------------------------------------------------
-void wxStdRenderer::DrawFocusRect(wxDC& dc, const wxRect& rect)
+void
+wxStdRenderer::DrawFocusRect(wxDC& dc, const wxRect& rect, int WXUNUSED(flags))
{
// draw the pixels manually because the "dots" in wxPen with wxDOT style
// may be short traits and not really dots
wxCoord wxStdRenderer::GetListboxItemHeight(wxCoord fontHeight)
{
- return fontHeight + 2;
+ return fontHeight + 2*ITEM_MARGIN;
}
void wxStdRenderer::DrawTextBorder(wxDC& dc,
dc.DrawRectangle(rect);
}
+ // horizontal adjustment is arbitrary
wxRect rectText = rect;
- rectText.x += 2;
- rectText.width -= 2;
+ rectText.Deflate(2, ITEM_MARGIN);
dc.DrawLabel(label, wxNullBitmap, rectText);
if ( flags & wxCONTROL_FOCUSED )
{
- DrawFocusRect(dc, rect);
+ DrawFocusRect(dc, rect, flags);
}
}