refactor wxStaticText::Ellipsize so it's a static public utility function; document it and a couple of other useful functions

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57622 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Francesco Montorsi
2008-12-28 19:24:13 +00:00
parent 9140731891
commit 4520d5836a
4 changed files with 163 additions and 83 deletions

View File

@@ -24,10 +24,14 @@
#define wxST_NO_AUTORESIZE 0x0001
#define wxST_MARKUP 0x0002
#define wxST_ELLIPSIZE_START 0x0004
#define wxST_ELLIPSIZE_MIDDLE 0x0008
#define wxST_ELLIPSIZE_END 0x0010
// NOTE: the members of this enum are used both as window styles for wxStaticText
// and both as enumeration values for wxStaticText::Ellipsize static function
enum wxEllipsizeMode
{
wxST_ELLIPSIZE_START = 0x0004,
wxST_ELLIPSIZE_MIDDLE = 0x0008,
wxST_ELLIPSIZE_END = 0x0010
};
extern WXDLLIMPEXP_DATA_CORE(const char) wxStaticTextNameStr[];
@@ -65,10 +69,13 @@ public:
// and then returns the cleaned string
static wxString RemoveMarkup(const wxString& str);
// escapes the alls special symbols (<>"'&) present inside the given string
// escapes all special symbols (<>"'&) present in the given string
// using the corresponding entities (&lt; &gt; &quot; &apos; &amp;)
static wxString EscapeMarkup(const wxString& str);
// replaces parts of the string with ellipsis if needed
static wxString Ellipsize(const wxString& label, const wxDC& dc,
wxEllipsizeMode mode, int maxWidth);
protected: // functions required for wxST_ELLIPSIZE_* support