// draw the focus rectangle around the label contained in the given rect
- virtual void DrawFocusRect(wxDC& dc, const wxRect& rect) = 0;
+ //
+ // only wxCONTROL_SELECTED makes sense in flags here
+ virtual void DrawFocusRect(wxDC& dc, const wxRect& rect, int flags = 0) = 0;
// draw the label inside the given rectangle with the specified alignment
// and optionally emphasize the character with the given index
const wxRect& rect,
int flags)
{ m_renderer->DrawButtonSurface(dc, col, rect, flags); }
- virtual void DrawFocusRect(wxDC& dc, const wxRect& rect)
- { m_renderer->DrawFocusRect(dc, rect); }
+ virtual void DrawFocusRect(wxDC& dc, const wxRect& rect, int flags = 0)
+ { m_renderer->DrawFocusRect(dc, rect, flags); }
virtual void DrawLabel(wxDC& dc,
const wxString& label,
const wxRect& rect,
int flags);
- virtual void DrawFocusRect(wxDC& dc, const wxRect& rect);
+ virtual void DrawFocusRect(wxDC& dc, const wxRect& rect, int flags = 0);
virtual void DrawLabel(wxDC& dc,
const wxString& label,
const wxRect& 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
if ( flags & wxCONTROL_FOCUSED )
{
- DrawFocusRect(dc, rect);
+ DrawFocusRect(dc, rect, flags);
}
}
wxGTKRenderer(const wxColourScheme *scheme);
// wxRenderer methods
- virtual void DrawFocusRect(wxDC& dc, const wxRect& rect);
+ virtual void DrawFocusRect(wxDC& dc, const wxRect& rect, int flags = 0);
virtual void DrawTextBorder(wxDC& dc,
wxBorder border,
const wxRect& rect,
DrawShadedRect(dc, rect, m_penBlack, m_penLightGrey);
}
-void wxGTKRenderer::DrawFocusRect(wxDC& dc, const wxRect& rect)
+void
+wxGTKRenderer::DrawFocusRect(wxDC& dc, const wxRect& rect, int WXUNUSED(flags))
{
dc.SetBrush(*wxTRANSPARENT_BRUSH);
wxRect rectFocus = rect;
int indexAccel = -1,
wxRect *rectBounds = NULL);
+ virtual void DrawFocusRect(wxDC& dc, const wxRect& rect, int flags = 0);
+
virtual void DrawButtonBorder(wxDC& dc,
const wxRect& rect,
int flags = 0,
dc.DrawLine(x, y1, x, y2 + 1);
}
+void wxMonoRenderer::DrawFocusRect(wxDC& dc, const wxRect& rect, int flags)
+{
+ // no need to draw the focus rect for selected items, it would be invisible
+ // anyhow
+ if ( !(flags & wxCONTROL_SELECTED) )
+ {
+ dc.SetPen(m_penFg);
+ dc.SetBrush(*wxTRANSPARENT_BRUSH);
+ dc.DrawRectangle(rect);
+ }
+}
+
// ----------------------------------------------------------------------------
// label
// ----------------------------------------------------------------------------