]> git.saurik.com Git - wxWidgets.git/blobdiff - src/univ/stdrend.cpp
Several wxBitmapDataCell changes.
[wxWidgets.git] / src / univ / stdrend.cpp
index 147fcd0639fd037adf01c7451eb8a9d376df3872..4b25de77001c5f008dbbbc337d5632316808ab50 100644 (file)
@@ -42,6 +42,9 @@ static const int FRAME_TITLEBAR_HEIGHT             = 18;
 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
 // ============================================================================
@@ -184,7 +187,8 @@ void wxStdRenderer::DrawButtonSurface(wxDC& dc,
 // 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
@@ -482,7 +486,7 @@ bool wxStdRenderer::AreScrollbarsInsideBorder() const
 
 wxCoord wxStdRenderer::GetListboxItemHeight(wxCoord fontHeight)
 {
-    return fontHeight + 2;
+    return fontHeight + 2*ITEM_MARGIN;
 }
 
 void wxStdRenderer::DrawTextBorder(wxDC& dc,
@@ -608,14 +612,14 @@ void wxStdRenderer::DrawItem(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);
     }
 }