********************** wx.richtext.TextAttrEx ********************** Inheritance diagram for `wx.richtext.TextAttrEx`: | .. inheritance-diagram:: wx.richtext.TextAttrEx | Description =========== `wx.richtext.TextAttrEx` is an extended version of `wx.TextAttr <../Widgets/wx.TextAttr.html>`_ with more paragraph attributes. Currently it is only used with `wx.richtext.RichTextCtrl `_. It is intended that eventually, the members of `wx.richtext.TextAttrEx` will be folded into `wx.TextAttr`, and `wx.TextAttr` will be the official cross-platform API for text controls that support attributes. However, for now, `wx.richtext.TextAttrEx` is provided as a means of enabling extra functionality in `wx.richtext.RichTextCtrl`, while retaining some compatibility with the `wx.TextAttr` API. The most efficient method of accessing `wx.richtext.RichTextCtrl` functionality is a third attribute class, `wx.richtext.RichTextAttr `_, 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 `wx.TextAttr <../Widgets/wx.TextAttr.html>`_ for the remaining functions. .. seealso:: `wx.TextAttr <../Widgets/wx.TextAttr.html>`_, `wx.richtext.RichTextAttr `_, `wx.richtext.RichTextCtrl `_ Constants ^^^^^^^^^ The following values can be passed to `SetAlignment <#SetAlignment>`_ to determine paragraph alignment: * ``wx.TEXT_ALIGNMENT_DEFAULT`` * ``wx.TEXT_ALIGNMENT_LEFT`` * ``wx.TEXT_ALIGNMENT_CENTRE`` * ``wx.TEXT_ALIGNMENT_CENTER`` = ``wx.TEXT_ALIGNMENT_CENTRE`` * ``wx.TEXT_ALIGNMENT_RIGHT`` * ``wx.TEXT_ALIGNMENT_JUSTIFIED`` Of these, ``wx.TEXT_ALIGNMENT_JUSTIFIED`` is unimplemented. In future justification may be supported when printing or previewing, only. | The following values are passed in a bitlist to `SetFlags <#SetFlags>`_ to determine what attributes will be considered when setting the attributes for a text control (they are all members of the standard `wx` package): ==================================================== ======================= Standard Constants Value ==================================================== ======================= ``wx.TEXT_ATTR_TEXT_COLOUR`` 0x00000001 ``wx.TEXT_ATTR_BACKGROUND_COLOUR`` 0x00000002 ``wx.TEXT_ATTR_FONT_FACE`` 0x00000004 ``wx.TEXT_ATTR_FONT_SIZE`` 0x00000008 ``wx.TEXT_ATTR_FONT_WEIGHT`` 0x00000010 ``wx.TEXT_ATTR_FONT_ITALIC`` 0x00000020 ``wx.TEXT_ATTR_FONT_UNDERLINE`` 0x00000040 ``wx.TEXT_ATTR_FONT`` ``wx.TEXT_ATTR_FONT_FACE`` | ``wx.TEXT_ATTR_FONT_SIZE`` | ``wx.TEXT_ATTR_FONT_WEIGHT`` | ``wx.TEXT_ATTR_FONT_ITALIC`` | ``wx.TEXT_ATTR_FONT_UNDERLINE`` ``wx.TEXT_ATTR_ALIGNMENT`` 0x00000080 ``wx.TEXT_ATTR_LEFT_INDENT`` 0x00000100 ``wx.TEXT_ATTR_RIGHT_INDENT`` 0x00000200 ``wx.TEXT_ATTR_TABS`` 0x00000400 ==================================================== ======================= | These are available by importing `wx.richtext`: ==================================================== ======================= Extra Formatting Flags Value ==================================================== ======================= ``wx.richtext.TEXT_ATTR_PARA_SPACING_AFTER`` 0x00000800 ``wx.richtext.TEXT_ATTR_PARA_SPACING_BEFORE`` 0x00001000 ``wx.richtext.TEXT_ATTR_LINE_SPACING`` 0x00002000 ``wx.richtext.TEXT_ATTR_CHARACTER_STYLE_NAME`` 0x00004000 ``wx.richtext.TEXT_ATTR_PARAGRAPH_STYLE_NAME`` 0x00008000 ``wx.richtext.TEXT_ATTR_LIST_STYLE_NAME`` 0x00010000 ``wx.richtext.TEXT_ATTR_BULLET_STYLE`` 0x00020000 ``wx.richtext.TEXT_ATTR_BULLET_NUMBER`` 0x00040000 ``wx.richtext.TEXT_ATTR_BULLET_TEXT`` 0x00080000 ``wx.richtext.TEXT_ATTR_BULLET_NAME`` 0x00100000 ``wx.richtext.TEXT_ATTR_URL`` 0x00200000 ``wx.richtext.TEXT_ATTR_PAGE_BREAK`` 0x00400000 ``wx.richtext.TEXT_ATTR_EFFECTS`` 0x00800000 ``wx.richtext.TEXT_ATTR_OUTLINE_LEVEL`` 0x01000000 ==================================================== ======================= | The following styles can be passed to `SetBulletStyle <#SetBulletStyle>`_: ============================================================= ======================= Bullet Style Flags Value ============================================================= ======================= ``wx.richtext.TEXT_ATTR_BULLET_STYLE_NONE`` 0x00000000 ``wx.richtext.TEXT_ATTR_BULLET_STYLE_ARABIC`` 0x00000001 ``wx.richtext.TEXT_ATTR_BULLET_STYLE_LETTERS_UPPER`` 0x00000002 ``wx.richtext.TEXT_ATTR_BULLET_STYLE_LETTERS_LOWER`` 0x00000004 ``wx.richtext.TEXT_ATTR_BULLET_STYLE_ROMAN_UPPER`` 0x00000008 ``wx.richtext.TEXT_ATTR_BULLET_STYLE_ROMAN_LOWER`` 0x00000010 ``wx.richtext.TEXT_ATTR_BULLET_STYLE_SYMBOL`` 0x00000020 ``wx.richtext.TEXT_ATTR_BULLET_STYLE_BITMAP`` 0x00000040 ``wx.richtext.TEXT_ATTR_BULLET_STYLE_PARENTHESES`` 0x00000080 ``wx.richtext.TEXT_ATTR_BULLET_STYLE_PERIOD`` 0x00000100 ``wx.richtext.TEXT_ATTR_BULLET_STYLE_STANDARD`` 0x00000200 ``wx.richtext.TEXT_ATTR_BULLET_STYLE_RIGHT_PARENTHESIS`` 0x00000400 ``wx.richtext.TEXT_ATTR_BULLET_STYLE_OUTLINE`` 0x00000800 ``wx.richtext.TEXT_ATTR_BULLET_STYLE_ALIGN_LEFT`` 0x00000000 ``wx.richtext.TEXT_ATTR_BULLET_STYLE_ALIGN_RIGHT`` 0x00001000 ``wx.richtext.TEXT_ATTR_BULLET_STYLE_ALIGN_CENTRE`` 0x00002000 ============================================================= ======================= Of these, ``wx.richtext.TEXT_ATTR_BULLET_STYLE_BITMAP`` is unimplemented. | The following constants can be passed to `SetLineSpacing <#SetLineSpacing>`_: ============================================================= ======================= Line Spacing Flags Value ============================================================= ======================= ``wx.richtext.TEXT_ATTR_LINE_SPACING_NORMAL`` 10 ``wx.richtext.TEXT_ATTR_LINE_SPACING_HALF`` 15 ``wx.richtext.TEXT_ATTR_LINE_SPACING_TWICE`` 20 ============================================================= ======================= | The following styles can be passed to `SetTextEffects <#SetTextEffects>`_: ============================================================= ======================= Text Effects Flags Value ============================================================= ======================= ``wx.richtext.TEXT_ATTR_EFFECT_NONE`` 0x00000000 ``wx.richtext.TEXT_ATTR_EFFECT_CAPITALS`` 0x00000001 ``wx.richtext.TEXT_ATTR_EFFECT_SMALL_CAPITALS`` 0x00000002 ``wx.richtext.TEXT_ATTR_EFFECT_STRIKETHROUGH`` 0x00000004 ``wx.richtext.TEXT_ATTR_EFFECT_DOUBLE_STRIKETHROUGH`` 0x00000008 ``wx.richtext.TEXT_ATTR_EFFECT_SHADOW`` 0x00000010 ``wx.richtext.TEXT_ATTR_EFFECT_EMBOSS`` 0x00000020 ``wx.richtext.TEXT_ATTR_EFFECT_OUTLINE`` 0x00000040 ``wx.richtext.TEXT_ATTR_EFFECT_ENGRAVE`` 0x00000080 ``wx.richtext.TEXT_ATTR_EFFECT_SUPERSCRIPT`` 0x00000100 ``wx.richtext.TEXT_ATTR_EFFECT_SUBSCRIPT`` 0x00000200 ============================================================= ======================= Of these, only ``wx.richtext.TEXT_ATTR_EFFECT_CAPITALS`` and ``wx.richtext.TEXT_ATTR_EFFECT_STRIKETHROUGH`` are implemented. Derived From ^^^^^^^^^^^^^ * `wx.TextAttr <../Widgets/wx.TextAttr.html>`_ Known Subclasses ^^^^^^^^^^^^^^^^ `wx.richtext.RichTextAttr `_ Methods Summary ^^^^^^^^^^^^^^^ * `__init__ <#__init__>`_ * `CombineEx <#CombineEx>`_ * `Copy <#Copy>`_ * `GetAlignment <#GetAlignment>`_ * `GetBackgroundColour <#GetBackgroundColour>`_ * `GetBulletFont <#GetBulletFont>`_ * `GetBulletName <#GetBulletName>`_ * `GetBulletNumber <#GetBulletNumber>`_ * `GetBulletStyle <#GetBulletStyle>`_ * `GetBulletText <#GetBulletText>`_ * `GetCharacterStyleName <#GetCharacterStyleName>`_ * `GetFlags <#GetFlags>`_ * `GetFont <#GetFont>`_ * `GetLeftIndent <#GetLeftIndent>`_ * `GetLeftSubIndent <#GetLeftSubIndent>`_ * `GetLineSpacing <#GetLineSpacing>`_ * `GetListStyleName <#GetListStyleName>`_ * `GetOutlineLevel <#GetOutlineLevel>`_ * `GetParagraphSpacingAfter <#GetParagraphSpacingAfter>`_ * `GetParagraphSpacingBefore <#GetParagraphSpacingBefore>`_ * `GetParagraphStyleName <#GetParagraphStyleName>`_ * `GetRightIndent <#GetRightIndent>`_ * `GetTabs <#GetTabs>`_ * `GetTextColour <#GetTextColour>`_ * `GetTextEffectFlags <#GetTextEffectFlags>`_ * `GetTextEffects <#GetTextEffects>`_ * `GetURL <#GetURL>`_ * `HasAlignment <#HasAlignment>`_ * `HasBackgroundColour <#HasBackgroundColour>`_ * `HasBulletName <#HasBulletName>`_ * `HasBulletNumber <#HasBulletNumber>`_ * `HasBulletStyle <#HasBulletStyle>`_ * `HasBulletText <#HasBulletText>`_ * `HasCharacterStyleName <#HasCharacterStyleName>`_ * `HasFlag <#HasFlag>`_ * `HasFont <#HasFont>`_ * `HasFontFaceName <#HasFontFaceName>`_ * `HasFontItalic <#HasFontItalic>`_ * `HasFontSize <#HasFontSize>`_ * `HasFontUnderlined <#HasFontUnderlined>`_ * `HasFontWeight <#HasFontWeight>`_ * `HasLeftIndent <#HasLeftIndent>`_ * `HasLineSpacing <#HasLineSpacing>`_ * `HasListStyleName <#HasListStyleName>`_ * `HasOutlineLevel <#HasOutlineLevel>`_ * `HasPageBreak <#HasPageBreak>`_ * `HasParagraphSpacingAfter <#HasParagraphSpacingAfter>`_ * `HasParagraphSpacingBefore <#HasParagraphSpacingBefore>`_ * `HasParagraphStyleName <#HasParagraphStyleName>`_ * `HasRightIndent <#HasRightIndent>`_ * `HasTabs <#HasTabs>`_ * `HasTextColour <#HasTextColour>`_ * `HasTextEffects <#HasTextEffects>`_ * `HasURL <#HasURL>`_ * `IsCharacterStyle <#IsCharacterStyle>`_ * `IsDefault <#IsDefault>`_ * `IsParagraphStyle <#IsParagraphStyle>`_ * `SetAlignment <#SetAlignment>`_ * `SetBackgroundColour <#SetBackgroundColour>`_ * `SetBulletFont <#SetBulletFont>`_ * `SetBulletName <#SetBulletName>`_ * `SetBulletNumber <#SetBulletNumber>`_ * `SetBulletStyle <#SetBulletStyle>`_ * `SetBulletText <#SetBulletText>`_ * `SetCharacterStyleName <#SetCharacterStyleName>`_ * `SetFlags <#SetFlags>`_ * `SetFontFaceName <#SetFontFaceName>`_ * `SetFontSize <#SetFontSize>`_ * `SetFontStyle <#SetFontStyle>`_ * `SetFontUnderlined <#SetFontUnderlined>`_ * `SetFontWeight <#SetFontWeight>`_ * `SetLeftIndent <#SetLeftIndent>`_ * `SetLineSpacing <#SetLineSpacing>`_ * `SetListStyleName <#SetListStyleName>`_ * `SetOutlineLevel <#SetOutlineLevel>`_ * `SetPageBreak <#SetPageBreak>`_ * `SetParagraphSpacingAfter <#SetParagraphSpacingAfter>`_ * `SetParagraphSpacingBefore <#SetParagraphSpacingBefore>`_ * `SetParagraphStyleName <#SetParagraphStyleName>`_ * `SetRightIndent <#SetRightIndent>`_ * `SetTabs <#SetTabs>`_ * `SetTextColour <#SetTextColour>`_ * `SetTextEffectFlags <#SetTextEffectFlags>`_ * `SetTextEffects <#SetTextEffects>`_ * `SetURL <#SetURL>`_ Properties Summary ^^^^^^^^^^^^^^^^^^ * `Alignment <#Alignment>`_ * `BackgroundColour <#BackgroundColour>`_ * `BulletFont <#BulletFont>`_ * `BulletName <#BulletName>`_ * `BulletNumber <#BulletNumber>`_ * `BulletStyle <#BulletStyle>`_ * `BulletText <#BulletText>`_ * `CharacterStyleName <#CharacterStyleName>`_ * `Flags <#Flags>`_ * `Font <#Font>`_ * `LeftIndent <#LeftIndent>`_ * `LeftSubIndent <#LeftSubIndent>`_ * `LineSpacing <#LineSpacing>`_ * `ListStyleName <#ListStyleName>`_ * `OutlineLevel <#OutlineLevel>`_ * `ParagraphSpacingAfter <#ParagraphSpacingAfter>`_ * `ParagraphSpacingBefore <#ParagraphSpacingBefore>`_ * `ParagraphStyleName <#ParagraphStyleName>`_ * `RightIndent <#RightIndent>`_ * `Tabs <#Tabs>`_ * `TextColour <#TextColour>`_ * `TextEffectFlags <#TextEffectFlags>`_ * `TextEffects <#TextEffects>`_ * `URL <#URL>`_ Class API ========= Methods ^^^^^^^ .. method:: __init__() Constructor. The `wx.richtext.TextAttrEx` class stores information about the various attributes for a block of text, including font, colour, indents, alignments, etc... | **Returns:** `wx.richtext.TextAttrEx `_ --------- .. method:: CombineEx(attr, attrDef, text) `No documentation available for this method.` --------- .. method:: Copy(attr) `No documentation available for this method.` --------- .. method:: GetAlignment() Returns the alignment flags. See `SetAlignment <#SetAlignment>`_ for a list of available styles. | **Returns:** `int` -------- .. method:: GetBackgroundColour() Returns the background colour. | **Returns:** `wx.Colour <../Widgets/wx.Colour.html>`_ -------- .. method:: GetBulletFont() Returns a string containing the name of the font associated with the bullet symbol. Only valid for attributes with ``wx.richtext.TEXT_ATTR_BULLET_SYMBOL``. | **Returns:** `string` -------- .. method:: GetBulletName() Returns the standard bullet name, applicable if the bullet style is ``wx.richtext.TEXT_ATTR_BULLET_STYLE_STANDARD``. Currently the following standard bullet names are supported: * ``standard/circle`` * ``standard/square`` * ``standard/diamond`` * ``standard/triangle`` If you wish your application to support further bullet graphics, you can derive a class from `wx.richtext.RichTextRenderer` or `wx.richtext.RichTextStdRenderer`, override `DrawStandardBullet` and `EnumerateStandardBulletNames`, and set an instance of the class using `wx.richtext.RichTextBuffer.SetRenderer `_. | **Returns:** `string` -------- .. method:: GetBulletNumber() Returns the bullet number. | **Returns:** `int` -------- .. method:: GetBulletStyle() Returns the bullet style. See `SetBulletStyle <#SetBulletStyle>`_ for a list of available styles. | **Returns:** `int` -------- .. method:: GetBulletText() Returns the bullet text, which could be a symbol, or (for example) cached outline text. | **Returns:** `string` -------- .. method:: GetCharacterStyleName() Returns the name of the character style. | **Returns:** `string` -------- .. method:: GetFlags() Returns flags indicating which attributes are applicable. See `SetFlags <#SetFlags>`_ for a list of available flags. | **Returns:** `long` -------- .. method:: GetFont() Returns the font associated with the attribute. | **Returns:** `wx.Font <../Widgets/wx.Font.html>`_ -------- .. method:: GetLeftIndent() Returns the left indent in tenths of a millimetre. | **Returns:** `long` -------- .. method:: GetLeftSubIndent() Returns the left sub-indent in tenths of a millimetre. | **Returns:** `long` -------- .. method:: GetLineSpacing() Returns the line spacing value, one of ``wx.richtext.TEXT_ATTR_LINE_SPACING_NORMAL``, ``wx.richtext.TEXT_ATTR_LINE_SPACING_HALF``, and ``wx.richtext.TEXT_ATTR_LINE_SPACING_TWICE``. | **Returns:** `int` -------- .. method:: GetListStyleName() Returns the name of the list style. | **Returns:** `string` -------- .. method:: GetOutlineLevel() Returns the outline level. | **Returns:** `int` -------- .. method:: GetParagraphSpacingAfter() Returns the space in tenths of a millimeter after the paragraph. | **Returns:** `int` -------- .. method:: GetParagraphSpacingBefore() Returns the space in tenths of a millimeter before the paragraph. | **Returns:** `int` -------- .. method:: GetParagraphStyleName() Returns the name of the paragraph style. | **Returns:** `string` -------- .. method:: GetRightIndent() Returns the right indent in tenths of a millimeter. | **Returns:** `long` -------- .. method:: GetTabs() Returns an array of tab stops, each expressed in tenths of a millimeter. Each stop is measured from the left margin and therefore each value must be larger than the last. | **Returns:** `list of integers` -------- .. method:: GetTextColour() Returns the text foreground colour. | **Returns:** `wx.Colour <../Widgets/wx.Colour.html>`_ -------- .. method:: GetTextEffectFlags() Returns the text effect bits of interest. See `SetFlags <#SetFlags>`_ for further information. | **Returns:** `int` -------- .. method:: GetTextEffects() Returns the text effects, a bit list of styles. See `SetTextEffects <#SetTextEffects>`_ for details. | **Returns:** `int` -------- .. method:: GetURL() Returns the URL for the content. Content with ``wx.richtext.TEXT_ATTR_URL`` style causes `wx.richtext.RichTextCtrl `_ to show a hand cursor over it, and `wx.richtext.RichTextCtrl` generates a `wx.TextUrlEvent` when the content is clicked. | **Returns:** `string` -------- .. method:: HasAlignment() Returns ``True`` if the attribute object specifies alignment. | **Returns:** `bool` -------- .. method:: HasBackgroundColour() Returns ``True`` if the attribute object specifies a background colour. | **Returns:** `bool` -------- .. method:: HasBulletName() Returns ``True`` if the attribute object specifies a standard bullet name. | **Returns:** `bool` -------- .. method:: HasBulletNumber() Returns ``True`` if the attribute object specifies a bullet number. | **Returns:** `bool` -------- .. method:: HasBulletStyle() Returns ``True`` if the attribute object specifies a bullet style. | **Returns:** `bool` -------- .. method:: HasBulletText() Returns ``True`` if the attribute object specifies bullet text (usually specifying a symbol). | **Returns:** `bool` -------- .. method:: HasCharacterStyleName() Returns ``True`` if the attribute object specifies a character style name. | **Returns:** `bool` -------- .. method:: HasFlag(flag) Returns ``True`` if the `flag` is present in the attribute object's flag bitlist. **Parameters:** * `flag` (int): The flag to check. | **Returns:** `bool` -------- .. method:: HasFont() Returns ``True`` if the attribute object specifies any font attributes. | **Returns:** `bool` -------- .. method:: HasFontFaceName() Returns ``True`` if the attribute object specifies a font face name. | **Returns:** `bool` -------- .. method:: HasFontItalic() Returns ``True`` if the attribute object specifies italic style. | **Returns:** `bool` -------- .. method:: HasFontSize() Returns ``True`` if the attribute object specifies a font point size. | **Returns:** `bool` -------- .. method:: HasFontUnderlined() Returns ``True`` if the attribute object specifies either underlining or no underlining. | **Returns:** `bool` -------- .. method:: HasFontWeight() Returns ``True`` if the attribute object specifies font weight (bold, light or normal). | **Returns:** `bool` -------- .. method:: HasLeftIndent() Returns ``True`` if the attribute object specifies a left indent. | **Returns:** `bool` -------- .. method:: HasLineSpacing() Returns ``True`` if the attribute object specifies line spacing. | **Returns:** `bool` -------- .. method:: HasListStyleName() Returns ``True`` if the attribute object specifies a list style name. | **Returns:** `bool` -------- .. method:: HasOutlineLevel() Returns ``True`` if the attribute object specifies an outline level. | **Returns:** `bool` -------- .. method:: HasPageBreak() Returns ``True`` if the attribute object specifies a page break before this paragraph. | **Returns:** `bool` -------- .. method:: HasParagraphSpacingAfter() Returns ``True`` if the attribute object specifies spacing after a paragraph. | **Returns:** `bool` -------- .. method:: HasParagraphSpacingBefore() Returns ``True`` if the attribute object specifies spacing before a paragraph. | **Returns:** `bool` -------- .. method:: HasParagraphStyleName() Returns ``True`` if the attribute object specifies a paragraph style name. | **Returns:** `bool` -------- .. method:: HasRightIndent() Returns ``True`` if the attribute object specifies a right indent. | **Returns:** `bool` -------- .. method:: HasTabs() Returns ``True`` if the attribute object specifies tab stops. | **Returns:** `bool` -------- .. method:: HasTextColour() Returns ``True`` if the attribute object specifies a text foreground colour. | **Returns:** `bool` -------- .. method:: HasTextEffects() Returns ``True`` if the attribute object specifies text effects. | **Returns:** `bool` -------- .. method:: HasURL() Returns ``True`` if the attribute object specifies a URL. | **Returns:** `bool` -------- .. method:: IsCharacterStyle() Returns ``True`` if the object represents a character style, that is, the flags specify a font or a text background or foreground colour. | **Returns:** `bool` -------- .. method:: IsDefault() Returns ``False`` if we have any attributes set, ``True`` otherwise. | **Returns:** `bool` -------- .. method:: IsParagraphStyle() Returns ``True`` if the object represents a paragraph style, that is, the flags specify alignment, indentation, tabs, paragraph spacing, or bullet style. | **Returns:** `bool` -------- .. method:: SetAlignment(alignment) Sets the paragraph alignment. These are the possible values for `alignment`: * ``wx.TEXT_ALIGNMENT_DEFAULT`` * ``wx.TEXT_ALIGNMENT_LEFT`` * ``wx.TEXT_ALIGNMENT_CENTRE`` * ``wx.TEXT_ALIGNMENT_CENTER`` = ``wx.TEXT_ALIGNMENT_CENTRE`` * ``wx.TEXT_ALIGNMENT_RIGHT`` * ``wx.TEXT_ALIGNMENT_JUSTIFIED`` Of these, ``wx.TEXT_ALIGNMENT_JUSTIFIED`` is unimplemented. In future justification may be supported when printing or previewing, only. | **Parameters:** * `alignment` (int) -------- .. method:: SetBackgroundColour(colBack) Sets the background colour. **Parameters:** * `colBack` (`wx.Colour <../Widgets/wx.Colour.html>`_) -------- .. method:: SetBulletFont(font) Sets the name of the font associated with the bullet symbol. Only valid for attributes with ``wx.richtext.TEXT_ATTR_BULLET_SYMBOL``. **Parameters:** * `font` (`wx.Font <../Widgets/wx.Font.html>`_) -------- .. method:: SetBulletName(name) Sets the standard bullet name, applicable if the bullet style is ``wx.richtext.TEXT_ATTR_BULLET_STYLE_STANDARD``. See `GetBulletName <#GetBulletName>`_ for a list of supported names, and how to expand the range of supported types. **Parameters:** * `name` (string) -------- .. method:: SetBulletNumber(n) Sets the bullet number. **Parameters:** * `n` (int) -------- .. method:: SetBulletStyle(style) Sets the bullet style. The following styles can be passed: ============================================================= ======================= Bullet Style Flags Value ============================================================= ======================= ``wx.richtext.TEXT_ATTR_BULLET_STYLE_NONE`` 0x00000000 ``wx.richtext.TEXT_ATTR_BULLET_STYLE_ARABIC`` 0x00000001 ``wx.richtext.TEXT_ATTR_BULLET_STYLE_LETTERS_UPPER`` 0x00000002 ``wx.richtext.TEXT_ATTR_BULLET_STYLE_LETTERS_LOWER`` 0x00000004 ``wx.richtext.TEXT_ATTR_BULLET_STYLE_ROMAN_UPPER`` 0x00000008 ``wx.richtext.TEXT_ATTR_BULLET_STYLE_ROMAN_LOWER`` 0x00000010 ``wx.richtext.TEXT_ATTR_BULLET_STYLE_SYMBOL`` 0x00000020 ``wx.richtext.TEXT_ATTR_BULLET_STYLE_BITMAP`` 0x00000040 ``wx.richtext.TEXT_ATTR_BULLET_STYLE_PARENTHESES`` 0x00000080 ``wx.richtext.TEXT_ATTR_BULLET_STYLE_PERIOD`` 0x00000100 ``wx.richtext.TEXT_ATTR_BULLET_STYLE_STANDARD`` 0x00000200 ``wx.richtext.TEXT_ATTR_BULLET_STYLE_RIGHT_PARENTHESIS`` 0x00000400 ``wx.richtext.TEXT_ATTR_BULLET_STYLE_OUTLINE`` 0x00000800 ``wx.richtext.TEXT_ATTR_BULLET_STYLE_ALIGN_LEFT`` 0x00000000 ``wx.richtext.TEXT_ATTR_BULLET_STYLE_ALIGN_RIGHT`` 0x00001000 ``wx.richtext.TEXT_ATTR_BULLET_STYLE_ALIGN_CENTRE`` 0x00002000 ============================================================= ======================= Of these, ``wx.richtext.TEXT_ATTR_BULLET_STYLE_BITMAP`` is unimplemented. **Parameters:** * `style` (int) -------- .. method:: SetBulletText(text) Sets the bullet text, which could be a symbol, or (for example) cached outline text. **Parameters:** * `text` (string) -------- .. method:: SetCharacterStyleName(name) Sets the character style name. **Parameters:** * `name` (string) -------- .. method:: SetFlags(flags) Sets the flags determining which styles are being specified. The following flags can be passed in a bitlist: ==================================================== ======================= Standard Constants Value ==================================================== ======================= ``wx.TEXT_ATTR_TEXT_COLOUR`` 0x00000001 ``wx.TEXT_ATTR_BACKGROUND_COLOUR`` 0x00000002 ``wx.TEXT_ATTR_FONT_FACE`` 0x00000004 ``wx.TEXT_ATTR_FONT_SIZE`` 0x00000008 ``wx.TEXT_ATTR_FONT_WEIGHT`` 0x00000010 ``wx.TEXT_ATTR_FONT_ITALIC`` 0x00000020 ``wx.TEXT_ATTR_FONT_UNDERLINE`` 0x00000040 ``wx.TEXT_ATTR_FONT`` ``wx.TEXT_ATTR_FONT_FACE`` | ``wx.TEXT_ATTR_FONT_SIZE`` | ``wx.TEXT_ATTR_FONT_WEIGHT`` | ``wx.TEXT_ATTR_FONT_ITALIC`` | ``wx.TEXT_ATTR_FONT_UNDERLINE`` ``wx.TEXT_ATTR_ALIGNMENT`` 0x00000080 ``wx.TEXT_ATTR_LEFT_INDENT`` 0x00000100 ``wx.TEXT_ATTR_RIGHT_INDENT`` 0x00000200 ``wx.TEXT_ATTR_TABS`` 0x00000400 ==================================================== ======================= | These are available by importing `wx.richtext`: ==================================================== ======================= Extra Formatting Flags Value ==================================================== ======================= ``wx.richtext.TEXT_ATTR_PARA_SPACING_AFTER`` 0x00000800 ``wx.richtext.TEXT_ATTR_PARA_SPACING_BEFORE`` 0x00001000 ``wx.richtext.TEXT_ATTR_LINE_SPACING`` 0x00002000 ``wx.richtext.TEXT_ATTR_CHARACTER_STYLE_NAME`` 0x00004000 ``wx.richtext.TEXT_ATTR_PARAGRAPH_STYLE_NAME`` 0x00008000 ``wx.richtext.TEXT_ATTR_LIST_STYLE_NAME`` 0x00010000 ``wx.richtext.TEXT_ATTR_BULLET_STYLE`` 0x00020000 ``wx.richtext.TEXT_ATTR_BULLET_NUMBER`` 0x00040000 ``wx.richtext.TEXT_ATTR_BULLET_TEXT`` 0x00080000 ``wx.richtext.TEXT_ATTR_BULLET_NAME`` 0x00100000 ``wx.richtext.TEXT_ATTR_URL`` 0x00200000 ``wx.richtext.TEXT_ATTR_PAGE_BREAK`` 0x00400000 ``wx.richtext.TEXT_ATTR_EFFECTS`` 0x00800000 ``wx.richtext.TEXT_ATTR_OUTLINE_LEVEL`` 0x01000000 ==================================================== ======================= | **Parameters:** * `flags` (int) -------- .. method:: SetFontFaceName(faceName) Sets the font face name. **Parameters:** * `faceName` (string) -------- .. method:: SetFontSize(pointSize) Sets the font size in points. **Parameters:** * `pointSize` (int) -------- .. method:: SetFontStyle(fontStyle) Sets the font style (normal, italic or slanted). **Parameters:** * `fontStyle` (int) -------- .. method:: SetFontUnderlined(underlined) Sets the font underlining. **Parameters:** * `underlined` (bool) -------- .. method:: SetFontWeight(fontWeight) Sets the font weight. **Parameters:** * `fontWeight` (int) -------- .. method:: SetLeftIndent(indent, subIndent=0) Sets the left indent and left subindent in tenths of a millimetre. The sub-indent is an offset from the left of the paragraph, and is used for all but the first line in a paragraph. A positive value will cause the first line to appear to the left of the subsequent lines, and a negative value will cause the first line to be indented relative to the subsequent lines. `wx.richtext.RichTextBuffer `_ uses indentation to render a bulleted item. The left indent is the distance between the margin and the bullet. The content of the paragraph, including the first line, starts at `leftMargin` + `leftSubIndent`. So the distance between the left edge of the bullet and the left of the actual paragraph is `leftSubIndent`. **Parameters:** * `indent` (int) * `subIndent` (int) -------- .. method:: SetLineSpacing(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: ============================================================= ======================= Line Spacing Flags Value ============================================================= ======================= ``wx.richtext.TEXT_ATTR_LINE_SPACING_NORMAL`` 10 ``wx.richtext.TEXT_ATTR_LINE_SPACING_HALF`` 15 ``wx.richtext.TEXT_ATTR_LINE_SPACING_TWICE`` 20 ============================================================= ======================= **Parameters:** * `spacing` (int) -------- .. method:: SetListStyleName(name) Sets the list style name. **Parameters:** * `name` (string) -------- .. method:: SetOutlineLevel(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. **Parameters:** * `level` (int) -------- .. method:: SetPageBreak(pageBreak=True) Specifies a page break before this paragraph. **Parameters:** * `pageBreak` (bool) -------- .. method:: SetParagraphSpacingAfter(spacing) Sets the spacing after a paragraph, in tenths of a millimetre. **Parameters:** * `spacing` (int) -------- .. method:: SetParagraphSpacingBefore(spacing) Sets the spacing before a paragraph, in tenths of a millimetre. **Parameters:** * `spacing` (int) -------- .. method:: SetParagraphStyleName(name) Sets the name of the paragraph style. **Parameters:** * `name` (string) -------- .. method:: SetRightIndent(indent) Sets the right indent in tenths of a millimetre. **Parameters:** * `indent` (int) -------- .. method:: SetTabs(tabs) Sets the tab stops, expressed in tenths of a millimetre. Each stop is measured from the left margin and therefore each value must be larger than the last. **Parameters:** * `tabs` (list of integers) -------- .. method:: SetTextColour(colText) Sets the text foreground colout. **Parameters:** * `colText` (`wx.Colour <../Widgets/wx.Colour.html>`_) -------- .. method:: SetTextEffectFlags(flags) Sets the text effect bits of interest. You should also pass ``wx.richtext.TEXT_ATTR_EFFECTS`` to `SetFlags <#SetFlags>`_. See `SetFlags <#SetFlags>`_ for further information. **Parameters:** * `flags` (int) -------- .. method:: SetTextEffects(effects) Sets the text effects, a bit list of styles. The following styles can be passed: ============================================================= ======================= Text Effects Flags Value ============================================================= ======================= ``wx.richtext.TEXT_ATTR_EFFECT_NONE`` 0x00000000 ``wx.richtext.TEXT_ATTR_EFFECT_CAPITALS`` 0x00000001 ``wx.richtext.TEXT_ATTR_EFFECT_SMALL_CAPITALS`` 0x00000002 ``wx.richtext.TEXT_ATTR_EFFECT_STRIKETHROUGH`` 0x00000004 ``wx.richtext.TEXT_ATTR_EFFECT_DOUBLE_STRIKETHROUGH`` 0x00000008 ``wx.richtext.TEXT_ATTR_EFFECT_SHADOW`` 0x00000010 ``wx.richtext.TEXT_ATTR_EFFECT_EMBOSS`` 0x00000020 ``wx.richtext.TEXT_ATTR_EFFECT_OUTLINE`` 0x00000040 ``wx.richtext.TEXT_ATTR_EFFECT_ENGRAVE`` 0x00000080 ``wx.richtext.TEXT_ATTR_EFFECT_SUPERSCRIPT`` 0x00000100 ``wx.richtext.TEXT_ATTR_EFFECT_SUBSCRIPT`` 0x00000200 ============================================================= ======================= Of these, only ``wx.richtext.TEXT_ATTR_EFFECT_CAPITALS`` and ``wx.richtext.TEXT_ATTR_EFFECT_STRIKETHROUGH`` are implemented. ``wx.richtext.TEXT_ATTR_EFFECT_CAPITALS`` capitalises text when displayed (leaving the case of the actual buffer text unchanged), and ``wx.richtext.TEXT_ATTR_EFFECT_STRIKETHROUGH`` draws a line through text. To set effects, you should also pass ``wx.richtext.TEXT_ATTR_EFFECTS`` to `SetFlags <#SetFlags>`_, and call `SetTextEffectFlags <#SetTextEffectFlags>`_ with the styles (taken from the above set) that you are interested in setting. **Parameters:** * `effects` (int) -------- .. method:: SetURL(url) Sets the URL for the content. Sets the ``wx.richtext.TEXT_ATTR_URL style``. Content with ``wx.richtext.TEXT_ATTR_URL`` style causes `wx.richtext.RichTextCtrl `_ to show a hand cursor over it, and `wx.richtext.RichTextCtrl` generates a `wx.TextUrlEvent` when the content is clicked. **Parameters:** * `url` (string) -------- Properties ^^^^^^^^^^ .. attribute:: Alignment See `GetAlignment`_ and `SetAlignment`_ .. attribute:: BackgroundColour See `GetBackgroundColour`_ and `SetBackgroundColour`_ .. attribute:: BulletFont See `GetBulletFont`_ and `SetBulletFont`_ .. attribute:: BulletName See `GetBulletName`_ and `SetBulletName`_ .. attribute:: BulletNumber See `GetBulletNumber`_ and `SetBulletNumber`_ .. attribute:: BulletStyle See `GetBulletStyle`_ and `SetBulletStyle`_ .. attribute:: BulletText See `GetBulletText`_ and `SetBulletText`_ .. attribute:: CharacterStyleName See `GetCharacterStyleName`_ and `SetCharacterStyleName`_ .. attribute:: Flags See `GetFlags`_ and `SetFlags`_ .. attribute:: Font See `GetFont`_ .. attribute:: LeftIndent See `GetLeftIndent`_ and `SetLeftIndent`_ .. attribute:: LeftSubIndent See `GetLeftSubIndent`_ .. attribute:: LineSpacing See `GetLineSpacing`_ and `SetLineSpacing`_ .. attribute:: ListStyleName See `GetListStyleName`_ and `SetListStyleName`_ .. attribute:: OutlineLevel See `GetOutlineLevel`_ and `SetOutlineLevel`_ .. attribute:: ParagraphSpacingAfter See `GetParagraphSpacingAfter`_ and `SetParagraphSpacingAfter`_ .. attribute:: ParagraphSpacingBefore See `GetParagraphSpacingBefore`_ and `SetParagraphSpacingBefore`_ .. attribute:: ParagraphStyleName See `GetParagraphStyleName`_ and `SetParagraphStyleName`_ .. attribute:: RightIndent See `GetRightIndent`_ and `SetRightIndent`_ .. attribute:: Tabs See `GetTabs`_ and `SetTabs`_ .. attribute:: TextColour See `GetTextColour`_ and `SetTextColour`_ .. attribute:: TextEffectFlags See `GetTextEffectFlags`_ and `SetTextEffectFlags`_ .. attribute:: TextEffects See `GetTextEffects`_ and `SetTextEffects`_ .. attribute:: URL See `GetURL`_ and `SetURL`_