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
// ============================================================================
// 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);
}
}