Add wxRendererNative::DrawCollapseButton() for use in collapsible pane like controls.

Add a new method that should be used for controls like wxCollapsiblePane.

It is implemented natively for wxMSW (Windows Vista+) and provides a generic fallback for other ports and WinXP.
This commit is contained in:
Tobias Taschner
2015-09-18 22:10:58 +02:00
parent 2e424fcf38
commit ef5ff89008
5 changed files with 172 additions and 1 deletions

View File

@@ -260,6 +260,17 @@ public:
const wxRect& rect,
int flags = 0) = 0;
// draw collapse button
//
// flags may use wxCONTROL_CHECKED, wxCONTROL_UNDETERMINED and wxCONTROL_CURRENT
virtual void DrawCollapseButton(wxWindow *win,
wxDC& dc,
const wxRect& rect,
int flags = 0) = 0;
// Returns the default size of a collapse button
virtual wxSize GetCollapseButtonSize(wxWindow *win, wxDC& dc) = 0;
// draw rectangle indicating that an item in e.g. a list control
// has been selected or focused
//
@@ -470,6 +481,15 @@ public:
int flags = 0)
{ m_rendererNative.DrawPushButton( win, dc, rect, flags ); }
virtual void DrawCollapseButton(wxWindow *win,
wxDC& dc,
const wxRect& rect,
int flags = 0)
{ m_rendererNative.DrawCollapseButton(win, dc, rect, flags); }
virtual wxSize GetCollapseButtonSize(wxWindow *win, wxDC& dc)
{ return m_rendererNative.GetCollapseButtonSize(win, dc); }
virtual void DrawItemSelectionRect(wxWindow *win,
wxDC& dc,
const wxRect& rect,