Add wxRendererNative::DrawItemText() for list-like controls

Add a new method that should be used for drawing the elements of list-like
controls (i.e. wx{List,Tree,DataView}Ctrl and similar).

Implement it for wxMSW natively and provide a straightforward generic fallback
for the other ports.

See #16414.
This commit is contained in:
Tobias Taschner
2015-09-17 14:38:03 +02:00
committed by Vadim Zeitlin
parent ba4bfc5414
commit b7a89f8746
8 changed files with 189 additions and 0 deletions

View File

@@ -329,6 +329,14 @@ public:
int max,
int flags = 0) = 0;
// Draw text using the appropriate color for normal and selected states.
virtual void DrawItemText(wxWindow* win,
wxDC& dc,
const wxString& text,
const wxRect& rect,
int align = wxALIGN_LEFT | wxALIGN_TOP,
int flags = 0) = 0;
// geometry functions
// ------------------
@@ -515,6 +523,14 @@ public:
int flags = 0)
{ m_rendererNative.DrawGauge(win, dc, rect, value, max, flags); }
virtual void DrawItemText(wxWindow* win,
wxDC& dc,
const wxString& text,
const wxRect& rect,
int align = wxALIGN_LEFT | wxALIGN_TOP,
int flags = 0)
{ m_rendererNative.DrawItemText(win, dc, text, rect, align, flags); }
virtual wxSplitterRenderParams GetSplitterParams(const wxWindow *win)
{ return m_rendererNative.GetSplitterParams(win); }