move Ellipsize() to wxControl so it can be easily used by other controls
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57625 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -6,6 +6,17 @@
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/**
|
||||
The different ellipsization modes supported by the
|
||||
wxControl::Ellipsize function.
|
||||
*/
|
||||
enum wxEllipsizeMode
|
||||
{
|
||||
wxELLIPSIZE_START,
|
||||
wxELLIPSIZE_MIDDLE,
|
||||
wxELLIPSIZE_END
|
||||
};
|
||||
|
||||
/**
|
||||
@class wxControl
|
||||
|
||||
@@ -29,6 +40,23 @@ public:
|
||||
*/
|
||||
virtual void Command(wxCommandEvent& event);
|
||||
|
||||
/**
|
||||
Replaces parts of the @a label string with ellipsis, if needed, so
|
||||
that it doesn't exceed @a maxWidth.
|
||||
|
||||
@param label
|
||||
The string to ellipsize
|
||||
@param dc
|
||||
The DC used to retrieve the character widths through the
|
||||
wxDC::GetPartialTextExtents() function.
|
||||
@param mode
|
||||
The ellipsization modes. See ::wxEllipsizeMode.
|
||||
@param maxWidth
|
||||
The maximum width of the returned string in pixels.
|
||||
*/
|
||||
static wxString Ellipsize(const wxString& label, const wxDC& dc,
|
||||
wxEllipsizeMode mode, int maxWidth);
|
||||
|
||||
/**
|
||||
Returns the control's text.
|
||||
|
||||
|
Reference in New Issue
Block a user