fixed unused param warning and code cleanup/simplification in DrawItemSelectionRect()
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38928 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -434,46 +434,30 @@ wxRendererGeneric::DrawPushButton(wxWindow *win,
|
||||
}
|
||||
|
||||
void
|
||||
wxRendererGeneric::DrawItemSelectionRect(wxWindow *win,
|
||||
wxRendererGeneric::DrawItemSelectionRect(wxWindow * WXUNUSED(win),
|
||||
wxDC& dc,
|
||||
const wxRect& rect,
|
||||
int flags )
|
||||
int flags)
|
||||
{
|
||||
if (flags & wxCONTROL_SELECTED)
|
||||
wxBrush brush;
|
||||
if ( flags & wxCONTROL_SELECTED )
|
||||
{
|
||||
if (flags & wxCONTROL_FOCUSED)
|
||||
if ( flags & wxCONTROL_FOCUSED )
|
||||
{
|
||||
wxBrush brush(
|
||||
wxSystemSettings::GetColour
|
||||
(
|
||||
wxSYS_COLOUR_HIGHLIGHT
|
||||
),
|
||||
wxSOLID
|
||||
);
|
||||
dc.SetBrush( brush );
|
||||
brush = wxBrush(wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHT));
|
||||
}
|
||||
else
|
||||
else // !focused
|
||||
{
|
||||
wxBrush brush(
|
||||
wxSystemSettings::GetColour
|
||||
(
|
||||
wxSYS_COLOUR_BTNSHADOW
|
||||
),
|
||||
wxSOLID
|
||||
);
|
||||
dc.SetBrush( brush );
|
||||
brush = wxBrush(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNSHADOW));
|
||||
}
|
||||
}
|
||||
else
|
||||
else // !selected
|
||||
{
|
||||
dc.SetBrush( *wxTRANSPARENT_BRUSH );
|
||||
brush = *wxTRANSPARENT_BRUSH;
|
||||
}
|
||||
|
||||
|
||||
if (flags & wxCONTROL_CURRENT)
|
||||
dc.SetPen( *wxBLACK_PEN );
|
||||
else
|
||||
dc.SetPen( *wxTRANSPARENT_PEN );
|
||||
dc.SetBrush(brush);
|
||||
dc.SetPen(flags & wxCONTROL_CURRENT ? *wxBLACK_PEN : *wxTRANSPARENT_PEN);
|
||||
|
||||
dc.DrawRectangle( rect );
|
||||
}
|
||||
|
Reference in New Issue
Block a user