draw solid focus rectangle in mono theme and don't do it at all for selected items (this required adding flags parameter to DrawFocusRect())
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41535 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -93,7 +93,9 @@ public:
|
||||
|
||||
|
||||
// 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
|
||||
@@ -536,8 +538,8 @@ public:
|
||||
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,
|
||||
|
@@ -38,7 +38,7 @@ public:
|
||||
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,
|
||||
|
@@ -184,7 +184,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
|
||||
@@ -615,7 +616,7 @@ void wxStdRenderer::DrawItem(wxDC& dc,
|
||||
|
||||
if ( flags & wxCONTROL_FOCUSED )
|
||||
{
|
||||
DrawFocusRect(dc, rect);
|
||||
DrawFocusRect(dc, rect, flags);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -84,7 +84,7 @@ public:
|
||||
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,
|
||||
@@ -834,7 +834,8 @@ void wxGTKRenderer::DrawSunkenBorder(wxDC& dc, 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;
|
||||
|
@@ -62,6 +62,8 @@ public:
|
||||
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,
|
||||
@@ -699,6 +701,18 @@ wxMonoRenderer::DrawVerticalLine(wxDC& dc, wxCoord x, wxCoord y1, wxCoord y2)
|
||||
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
|
||||
// ----------------------------------------------------------------------------
|
||||
|
Reference in New Issue
Block a user