Added wxRenderer method for drawing selection

rect if an item in a list has ben selected.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38921 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
2006-04-26 10:48:52 +00:00
parent e4db172a3b
commit daebb44c74
5 changed files with 151 additions and 37 deletions

View File

@@ -88,6 +88,11 @@ public:
const wxRect& rect,
int flags = 0);
virtual void DrawItemSelectionRect(wxWindow *win,
wxDC& dc,
const wxRect& rect,
int flags = 0);
virtual wxSplitterRenderParams GetSplitterParams(const wxWindow *win);
private:
@@ -505,3 +510,43 @@ wxRendererGTK::DrawPushButton(wxWindow *win,
rect.x, rect.y, rect.width, rect.height
);
}
void
wxRendererGTK::DrawItemSelectionRect(wxWindow *win,
wxDC& dc,
const wxRect& rect,
int flags )
{
// for reason why we do this, see DrawDropArrow
wxWindowDC& wdc = (wxWindowDC&)dc;
wxASSERT ( wdc.IsKindOf(CLASSINFO(wxWindowDC)) );
GtkStateType state;
if (flags & wxCONTROL_SELECTED)
{
if (flags & wxCONTROL_FOCUSED)
state = GTK_STATE_SELECTED;
else
state = GTK_STATE_INSENSITIVE;
gtk_paint_flat_box( win->m_wxwindow->style,
GTK_PIZZA(win->m_wxwindow)->bin_window,
state,
GTK_SHADOW_NONE,
NULL,
win->m_wxwindow,
"treeview",
dc.LogicalToDeviceX(rect.x),
dc.LogicalToDeviceY(rect.y),
rect.width,
rect.height );
}
if (flags & wxCONTROL_CURRENT)
{
dc.SetPen( *wxBLACK_PEN );
dc.SetBrush( *wxTRANSPARENT_BRUSH );
dc.DrawRectangle( rect );
}
}