wxTextAttrExwxTextAttrEx is an extended version of wxTextAttr with more paragraph attributes. Currently it is only used with wxRichTextCtrl. It is intended that eventually, the members of wxTextAttrEx will be folded into wxTextAttr, and wxTextAttr will be the official cross-platform API for text controls that support attributes. However, for now, wxTextAttrEx is provided as a means of enabling extra functionality in wxRichTextCtrl, while retaining some compatibility with the wxTextAttr API. The most efficient method of accessing wxRichTextCtrl functionality is a third attribute class, wxRichTextAttr, which optimizes its storage to allow it to be used for implementing objects in a buffer, as well as access to that buffer. This section only documents the additional members; see wxTextAttr for the remaining functions. Derived from Include files <wx/richtext/richtextbuffer.h> Constants The following values can be passed to SetAlignment to determine paragraph alignment.
These values are passed in a bitlist to SetFlags to determine what attributes will be considered when setting the attributes for a text control.
The following styles can be passed to wxTextAttrEx::SetBulletStyle:
Of these, wxTEXT_ATTR_BULLET_STYLE_BITMAP is unimplemented. The following constants can be passed to wxTextAttrEx::SetLineSpacing:
The following styles can be passed to wxTextAttrEx::SetTextEffects:
Of these, only wxTEXT_ATTR_EFFECT_CAPITALS and wxTEXT_ATTR_EFFECT_STRIKETHROUGH are implemented. See also wxTextAttr, wxRichTextAttr, wxRichTextCtrl Members
wxTextAttrEx::wxTextAttrEx
wxTextAttrEx::wxTextAttrExwxTextAttrEx() wxTextAttrEx(const wxTextAttrEx& attr) Constructors.
wxTextAttrEx::GetBulletFontconst wxString& GetBulletFont() const Returns a string containing the name of the font associated with the bullet symbol. Only valid for attributes with wxTEXT_ATTR_BULLET_SYMBOL.
wxTextAttrEx::GetBulletNameconst wxString& GetBulletName() const Returns the standard bullet name, applicable if the bullet style is wxTEXT_ATTR_BULLET_STYLE_STANDARD. Currently the following standard bullet names are supported:
If you wish your application to support further bullet graphics, you can derive a class from wxRichTextRenderer or wxRichTextStdRenderer, override DrawStandardBullet and EnumerateStandardBulletNames, and set an instance of the class using wxRichTextBuffer::SetRenderer.
wxTextAttrEx::GetBulletNumberint GetBulletNumber() const Returns the bullet number.
wxTextAttrEx::GetBulletStyleint GetBulletStyle() const Returns the bullet style. See wxTextAttrEx::SetBulletStyle for a list of available styles.
wxTextAttrEx::GetBulletTextconst wxString& GetBulletText() const Returns the bullet text, which could be a symbol, or (for example) cached outline text.
wxTextAttrEx::GetCharacterStyleNameconst wxString& GetCharacterStyleName() const Returns the name of the character style.
wxTextAttrEx::GetLineSpacingint GetLineSpacing() const Returns the line spacing value, one of wxTEXT_ATTR_LINE_SPACING_NORMAL, wxTEXT_ATTR_LINE_SPACING_HALF, and wxTEXT_ATTR_LINE_SPACING_TWICE.
wxTextAttrEx::GetListStyleNameconst wxString& GetListStyleName() const Returns the name of the list style.
wxTextAttrEx::GetOutlineLevelint GetOutlineLevel() const Returns the outline level.
wxTextAttrEx::GetParagraphSpacingAfterint GetParagraphSpacingAfter() const Returns the space in tenths of a millimeter after the paragraph.
wxTextAttrEx::GetParagraphSpacingBeforeint GetParagraphSpacingBefore() const Returns the space in tenths of a millimeter before the paragraph.
wxTextAttrEx::GetParagraphStyleNameconst wxString& GetParagraphStyleName() const Returns the name of the paragraph style.
wxTextAttrEx::GetTextEffectFlagsint GetTextEffectFlags() const Returns the text effect bits of interest. See wxTextAttr::SetFlags for further information.
wxTextAttrEx::GetTextEffectsint GetTextEffects() const Returns the text effects, a bit list of styles. See wxTextAttrEx::SetTextEffects for details.
wxTextAttrEx::GetURLconst wxString& GetURL() const Returns the URL for the content. Content with wxTEXT_ATTR_URL style causes wxRichTextCtrl to show a hand cursor over it, and wxRichTextCtrl generates a wxTextUrlEvent when the content is clicked.
wxTextAttrEx::HasBulletNamebool HasBulletName() const Returns true if the attribute object specifies a standard bullet name.
wxTextAttrEx::HasBulletNumberbool HasBulletNumber() const Returns true if the attribute object specifies a bullet number.
wxTextAttrEx::HasBulletStylebool HasBulletStyle() const Returns true if the attribute object specifies a bullet style.
wxTextAttrEx::HasBulletTextbool HasBulletText() const Returns true if the attribute object specifies bullet text (usually containing a symbol).
wxTextAttrEx::HasCharacterStyleNamebool HasCharacterStyleName() const Returns true if the attribute object specifies a character style name.
wxTextAttrEx::HasLineSpacingbool HasLineSpacing() const Returns true if the attribute object specifies line spacing.
wxTextAttrEx::HasListStyleNamebool HasListStyleName() const Returns true if the attribute object specifies a list style name.
wxTextAttrEx::HasOutlineLevelbool HasOutlineLevel() const Returns true if the attribute object specifies an outline level.
wxTextAttrEx::HasPageBreakbool HasPageBreak() const Returns true if the attribute object specifies a page break before this paragraph.
wxTextAttrEx::HasParagraphSpacingAfterbool HasParagraphSpacingAfter() const Returns true if the attribute object specifies spacing after a paragraph.
wxTextAttrEx::HasParagraphSpacingBeforebool HasParagraphSpacingBefore() const Returns true if the attribute object specifies spacing before a paragraph.
wxTextAttrEx::HasParagraphStyleNamebool HasParagraphStyleName() const Returns true if the attribute object specifies a paragraph style name.
wxTextAttrEx::HasTextEffectsbool HasTextEffects() const Returns true if the attribute object specifies text effects.
wxTextAttrEx::HasURLbool HasURL() const Returns true if the attribute object specifies a URL.
wxTextAttrEx::Initvoid Init() Initialises this object.
wxTextAttrEx::IsCharacterStylebool IsCharacterStyle() const Returns true if the object represents a character style, that is, the flags specify a font or a text background or foreground colour.
wxTextAttrEx::IsDefaultbool IsDefault() const Returns false if we have any attributes set, true otherwise.
wxTextAttrEx::IsParagraphStylebool IsParagraphStyle() const Returns true if the object represents a paragraph style, that is, the flags specify alignment, indentation, tabs, paragraph spacing, or bullet style.
wxTextAttrEx::SetBulletFontvoid SetBulletFont(const wxString& font) Sets the name of the font associated with the bullet symbol. Only valid for attributes with wxTEXT_ATTR_BULLET_SYMBOL.
wxTextAttrEx::SetBulletNumbervoid SetBulletNumber(int n) Sets the bullet number.
wxTextAttrEx::SetBulletNamevoid SetBulletName(const wxString& name) Sets the standard bullet name, applicable if the bullet style is wxTEXT_ATTR_BULLET_STYLE_STANDARD. See wxTextAttrEx::GetBulletName for a list of supported names, and how to expand the range of supported types.
wxTextAttrEx::SetBulletStylevoid SetBulletStyle(int style) Sets the bullet style. The following styles can be passed:
Currently wxTEXT_ATTR_BULLET_STYLE_BITMAP is not supported.
wxTextAttrEx::SetBulletTextvoid SetBulletText(const wxString& text) Sets the bullet text, which could be a symbol, or (for example) cached outline text.
wxTextAttrEx::SetCharacterStyleNamevoid SetCharacterStyleName(const wxString& name) Sets the character style name.
wxTextAttrEx::SetLineSpacingvoid SetLineSpacing(int spacing) Sets the line spacing. spacing is a multiple, where 10 means single-spacing, 15 means 1.5 spacing, and 20 means double spacing. The following constants are defined for convenience:
wxTextAttrEx::SetListStyleNamevoid SetListStyleName(const wxString& name) Sets the list style name.
wxTextAttrEx::SetOutlineLevelvoid SetOutlineLevel(int level) Specifies the outline level. Zero represents normal text. At present, the outline level is not used, but may be used in future for determining list levels and for applications that need to store document structure information.
wxTextAttrEx::SetPageBreakvoid SetPageBreak(bool pageBreak = true) Specifies a page break before this paragraph.
wxTextAttrEx::SetParagraphSpacingAftervoid SetParagraphSpacingAfter(int spacing) Sets the spacing after a paragraph, in tenths of a millimetre.
wxTextAttrEx::SetParagraphSpacingBeforevoid SetParagraphSpacingBefore(int spacing) Sets the spacing before a paragraph, in tenths of a millimetre.
wxTextAttrEx::SetParagraphStyleNamevoid SetParagraphStyleName(const wxString& name) Sets the name of the paragraph style.
wxTextAttrEx::SetTextEffectFlagsvoid SetTextEffectFlags(int flags) Sets the text effect bits of interest. You should also pass wxTEXT_ATTR_EFFECTS to wxTextAttr::SetFlags.
wxTextAttrEx::SetTextEffectsvoid SetTextEffects(int effects) Sets the text effects, a bit list of styles. The following styles can be passed:
Of these, only wxTEXT_ATTR_EFFECT_CAPITALS and wxTEXT_ATTR_EFFECT_STRIKETHROUGH are implemented. wxTEXT_ATTR_EFFECT_CAPITALS capitalises text when displayed (leaving the case of the actual buffer text unchanged), and wxTEXT_ATTR_EFFECT_STRIKETHROUGH draws a line through text. To set effects, you should also pass wxTEXT_ATTR_EFFECTS to wxTextAttr::SetFlags, and call wxTextAttrEx::SetTextEffectFlags with the styles (taken from the above set) that you are interested in setting.
wxTextAttrEx::SetURLvoid SetURL(const wxString& url) Sets the URL for the content. Sets the wxTEXT_ATTR_URL style; content with this style causes wxRichTextCtrl to show a hand cursor over it, and wxRichTextCtrl generates a wxTextUrlEvent when the content is clicked.
wxTextAttrEx::operator=void operator operator=(const wxTextAttr& attr) Assignment from a wxTextAttr object. void operator operator=(const wxTextAttrEx& attr) Assignment from a wxTextAttrEx object.
|