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:
Kevin Ollivier
2006-11-19 06:28:47 +00:00
parent 5c80cef4bf
commit a4609ab847
2 changed files with 31 additions and 18 deletions

View File

@@ -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 );
}