Add ellipsization support to wxDataViewCtrl.
Implemented ellipsization in the generic, GTK and both OS X Carbon and Cocoa versions but it currently doesn't work well in GTK as it changes the item alignment unconditionally, this will need to be fixed later. The behaviour for the columns is currently inconsistent between ports too: under MSW they (natively) use wxELLIPSIZE_END, under GTK -- wxELLIPSIZE_NONE and under OS X the same ellipsization mode as the column contents, i.e. wxELLIPSIZE_MIDDLE by default. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62433 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -47,6 +47,9 @@ enum wxEllipsizeFlags
|
||||
*/
|
||||
enum wxEllipsizeMode
|
||||
{
|
||||
/// Don't ellipsize the text at all. @since 2.9.1
|
||||
wxELLIPSIZE_NONE,
|
||||
|
||||
/// Put the ellipsis at the start of the string, if the string needs ellipsization.
|
||||
wxELLIPSIZE_START,
|
||||
|
||||
|
@@ -1060,11 +1060,49 @@ public:
|
||||
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
|
||||
int align = wxDVR_DEFAULT_ALIGNMENT );
|
||||
|
||||
/**
|
||||
Enable or disable replacing parts of the item text with ellipsis to
|
||||
make it fit the column width.
|
||||
|
||||
This method only makes sense for the renderers working with text, such
|
||||
as wxDataViewTextRenderer or wxDataViewIconTextRenderer.
|
||||
|
||||
By default wxELLIPSIZE_MIDDLE is used.
|
||||
|
||||
@param mode
|
||||
Ellipsization mode, use wxELLIPSIZE_NONE to disable.
|
||||
|
||||
@since 2.9.1
|
||||
*/
|
||||
void EnableEllipsize(wxEllipsizeMode mode = wxELLIPSIZE_MIDDLE);
|
||||
|
||||
/**
|
||||
Disable replacing parts of the item text with ellipsis.
|
||||
|
||||
If ellipsizing is disabled, the string will be truncated if it doesn't
|
||||
fit.
|
||||
|
||||
This is the same as @code EnableEllipsize(wxELLIPSIZE_NONE) @endcode.
|
||||
|
||||
@since 2.9.1
|
||||
*/
|
||||
void DisableEllipsize();
|
||||
|
||||
/**
|
||||
Returns the alignment. See SetAlignment()
|
||||
*/
|
||||
virtual int GetAlignment() const;
|
||||
|
||||
/**
|
||||
Returns the ellipsize mode used by the renderer.
|
||||
|
||||
If the return value is wxELLIPSIZE_NONE, the text is simply truncated
|
||||
if it doesn't fit.
|
||||
|
||||
@see EnableEllipsize()
|
||||
*/
|
||||
wxEllipsizeMode GetEllipsizeMode() const;
|
||||
|
||||
/**
|
||||
Returns the cell mode.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user