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

@@ -276,6 +276,18 @@ private:
wxRect(x2, y, widthGauge, heightGauge), 25, 100, m_flags);
y += lineHeight + heightGauge;
const wxCoord heightListItem = 48;
const wxCoord widthListItem = 260;
dc.DrawText("DrawItemSelectionRect()", x1, y);
wxRendererNative::GetDefault().DrawItemSelectionRect(this, dc,
wxRect(x2, y, widthListItem, heightListItem), m_flags | wxCONTROL_SELECTED);
wxRendererNative::GetDefault().DrawItemText(this, dc, "DrawItemText()",
wxRect(x2, y, widthListItem, heightListItem).Inflate(-2, -2), m_align, m_flags | wxCONTROL_SELECTED);
y += lineHeight + heightListItem;
}
int m_flags;