Add ellipsizeMode parameter to wxRenderNative::DrawItemText()
Instead of the default end ellipsize mode used in the native and generic implementation, allow specifying the mode with an additional parameter. Closes https://github.com/wxWidgets/wxWidgets/pull/97
This commit is contained in:
committed by
Vadim Zeitlin
parent
60a3d76045
commit
44bcc3a723
@@ -150,7 +150,8 @@ public:
|
||||
const wxString& text,
|
||||
const wxRect& rect,
|
||||
int align = wxALIGN_LEFT | wxALIGN_TOP,
|
||||
int flags = 0) wxOVERRIDE;
|
||||
int flags = 0,
|
||||
wxEllipsizeMode ellipsizeMode = wxELLIPSIZE_END) wxOVERRIDE;
|
||||
|
||||
virtual wxSplitterRenderParams GetSplitterParams(const wxWindow *win) wxOVERRIDE;
|
||||
|
||||
@@ -888,7 +889,8 @@ wxRendererGeneric::DrawItemText(wxWindow* win,
|
||||
const wxString& text,
|
||||
const wxRect& rect,
|
||||
int align,
|
||||
int flags)
|
||||
int flags,
|
||||
wxEllipsizeMode ellipsizeMode)
|
||||
{
|
||||
// Determine text color
|
||||
wxColour textColour;
|
||||
@@ -913,7 +915,7 @@ wxRendererGeneric::DrawItemText(wxWindow* win,
|
||||
}
|
||||
|
||||
const wxString paintText = wxControl::Ellipsize(text, dc,
|
||||
wxELLIPSIZE_END,
|
||||
ellipsizeMode,
|
||||
rect.GetWidth());
|
||||
|
||||
// Draw text
|
||||
|
||||
Reference in New Issue
Block a user