wx.TextAttr¶
wx.TextAttr represents the character and paragraph attributes, or style, for a range of text in a wx.TextCtrl or wx.richtext.RichTextCtrl.
Unless explicitly mentioned, the attributes are only implemented in wx.richtext.RichTextCtrl, and not wx.TextCtrl.
When setting up a wx.TextAttr object, pass a bitlist mask to wx.TextAttr.SetFlags
to indicate which style elements should be changed. As a convenience, when you call a setter such as SetFont, the relevant bit will be set.
See also
Class Hierarchy¶
Known Subclasses¶
Methods Summary¶
Constructors. |
|
Applies the attributes in style to the original object, but not those attributes from style that are the same as those in compareWith (if passed). |
|
Partial equality test. |
|
Returns the alignment flags. |
|
Returns the background colour. |
|
Returns a string containing the name of the font associated with the bullet symbol. |
|
Returns the standard bullet name, applicable if the bullet style is |
|
Returns the bullet number. |
|
Returns the bullet style. |
|
Returns the bullet text, which could be a symbol, or (for example) cached outline text. |
|
Returns the name of the character style. |
|
Returns flags indicating which attributes are applicable. |
|
Creates and returns a font specified by the font attributes in the wx.TextAttr object. |
|
Gets the font attributes from the given font, using only the attributes specified by flags. |
|
Returns the font encoding. |
|
Returns the font face name. |
|
Returns the font family. |
|
Returns the font size in points. |
|
Returns the font style. |
|
Returns |
|
Returns the font weight. |
|
Returns the left indent in tenths of a millimetre. |
|
Returns the left sub-indent in tenths of a millimetre. |
|
Returns the line spacing value, one of wx.TextAttrLineSpacing values. |
|
Returns the name of the list style. |
|
Returns the outline level. |
|
Returns the space in tenths of a millimeter after the paragraph. |
|
Returns the space in tenths of a millimeter before the paragraph. |
|
Returns the name of the paragraph style. |
|
Returns the right indent in tenths of a millimeter. |
|
Returns an array of tab stops, each expressed in tenths of a millimeter. |
|
Returns the text foreground colour. |
|
Returns the text effect bits of interest. |
|
Returns the text effects, a bit list of styles. |
|
Returns the URL for the content. |
|
Returns the underline color used. |
|
Returns the underline type, which is one of the TextAttrUnderlineType values. |
|
Returns |
|
Returns |
|
Returns |
|
Returns |
|
Returns |
|
Returns |
|
Returns |
|
Returns |
|
Returns |
|
Returns |
|
Returns |
|
Returns |
|
Returns |
|
Returns |
|
Returns |
|
Returns |
|
Returns |
|
Returns |
|
Returns |
|
Returns |
|
Returns |
|
Returns |
|
Returns |
|
Returns |
|
Returns |
|
Returns |
|
Returns |
|
Returns |
|
Returns |
|
Returns |
|
Returns |
|
Returns |
|
Returns |
|
Returns |
|
Copies all defined/valid properties from overlay to current object. |
|
Sets the paragraph alignment. |
|
Sets the background colour. |
|
Sets the name of the font associated with the bullet symbol. |
|
Sets the standard bullet name, applicable if the bullet style is |
|
Sets the bullet number. |
|
Sets the bullet style. |
|
Sets the bullet text, which could be a symbol, or (for example) cached outline text. |
|
Sets the character style name. |
|
Sets the flags determining which styles are being specified. |
|
Sets the attributes for the given font. |
|
Sets the font encoding. |
|
Sets the font face name. |
|
Sets the font family. |
|
Sets the font size in pixels. |
|
Sets the font size in points. |
|
Sets the font size in points. |
|
Sets the font style (normal, italic or slanted). |
|
Sets the font underlining (solid line, text colour). |
|
Sets the font underlining. |
|
Sets the font weight. |
|
Sets the left indent and left subindent in tenths of a millimetre. |
|
Sets the line spacing. |
|
Sets the list style name. |
|
Specifies the outline level. |
|
Specifies a page break before this paragraph. |
|
Sets the spacing after a paragraph, in tenths of a millimetre. |
|
Sets the spacing before a paragraph, in tenths of a millimetre. |
|
Sets the name of the paragraph style. |
|
Sets the right indent in tenths of a millimetre. |
|
Sets the tab stops, expressed in tenths of a millimetre. |
|
Sets the text foreground colour. |
|
Sets the text effect bits of interest. |
|
Sets the text effects, a bit list of styles. |
|
Sets the URL for the content. |
Properties Summary¶
See |
|
See |
|
See |
|
See |
|
See |
|
See |
|
See |
|
See |
|
See |
|
See |
|
See |
|
See |
|
See |
|
See |
|
See |
|
See |
|
See |
|
See |
|
See |
|
See |
|
See |
|
See |
|
See |
Class API¶
- class wx.TextAttr(object)¶
Possible constructors:
TextAttr() -> None TextAttr(colText, colBack=NullColour, font=NullFont, alignment=TEXT_ALIGNMENT_DEFAULT) -> None TextAttr(attr) -> None
TextAttr represents the character and paragraph attributes, or style, for a range of text in a TextCtrl or RichTextCtrl.
Methods¶
- __init__(self, *args, **kw)¶
Constructors.
__init__ (self)
- Return type:
None
__init__ (self, colText, colBack=NullColour, font=NullFont, alignment=TEXT_ALIGNMENT_DEFAULT)
- Parameters:
colText (wx.Colour)
colBack (wx.Colour)
font (wx.Font)
alignment (TextAttrAlignment)
- Return type:
None
__init__ (self, attr)
- Parameters:
attr (wx.TextAttr)
- Return type:
None
- Apply(self, style, compareWith=None)¶
Applies the attributes in style to the original object, but not those attributes from style that are the same as those in compareWith (if passed).
- Parameters:
style (wx.TextAttr)
compareWith (wx.TextAttr)
- Return type:
bool
- EqPartial(self, attr, weakTest=True)¶
Partial equality test.
If weakTest is
True
, attributes of this object do not have to be present if those attributes ofattr
are present. If weakTest isFalse
, the function will fail if an attribute is present inattr
but not in this object.- Parameters:
attr (wx.TextAttr)
weakTest (bool)
- Return type:
bool
- GetAlignment(self)¶
Returns the alignment flags.
See wx.TextAttrAlignment for a list of available styles.
For wx.TextCtrl, is implemented under wxMSW, wxOSX and wxGTK. Also implemented in wx.richtext.RichTextCtrl.
- Return type:
- GetBackgroundColour(self)¶
Returns the background colour.
For wx.TextCtrl, is implemented under wxMSW, wxOSX and wxGTK. Also implemented in wx.richtext.RichTextCtrl.
- Return type:
- GetBulletFont(self)¶
Returns a string containing the name of the font associated with the bullet symbol.
Only valid for attributes with
TEXT_ATTR_BULLET_SYMBOL
.- Return type:
str
- GetBulletName(self)¶
Returns the standard bullet name, applicable if the bullet style is
wx.TEXT_ATTR_BULLET_STYLE_STANDARD
.Currently the following standard bullet names are supported:
standard/circle
standard/square
standard/diamond
standard/triangle
- Return type:
str
Note
For wx.richtext.RichTextCtrl users only: if you wish your rich text controls to support further bullet graphics, you can derive a class from wx.richtext.RichTextRenderer or wx.richtext.RichTextStdRenderer, override
DrawStandardBullet
andEnumerateStandardBulletNames
, and set an instance of the class usingwx.richtext.RichTextBuffer.SetRenderer
.
- GetBulletNumber(self)¶
Returns the bullet number.
For wx.TextCtrl, is implemented under wxMSW. Also implemented in wx.richtext.RichTextCtrl.
- Return type:
int
- GetBulletStyle(self)¶
Returns the bullet style.
See wx.TextAttrBulletStyle for a list of available styles.
For wx.TextCtrl, is implemented under wxMSW. Also implemented in wx.richtext.RichTextCtrl.
- Return type:
int
- GetBulletText(self)¶
Returns the bullet text, which could be a symbol, or (for example) cached outline text.
- Return type:
str
- GetCharacterStyleName(self)¶
Returns the name of the character style.
- Return type:
str
- GetFlags(self)¶
Returns flags indicating which attributes are applicable.
See
SetFlags
for a list of available flags.- Return type:
int
- GetFont(self)¶
Creates and returns a font specified by the font attributes in the wx.TextAttr object.
Note that wx.TextAttr does not store a wx.Font object, so this is only a temporary font.
For greater efficiency, access the font attributes directly.
For wx.TextCtrl, is implemented under wxMSW, wxOSX and wxGTK. Also implemented in wx.richtext.RichTextCtrl.
- Return type:
- GetFontAttributes(self, font, flags=TEXT_ATTR_FONT)¶
Gets the font attributes from the given font, using only the attributes specified by flags.
- Parameters:
font (wx.Font)
flags (int)
- Return type:
bool
- GetFontEncoding(self)¶
Returns the font encoding.
- Return type:
- GetFontFaceName(self)¶
Returns the font face name.
- Return type:
str
- GetFontFamily(self)¶
Returns the font family.
- Return type:
- GetFontSize(self)¶
Returns the font size in points.
- Return type:
int
- GetFontStyle(self)¶
Returns the font style.
- Return type:
- GetFontUnderlined(self)¶
Returns
True
if the font is underlined.- Return type:
bool
- GetFontWeight(self)¶
Returns the font weight.
- Return type:
- GetLeftIndent(self)¶
Returns the left indent in tenths of a millimetre.
For wx.TextCtrl, is implemented under wxMSW and wxGTK. Also implemented in wx.richtext.RichTextCtrl.
- Return type:
int
- GetLeftSubIndent(self)¶
Returns the left sub-indent in tenths of a millimetre.
For wx.TextCtrl, is implemented under wxMSW and wxGTK. Also implemented in wx.richtext.RichTextCtrl.
- Return type:
int
- GetLineSpacing(self)¶
Returns the line spacing value, one of wx.TextAttrLineSpacing values.
For wx.TextCtrl, is implemented under wxMSW. Also implemented in wx.richtext.RichTextCtrl.
- Return type:
int
- GetListStyleName(self)¶
Returns the name of the list style.
- Return type:
str
- GetOutlineLevel(self)¶
Returns the outline level.
- Return type:
int
- GetParagraphSpacingAfter(self)¶
Returns the space in tenths of a millimeter after the paragraph.
For wx.TextCtrl, is implemented under wxMSW. Also implemented in wx.richtext.RichTextCtrl.
- Return type:
int
- GetParagraphSpacingBefore(self)¶
Returns the space in tenths of a millimeter before the paragraph.
For wx.TextCtrl, is implemented under wxMSW. Also implemented in wx.richtext.RichTextCtrl.
- Return type:
int
- GetParagraphStyleName(self)¶
Returns the name of the paragraph style.
- Return type:
str
- GetRightIndent(self)¶
Returns the right indent in tenths of a millimeter.
For wx.TextCtrl, is implemented under wxMSW. Also implemented in wx.richtext.RichTextCtrl.
- Return type:
int
- GetTabs(self)¶
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.
For wx.TextCtrl, is implemented under wxMSW and wxGTK. Also implemented in wx.richtext.RichTextCtrl.
- Return type:
List[int]
- GetTextColour(self)¶
Returns the text foreground colour.
For wx.TextCtrl, is implemented under wxMSW, wxOSX and wxGTK. Also implemented in wx.richtext.RichTextCtrl.
- Return type:
- GetTextEffectFlags(self)¶
Returns the text effect bits of interest.
See
SetFlags
for further information.- Return type:
int
- GetTextEffects(self)¶
Returns the text effects, a bit list of styles.
See
SetTextEffects
for details.- Return type:
int
- GetURL(self)¶
Returns the URL for the content.
Content with
wx.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.- Return type:
str
- GetUnderlineColour(self)¶
Returns the underline color used.
NullColour when the text colour is used.
For wx.TextCtrl, is implemented under wxMSW, wxOSX and wxGTK. Also implemented in wx.richtext.RichTextCtrl.
- Return type:
Added in version 4.1/wxWidgets-3.1.3.
- GetUnderlineType(self)¶
Returns the underline type, which is one of the TextAttrUnderlineType values.
For wx.TextCtrl, is implemented under wxMSW, wxOSX and wxGTK. Also implemented in wx.richtext.RichTextCtrl.
- Return type:
Added in version 4.1/wxWidgets-3.1.3.
- HasAlignment(self)¶
Returns
True
if the attribute object specifies alignment.For wx.TextCtrl, is implemented under wxMSW, wxOSX and wxGTK. Also implemented in wx.richtext.RichTextCtrl.
- Return type:
bool
- HasBackgroundColour(self)¶
Returns
True
if the attribute object specifies a background colour.For wx.TextCtrl, is implemented under wxMSW, wxOSX and wxGTK. Also implemented in wx.richtext.RichTextCtrl.
- Return type:
bool
- HasBulletName(self)¶
Returns
True
if the attribute object specifies a standard bullet name.- Return type:
bool
- HasBulletNumber(self)¶
Returns
True
if the attribute object specifies a bullet number.For wx.TextCtrl, is implemented under wxMSW. Also implemented in wx.richtext.RichTextCtrl.
- Return type:
bool
- HasBulletStyle(self)¶
Returns
True
if the attribute object specifies a bullet style.For wx.TextCtrl, is implemented under wxMSW. Also implemented in wx.richtext.RichTextCtrl.
- Return type:
bool
- HasBulletText(self)¶
Returns
True
if the attribute object specifies bullet text (usually specifying a symbol).- Return type:
bool
- HasCharacterStyleName(self)¶
Returns
True
if the attribute object specifies a character style name.- Return type:
bool
- HasFlag(self, flag)¶
Returns
True
if the flag is present in the attribute object’s flag bitlist.- Parameters:
flag (long)
- Return type:
bool
- HasFont(self)¶
Returns
True
if the attribute object specifies any font attributes.For wx.TextCtrl, is implemented under wxMSW, wxOSX and wxGTK. Also implemented in wx.richtext.RichTextCtrl.
- Return type:
bool
- HasFontEncoding(self)¶
Returns
True
if the attribute object specifies an encoding.- Return type:
bool
- HasFontFaceName(self)¶
Returns
True
if the attribute object specifies a font face name.- Return type:
bool
- HasFontFamily(self)¶
Returns
True
if the attribute object specifies a font family.- Return type:
bool
- HasFontItalic(self)¶
Returns
True
if the attribute object specifies italic style.- Return type:
bool
- HasFontPixelSize(self)¶
Returns
True
if the attribute object specifies a font pixel size.- Return type:
bool
- HasFontPointSize(self)¶
Returns
True
if the attribute object specifies a font point size.- Return type:
bool
- HasFontSize(self)¶
Returns
True
if the attribute object specifies a font point or pixel size.- Return type:
bool
- HasFontUnderlined(self)¶
Returns
True
if the attribute object specifies either underlining or no underlining.- Return type:
bool
- HasFontWeight(self)¶
Returns
True
if the attribute object specifies font weight (bold, light or normal).- Return type:
bool
- HasLeftIndent(self)¶
Returns
True
if the attribute object specifies a left indent.For wx.TextCtrl, is implemented under wxMSW and wxGTK. Also implemented in wx.richtext.RichTextCtrl.
- Return type:
bool
- HasLineSpacing(self)¶
Returns
True
if the attribute object specifies line spacing.For wx.TextCtrl, is implemented under wxMSW and wxOSX. Also implemented in wx.richtext.RichTextCtrl.
- Return type:
bool
- HasListStyleName(self)¶
Returns
True
if the attribute object specifies a list style name.- Return type:
bool
- HasOutlineLevel(self)¶
Returns
True
if the attribute object specifies an outline level.- Return type:
bool
- HasPageBreak(self)¶
Returns
True
if the attribute object specifies a page break before this paragraph.- Return type:
bool
- HasParagraphSpacingAfter(self)¶
Returns
True
if the attribute object specifies spacing after a paragraph.For wx.TextCtrl, is implemented under wxMSW. Also implemented in wx.richtext.RichTextCtrl.
- Return type:
bool
- HasParagraphSpacingBefore(self)¶
Returns
True
if the attribute object specifies spacing before a paragraph.For wx.TextCtrl, is implemented under wxMSW and wxGTK. Also implemented in wx.richtext.RichTextCtrl.
- Return type:
bool
- HasParagraphStyleName(self)¶
Returns
True
if the attribute object specifies a paragraph style name.- Return type:
bool
- HasRightIndent(self)¶
Returns
True
if the attribute object specifies a right indent.- Return type:
bool
- HasTabs(self)¶
Returns
True
if the attribute object specifies tab stops.For wx.TextCtrl, is implemented under wxMSW and wxGTK. Also implemented in wx.richtext.RichTextCtrl.
- Return type:
bool
- HasTextColour(self)¶
Returns
True
if the attribute object specifies a text foreground colour.For wx.TextCtrl, is implemented under wxMSW, wxOSX and wxGTK. Also implemented in wx.richtext.RichTextCtrl.
- Return type:
bool
- HasTextEffects(self)¶
Returns
True
if the attribute object specifies text effects.- Return type:
bool
- HasURL(self)¶
Returns
True
if the attribute object specifies a URL.- Return type:
bool
- IsCharacterStyle(self)¶
Returns
True
if the object represents a character style, that is, the flags specify a font or a text background or foreground colour.- Return type:
bool
- IsDefault(self)¶
Returns
False
if we have any attributes set,True
otherwise.- Return type:
bool
- IsParagraphStyle(self)¶
Returns
True
if the object represents a paragraph style, that is, the flags specify alignment, indentation, tabs, paragraph spacing, or bullet style.- Return type:
bool
- Merge(self, *args, **kw)¶
-
Merge (self, overlay)
Copies all defined/valid properties from overlay to current object.
- Parameters:
overlay (wx.TextAttr)
- Return type:
None
Merge (base, overlay)
Creates a new wx.TextAttr which is a merge of base and overlay.
Properties defined in overlay take precedence over those in base. Properties undefined/invalid in both are undefined in the result.
- Parameters:
base (wx.TextAttr)
overlay (wx.TextAttr)
- Return type:
- SetAlignment(self, alignment)¶
Sets the paragraph alignment.
See wx.TextAttrAlignment enumeration values.
wx.TEXT_ALIGNMENT_JUSTIFIED
is not implemented for wx.richtext.RichTextCtrl. In the future, wx.richtext.RichTextCtrl justification may be supported when printing or previewing only.For wx.TextCtrl, is implemented under wxMSW, wxOSX and wxGTK. Also implemented in wx.richtext.RichTextCtrl.
- Parameters:
alignment (TextAttrAlignment)
- Return type:
None
- SetBackgroundColour(self, colBack)¶
Sets the background colour.
For wx.TextCtrl, is implemented under wxMSW, wxOSX and wxGTK. Also implemented in wx.richtext.RichTextCtrl.
- Parameters:
colBack (wx.Colour)
- Return type:
None
- SetBulletFont(self, font)¶
Sets the name of the font associated with the bullet symbol.
Only valid for attributes with
TEXT_ATTR_BULLET_SYMBOL
.- Parameters:
font (string)
- Return type:
None
- SetBulletName(self, name)¶
Sets the standard bullet name, applicable if the bullet style is
wx.TEXT_ATTR_BULLET_STYLE_STANDARD
.See
GetBulletName
for a list of supported names, and how to expand the range of supported types.- Parameters:
name (string)
- Return type:
None
- SetBulletNumber(self, n)¶
Sets the bullet number.
For wx.TextCtrl, is implemented under wxMSW. Also implemented in wx.richtext.RichTextCtrl.
- Parameters:
n (int)
- Return type:
None
- SetBulletStyle(self, style)¶
Sets the bullet style.
For wx.TextCtrl, is implemented under wxMSW. Also implemented in wx.richtext.RichTextCtrl.
For wx.richtext.RichTextCtrl, the wx.TextAttrBulletStyle enumeration values are all supported, except for
wx.TEXT_ATTR_BULLET_STYLE_BITMAP
.For wx.TextCtrl under wxMSW, the wx.TextAttrBulletStyle enumeration values are all supported, except for
wx.TEXT_ATTR_BULLET_STYLE_BITMAP
,wx.TEXT_ATTR_BULLET_STYLE_OUTLINE
,wx.TEXT_ATTR_BULLET_STYLE_ALIGN_LEFT
,wx.TEXT_ATTR_BULLET_STYLE_ALIGN_RIGHT
,wx.TEXT_ATTR_BULLET_STYLE_ALIGN_CENTRE
, andwx.TEXT_ATTR_BULLET_STYLE_CONTINUATION
.- Parameters:
style (int)
- Return type:
None
- SetBulletText(self, text)¶
Sets the bullet text, which could be a symbol, or (for example) cached outline text.
- Parameters:
text (string)
- Return type:
None
- SetCharacterStyleName(self, name)¶
Sets the character style name.
- Parameters:
name (string)
- Return type:
None
- SetFlags(self, flags)¶
Sets the flags determining which styles are being specified.
The wx.TextAttrFlags values can be passed in a bitlist.
- Parameters:
flags (long)
- Return type:
None
- SetFont(self, font, flags=TEXT_ATTR_FONT & ~wxTEXT_ATTR_FONT_PIXEL_SIZE)¶
Sets the attributes for the given font.
Note that wx.TextAttr does not store an actual wx.Font object.
For wx.TextCtrl, is implemented under wxMSW, wxOSX and wxGTK. Also implemented in wx.richtext.RichTextCtrl.
- Parameters:
font (wx.Font)
flags (int)
- Return type:
None
- SetFontEncoding(self, encoding)¶
Sets the font encoding.
- Parameters:
encoding (FontEncoding)
- Return type:
None
- SetFontFaceName(self, faceName)¶
Sets the font face name.
- Parameters:
faceName (string)
- Return type:
None
- SetFontFamily(self, family)¶
Sets the font family.
- Parameters:
family (FontFamily)
- Return type:
None
- SetFontPixelSize(self, pixelSize)¶
Sets the font size in pixels.
- Parameters:
pixelSize (int)
- Return type:
None
- SetFontPointSize(self, pointSize)¶
Sets the font size in points.
- Parameters:
pointSize (int)
- Return type:
None
- SetFontSize(self, pointSize)¶
Sets the font size in points.
- Parameters:
pointSize (int)
- Return type:
None
- SetFontStyle(self, fontStyle)¶
Sets the font style (normal, italic or slanted).
- Parameters:
fontStyle (FontStyle)
- Return type:
None
- SetFontUnderlined(self, underlined)¶
Sets the font underlining (solid line, text colour).
- Parameters:
underlined (bool)
- Return type:
None
- SetFontUnderlineType(self, type, colour=NullColour)¶
Sets the font underlining.
- Parameters:
type (TextAttrUnderlineType) – Type of underline.
colour (wx.Colour) – Colour to use for underlining, text colour is used by default.
- Return type:
None
Added in version 4.1/wxWidgets-3.1.3.
Note
On wxMSW,
wx.TEXT_ATTR_UNDERLINE_DOUBLE
is shown aswx.TEXT_ATTR_UNDERLINE_SOLID
. There is only a limited number of colours supported, theRGB
values are listed here.wx.TEXT_ATTR_UNDERLINE_SPECIAL
is shown as a waved line.Note
On wxGTK, underline colour is only supported by
GTK3
.wx.TEXT_ATTR_UNDERLINE_SPECIAL
is shown as a waved line. GTK might overrule the colour ofwx.TEXT_ATTR_UNDERLINE_SPECIAL
.Note
On wxOSX,
wx.TEXT_ATTR_UNDERLINE_SPECIAL
is shown as a dotted line.
- SetFontWeight(self, fontWeight)¶
Sets the font weight.
- Parameters:
fontWeight (FontWeight)
- Return type:
None
- SetLeftIndent(self, 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.
For wx.TextCtrl, is implemented under wxMSW and wxGTK. Also implemented in wx.richtext.RichTextCtrl.
- Parameters:
indent (int)
subIndent (int)
- Return type:
None
- SetLineSpacing(self, spacing)¶
Sets the line spacing.
spacing is a multiple, where 10 means single-spacing, 15 means 1.5 spacing, and 20 means float spacing. The wx.TextAttrLineSpacing values are defined for convenience.
For wx.TextCtrl, is implemented under wxMSW. Also implemented in wx.richtext.RichTextCtrl.
- Parameters:
spacing (int)
- Return type:
None
- SetListStyleName(self, name)¶
Sets the list style name.
- Parameters:
name (string)
- Return type:
None
- SetOutlineLevel(self, 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)
- Return type:
None
- SetPageBreak(self, pageBreak=True)¶
Specifies a page break before this paragraph.
- Parameters:
pageBreak (bool)
- Return type:
None
- SetParagraphSpacingAfter(self, spacing)¶
Sets the spacing after a paragraph, in tenths of a millimetre.
For wx.TextCtrl, is implemented under wxMSW. Also implemented in wx.richtext.RichTextCtrl.
- Parameters:
spacing (int)
- Return type:
None
- SetParagraphSpacingBefore(self, spacing)¶
Sets the spacing before a paragraph, in tenths of a millimetre.
For wx.TextCtrl, is implemented under wxMSW. Also implemented in wx.richtext.RichTextCtrl.
- Parameters:
spacing (int)
- Return type:
None
- SetParagraphStyleName(self, name)¶
Sets the name of the paragraph style.
- Parameters:
name (string)
- Return type:
None
- SetRightIndent(self, indent)¶
Sets the right indent in tenths of a millimetre.
- Parameters:
indent (int)
- Return type:
None
- SetTabs(self, 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.
For wx.TextCtrl, is implemented under wxMSW and wxGTK. Also implemented in wx.richtext.RichTextCtrl.
- Parameters:
tabs (list of integers)
- Return type:
None
- SetTextColour(self, colText)¶
Sets the text foreground colour.
- Parameters:
colText (wx.Colour)
- Return type:
None
- SetTextEffectFlags(self, flags)¶
Sets the text effect bits of interest.
You should also pass
wx.TEXT_ATTR_EFFECTS
toSetFlags
. SeeSetFlags
for further information.- Parameters:
flags (int)
- Return type:
None
- SetTextEffects(self, effects)¶
Sets the text effects, a bit list of styles.
The wx.TextAttrEffects enumeration values can be used.
Of these, only
wx.TEXT_ATTR_EFFECT_CAPITALS
,wx.TEXT_ATTR_EFFECT_STRIKETHROUGH
,wx.TEXT_ATTR_EFFECT_SUPERSCRIPT
andwx.TEXT_ATTR_EFFECT_SUBSCRIPT
are implemented.wx.TEXT_ATTR_EFFECT_CAPITALS
capitalises text when displayed (leaving the case of the actual buffer text unchanged), andwx.TEXT_ATTR_EFFECT_STRIKETHROUGH
draws a line through text.To set effects, you should also pass
wx.TEXT_ATTR_EFFECTS
toSetFlags
, and callSetTextEffectFlags
with the styles (taken from the above set) that you are interested in setting.- Parameters:
effects (int)
- Return type:
None
- SetURL(self, url)¶
Sets the URL for the content.
Sets the
wx.TEXT_ATTR_URL
style; content with this 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)
- Return type:
None
Properties¶
- Alignment¶
See
GetAlignment
andSetAlignment
- BackgroundColour¶
- BulletFont¶
See
GetBulletFont
andSetBulletFont
- BulletName¶
See
GetBulletName
andSetBulletName
- BulletNumber¶
See
GetBulletNumber
andSetBulletNumber
- BulletStyle¶
See
GetBulletStyle
andSetBulletStyle
- BulletText¶
See
GetBulletText
andSetBulletText
- CharacterStyleName¶
- FontEncoding¶
See
GetFontEncoding
andSetFontEncoding
- FontFaceName¶
See
GetFontFaceName
andSetFontFaceName
- FontFamily¶
See
GetFontFamily
andSetFontFamily
- FontSize¶
See
GetFontSize
andSetFontSize
- FontStyle¶
See
GetFontStyle
andSetFontStyle
- FontUnderlined¶
See
GetFontUnderlined
andSetFontUnderlined
- FontWeight¶
See
GetFontWeight
andSetFontWeight
- LeftIndent¶
See
GetLeftIndent
andSetLeftIndent
- LeftSubIndent¶
See
GetLeftSubIndent
- LineSpacing¶
See
GetLineSpacing
andSetLineSpacing
- ListStyleName¶
See
GetListStyleName
andSetListStyleName
- OutlineLevel¶
See
GetOutlineLevel
andSetOutlineLevel
- ParagraphSpacingAfter¶
- ParagraphSpacingBefore¶
- ParagraphStyleName¶
- RightIndent¶
See
GetRightIndent
andSetRightIndent
- TextColour¶
See
GetTextColour
andSetTextColour
- TextEffectFlags¶
See
GetTextEffectFlags
andSetTextEffectFlags
- TextEffects¶
See
GetTextEffects
andSetTextEffects
- UnderlineColour¶
- UnderlineType¶
See
GetUnderlineType