Add API for ellipsization support to wxGrid

This API is not implemented yet, i.e. ellipsization mode is not
respected for now. This commit just adds the API, documents it and adds
an example of using it in the sample.
This commit is contained in:
Vadim Zeitlin
2020-01-11 18:25:55 +01:00
parent f13085441c
commit 41dcd9ecdb
3 changed files with 52 additions and 1 deletions

View File

@@ -888,6 +888,9 @@ public:
cells, if the cell contents still doesn't fit after overflowing into the
immediately neighbouring cell.
- Clip the cell contents, discarding the part which doesn't fit.
- Ellipsize the cell contents, i.e. replace the non-fitting part with
ellipsis (@c ...), putting the ellipsis at the end by default, but possibly
at the beginning or in the middle.
The default behaviour is to overflow, use wxGrid::SetDefaultCellFitMode()
to change this, for example:
@@ -925,6 +928,11 @@ public:
*/
static wxGridFitMode Overflow();
/**
Pseudo-constructor for object specifying ellipsize behaviour.
*/
static wxGridFitMode Ellipsize(wxEllipsizeMode ellipsize = wxELLIPSIZE_END);
/**
Return true if the object specifies some particular behaviour.
@@ -946,6 +954,15 @@ public:
This method returns @true only for the objects returned by Overflow().
*/
bool IsOverflow() const;
/**
Return ellipsize mode, possibly @c wxELLIPSIZE_NONE.
For the objects constructed using Ellipsize(), the same ellipsization
mode as was passed to it is returned. For all the other objects,
::wxELLIPSIZE_NONE is.
*/
wxEllipsizeMode GetEllipsizeMode() const;
};
/**