x, item_last * m_lineHeight);
}
- bool has_focus = (FindFocus() == this);
// redraw the background for the items which are selected/current
for (unsigned int item = item_start; item < item_last; item++)
{
if (selected || item == m_currentRow)
{
int flags = selected ? (int)wxCONTROL_SELECTED : 0;
- if ((item == m_currentRow) && has_focus)
+ if (item == m_currentRow)
flags |= wxCONTROL_CURRENT;
if (m_hasFocus)
flags |= wxCONTROL_FOCUSED;
if (highlighted)
{
int flags = wxCONTROL_SELECTED;
- if (m_owner->HasFocus()
-#ifdef __WXMAC__
- && IsControlActive( (ControlRef)m_owner->GetHandle() )
-#endif
- )
+ if (m_owner->HasFocus())
flags |= wxCONTROL_FOCUSED;
wxRendererNative::Get().DrawItemSelectionRect( m_owner, *dc, rectHL, flags );
}
#include "wx/splitter.h"
#include "wx/dcmirror.h"
+#ifdef __WXMAC__
+ #include "wx/mac/private.h"
+#endif
+
// ----------------------------------------------------------------------------
// wxRendererGeneric: our wxRendererNative implementation
// ----------------------------------------------------------------------------
}
void
+#ifdef __WXMAC__
+wxRendererGeneric::DrawItemSelectionRect(wxWindow * win,
+ wxDC& dc,
+ const wxRect& rect,
+ int flags)
+#else
wxRendererGeneric::DrawItemSelectionRect(wxWindow * WXUNUSED(win),
wxDC& dc,
const wxRect& rect,
int flags)
+#endif
{
wxBrush brush;
if ( flags & wxCONTROL_SELECTED )
}
dc.SetBrush(brush);
- dc.SetPen(flags & wxCONTROL_CURRENT ? *wxBLACK_PEN : *wxTRANSPARENT_PEN);
+ if ((flags & wxCONTROL_CURRENT) && (flags & wxCONTROL_FOCUSED)
+#ifdef __WXMAC__
+ && IsControlActive( (ControlRef)win->GetHandle() )
+#endif
+ )
+ dc.SetPen( *wxBLACK_PEN );
+ else
+ dc.SetPen( *wxTRANSPARENT_PEN );
dc.DrawRectangle( rect );
}
state = GTK_STATE_NORMAL;
}
- if (flags & wxCONTROL_CURRENT)
+ if ((flags & wxCONTROL_CURRENT) && (flags & wxCONTROL_FOCUSED))
{
gtk_paint_focus( win->m_widget->style,
gdk_window,
{
if ( !(flags & wxCONTROL_SELECTED) )
return;
+
+ if (flags & wxCONTROL_FOCUSED)
+ {
+ if (!IsControlActive( (ControlRef)win->GetHandle() ))
+ flags = wxCONTROL_SELECTED;
+ }
RGBColor selColor;
GetThemeBrushAsColor(flags & wxCONTROL_FOCUSED
}
void
-wxRendererXP::DrawItemSelectionRect(wxWindow * WXUNUSED(win),
+wxRendererXP::DrawItemSelectionRect(wxWindow *win,
wxDC& dc,
const wxRect& rect,
int flags)
}
dc.SetBrush(brush);
-
- // unlike for wxRendererGeneric, on windows we _never_ want to draw
- // the outline of the rectangle:
dc.SetPen(*wxTRANSPARENT_PEN);
-
dc.DrawRectangle( rect );
+
+ if ((flags & wxCONTROL_FOCUSED) && (flags & wxCONTROL_CURRENT))
+ DrawFocusRect( win, dc, rect, flags );
}