Merge branch 'underline-improvements' of https://github.com/MaartenBent/wxWidgets
Add support for different underline types and colour to wxTextCtrl. See https://github.com/wxWidgets/wxWidgets/pull/1406 Closes #17124.
This commit is contained in:
@@ -270,6 +270,14 @@ enum wxTextAttrLineSpacing
|
||||
wxTEXT_ATTR_LINE_SPACING_TWICE = 20
|
||||
};
|
||||
|
||||
enum wxTextAttrUnderlineType
|
||||
{
|
||||
wxTEXT_ATTR_UNDERLINE_NONE,
|
||||
wxTEXT_ATTR_UNDERLINE_SOLID,
|
||||
wxTEXT_ATTR_UNDERLINE_DOUBLE,
|
||||
wxTEXT_ATTR_UNDERLINE_SPECIAL
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxTextAttr: a structure containing the visual attributes of a text
|
||||
// ----------------------------------------------------------------------------
|
||||
@@ -320,7 +328,13 @@ public:
|
||||
void SetFontStyle(wxFontStyle fontStyle) { m_fontStyle = fontStyle; m_flags |= wxTEXT_ATTR_FONT_ITALIC; }
|
||||
void SetFontWeight(wxFontWeight fontWeight) { m_fontWeight = fontWeight; m_flags |= wxTEXT_ATTR_FONT_WEIGHT; }
|
||||
void SetFontFaceName(const wxString& faceName) { m_fontFaceName = faceName; m_flags |= wxTEXT_ATTR_FONT_FACE; }
|
||||
void SetFontUnderlined(bool underlined) { m_fontUnderlined = underlined; m_flags |= wxTEXT_ATTR_FONT_UNDERLINE; }
|
||||
void SetFontUnderlined(bool underlined) { SetFontUnderlined(underlined ? wxTEXT_ATTR_UNDERLINE_SOLID : wxTEXT_ATTR_UNDERLINE_NONE); }
|
||||
void SetFontUnderlined(wxTextAttrUnderlineType type, const wxColour& colour = wxNullColour)
|
||||
{
|
||||
m_flags |= wxTEXT_ATTR_FONT_UNDERLINE;
|
||||
m_fontUnderlineType = type;
|
||||
m_colUnderline = colour;
|
||||
}
|
||||
void SetFontStrikethrough(bool strikethrough) { m_fontStrikethrough = strikethrough; m_flags |= wxTEXT_ATTR_FONT_STRIKETHROUGH; }
|
||||
void SetFontEncoding(wxFontEncoding encoding) { m_fontEncoding = encoding; m_flags |= wxTEXT_ATTR_FONT_ENCODING; }
|
||||
void SetFontFamily(wxFontFamily family) { m_fontFamily = family; m_flags |= wxTEXT_ATTR_FONT_FAMILY; }
|
||||
@@ -359,7 +373,9 @@ public:
|
||||
int GetFontSize() const { return m_fontSize; }
|
||||
wxFontStyle GetFontStyle() const { return m_fontStyle; }
|
||||
wxFontWeight GetFontWeight() const { return m_fontWeight; }
|
||||
bool GetFontUnderlined() const { return m_fontUnderlined; }
|
||||
bool GetFontUnderlined() const { return m_fontUnderlineType != wxTEXT_ATTR_UNDERLINE_NONE; }
|
||||
wxTextAttrUnderlineType GetUnderlineType() const { return m_fontUnderlineType; }
|
||||
const wxColour& GetUnderlineColour() const { return m_colUnderline; }
|
||||
bool GetFontStrikethrough() const { return m_fontStrikethrough; }
|
||||
const wxString& GetFontFaceName() const { return m_fontFaceName; }
|
||||
wxFontEncoding GetFontEncoding() const { return m_fontEncoding; }
|
||||
@@ -508,7 +524,8 @@ private:
|
||||
wxFontStyle m_fontStyle;
|
||||
wxFontWeight m_fontWeight;
|
||||
wxFontFamily m_fontFamily;
|
||||
bool m_fontUnderlined;
|
||||
wxTextAttrUnderlineType m_fontUnderlineType;
|
||||
wxColour m_colUnderline;
|
||||
bool m_fontStrikethrough;
|
||||
wxString m_fontFaceName;
|
||||
|
||||
|
Reference in New Issue
Block a user