Implement wxRendererMac::DrawItemSelectionRect and move the generic wxTreeCtrl to using it to draw selected items.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43506 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -56,6 +56,11 @@ public:
|
||||
wxCoord position,
|
||||
wxOrientation orient,
|
||||
int flags = 0 );
|
||||
|
||||
virtual void DrawItemSelectionRect(wxWindow *win,
|
||||
wxDC& dc,
|
||||
const wxRect& rect,
|
||||
int flags = 0);
|
||||
|
||||
private:
|
||||
// the tree buttons
|
||||
@@ -341,3 +346,25 @@ void wxRendererMac::DrawSplitterSash( wxWindow *win,
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
wxRendererMac::DrawItemSelectionRect(wxWindow *win,
|
||||
wxDC& dc,
|
||||
const wxRect& rect,
|
||||
int flags )
|
||||
{
|
||||
RGBColor selColor;
|
||||
if (flags & wxCONTROL_SELECTED)
|
||||
{
|
||||
if (flags & wxCONTROL_FOCUSED)
|
||||
GetThemeBrushAsColor(kThemeBrushAlternatePrimaryHighlightColor, 32, true, &selColor);
|
||||
else
|
||||
GetThemeBrushAsColor(kThemeBrushSecondaryHighlightColor, 32, true, &selColor);
|
||||
}
|
||||
|
||||
wxBrush selBrush = wxBrush( wxColour( selColor.red, selColor.green, selColor.blue ), wxSOLID );
|
||||
|
||||
dc.SetPen( *wxTRANSPARENT_PEN );
|
||||
dc.SetBrush( selBrush );
|
||||
dc.DrawRectangle( rect );
|
||||
}
|
||||
|
Reference in New Issue
Block a user