wx.richtext.RichTextStyleSheet¶A style sheet contains named paragraph and character styles that make it easy for a user to apply combinations of attributes to a wx.richtext.RichTextCtrl.
You can use a wx.richtext.RichTextStyleListBox in your user interface to show available styles to the user, and allow application of styles to the control.
Class Hierarchy¶
Inheritance diagram for class RichTextStyleSheet:
Methods Summary¶Constructor. |
|
Adds a definition to the character style list. |
|
Adds a definition to the list style list. |
|
Adds a definition to the paragraph style list. |
|
Adds a definition to the appropriate style list. |
|
Deletes all styles. |
|
Finds a character definition by name. |
|
Finds a list definition by name. |
|
Finds a paragraph definition by name. |
|
Finds a style definition by name. |
|
Returns the nth character style. |
|
Returns the number of character styles. |
|
Returns the style sheet’s description. |
|
Returns the nth list style. |
|
Returns the number of list styles. |
|
Returns the style sheet’s name. |
|
Returns the nth paragraph style. |
|
Returns the number of paragraph styles. |
|
Returns the sheet’s properties. |
|
Removes a character style. |
|
Removes a list style. |
|
Removes a paragraph style. |
|
Removes a style. |
|
Sets the style sheet’s description. |
|
Sets the style sheet’s name. |
|
Sets the sheet’s properties. |
Properties Summary¶See |
|
See |
Class API¶wx.richtext.RichTextStyleSheet(Object)¶Possible constructors:
RichTextStyleSheet() -> None
A style sheet contains named paragraph and character styles that make it easy for a user to apply combinations of attributes to a RichTextCtrl.
__init__(self)¶Constructor.
None
AddCharacterStyle(self, styleDef : RichTextCharacterStyleDefinition)¶Adds a definition to the character style list.
styleDef (wx.richtext.RichTextCharacterStyleDefinition) –
bool
AddListStyle(self, styleDef : RichTextListStyleDefinition)¶Adds a definition to the list style list.
styleDef (wx.richtext.RichTextListStyleDefinition) –
bool
AddParagraphStyle(self, styleDef : RichTextParagraphStyleDefinition)¶Adds a definition to the paragraph style list.
styleDef (wx.richtext.RichTextParagraphStyleDefinition) –
bool
AddStyle(self, styleDef : RichTextStyleDefinition)¶Adds a definition to the appropriate style list.
styleDef (wx.richtext.RichTextStyleDefinition) –
bool
DeleteStyles(self)¶Deletes all styles.
None
FindCharacterStyle(self, name : str, recurse: bool=True)¶Finds a character definition by name.
name (string) –
recurse (bool) –
FindListStyle(self, name : str, recurse: bool=True)¶Finds a list definition by name.
name (string) –
recurse (bool) –
FindParagraphStyle(self, name : str, recurse: bool=True)¶Finds a paragraph definition by name.
name (string) –
recurse (bool) –
FindStyle(self, name : str)¶Finds a style definition by name.
name (string) –
GetCharacterStyle(self, n : int)¶Returns the nth character style.
n (int) –
GetCharacterStyleCount(self)¶Returns the number of character styles.
int
GetDescription(self)¶Returns the style sheet’s description.
str
GetListStyle(self, n : int)¶Returns the nth list style.
n (int) –
GetListStyleCount(self)¶Returns the number of list styles.
int
GetName(self)¶Returns the style sheet’s name.
str
GetParagraphStyle(self, n : int)¶Returns the nth paragraph style.
n (int) –
GetParagraphStyleCount(self)¶Returns the number of paragraph styles.
int
GetProperties(self)¶Returns the sheet’s properties.
RemoveCharacterStyle(self, styleDef : RichTextStyleDefinition, deleteStyle: bool=False)¶Removes a character style.
styleDef (wx.richtext.RichTextStyleDefinition) –
deleteStyle (bool) –
bool
RemoveListStyle(self, styleDef : RichTextStyleDefinition, deleteStyle: bool=False)¶Removes a list style.
styleDef (wx.richtext.RichTextStyleDefinition) –
deleteStyle (bool) –
bool
RemoveParagraphStyle(self, styleDef : RichTextStyleDefinition, deleteStyle: bool=False)¶Removes a paragraph style.
styleDef (wx.richtext.RichTextStyleDefinition) –
deleteStyle (bool) –
bool
RemoveStyle(self, styleDef : RichTextStyleDefinition, deleteStyle: bool=False)¶Removes a style.
styleDef (wx.richtext.RichTextStyleDefinition) –
deleteStyle (bool) –
bool
SetDescription(self, descr : str)¶Sets the style sheet’s description.
descr (string) –
None
SetName(self, name : str)¶Sets the style sheet’s name.
name (string) –
None
SetProperties(self, props : RichTextProperties)¶Sets the sheet’s properties.
props (wx.richtext.RichTextProperties) –
None
CharacterStyleCount¶Description¶See GetDescription and SetDescription
ListStyleCount¶ParagraphStyleCount¶Properties¶See GetProperties and SetProperties