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.
Methods Summary¶__init__ |
Constructor. |
AddCharacterStyle |
Adds a definition to the character style list. |
AddListStyle |
Adds a definition to the list style list. |
AddParagraphStyle |
Adds a definition to the paragraph style list. |
AddStyle |
Adds a definition to the appropriate style list. |
DeleteStyles |
Deletes all styles. |
FindCharacterStyle |
Finds a character definition by name. |
FindListStyle |
Finds a list definition by name. |
FindParagraphStyle |
Finds a paragraph definition by name. |
FindStyle |
Finds a style definition by name. |
GetCharacterStyle |
Returns the nth character style. |
GetCharacterStyleCount |
Returns the number of character styles. |
GetDescription |
Returns the style sheet’s description. |
GetListStyle |
Returns the nth list style. |
GetListStyleCount |
Returns the number of list styles. |
GetName |
Returns the style sheet’s name. |
GetParagraphStyle |
Returns the nth paragraph style. |
GetParagraphStyleCount |
Returns the number of paragraph styles. |
GetProperties |
Returns the sheet’s properties. |
RemoveCharacterStyle |
Removes a character style. |
RemoveListStyle |
Removes a list style. |
RemoveParagraphStyle |
Removes a paragraph style. |
RemoveStyle |
Removes a style. |
SetDescription |
Sets the style sheet’s description. |
SetName |
Sets the style sheet’s name. |
SetProperties |
Sets the sheet’s properties. |
Properties Summary¶
Class API¶wx.richtext.RichTextStyleSheet(Object)¶Possible constructors:
RichTextStyleSheet()
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.
AddCharacterStyle(self, styleDef)¶Adds a definition to the character style list.
| Parameters: | styleDef (wx.richtext.RichTextCharacterStyleDefinition) – |
|---|---|
| Return type: | bool |
AddListStyle(self, styleDef)¶Adds a definition to the list style list.
| Parameters: | styleDef (wx.richtext.RichTextListStyleDefinition) – |
|---|---|
| Return type: | bool |
AddParagraphStyle(self, styleDef)¶Adds a definition to the paragraph style list.
| Parameters: | styleDef (wx.richtext.RichTextParagraphStyleDefinition) – |
|---|---|
| Return type: | bool |
AddStyle(self, styleDef)¶Adds a definition to the appropriate style list.
| Parameters: | styleDef (wx.richtext.RichTextStyleDefinition) – |
|---|---|
| Return type: | bool |
DeleteStyles(self)¶Deletes all styles.
FindCharacterStyle(self, name, recurse=True)¶Finds a character definition by name.
| Parameters: |
|
|---|---|
| Return type: |
FindListStyle(self, name, recurse=True)¶Finds a list definition by name.
| Parameters: |
|
|---|---|
| Return type: |
FindParagraphStyle(self, name, recurse=True)¶Finds a paragraph definition by name.
| Parameters: |
|
|---|---|
| Return type: |
FindStyle(self, name)¶Finds a style definition by name.
| Parameters: | name (string) – |
|---|---|
| Return type: | wx.richtext.RichTextStyleDefinition |
GetCharacterStyle(self, n)¶Returns the nth character style.
| Parameters: | n (int) – |
|---|---|
| Return type: | wx.richtext.RichTextCharacterStyleDefinition |
GetCharacterStyleCount(self)¶Returns the number of character styles.
| Return type: | int |
|---|
GetDescription(self)¶Returns the style sheet’s description.
| Return type: | string |
|---|
GetListStyle(self, n)¶Returns the nth list style.
| Parameters: | n (int) – |
|---|---|
| Return type: | wx.richtext.RichTextListStyleDefinition |
GetListStyleCount(self)¶Returns the number of list styles.
| Return type: | int |
|---|
GetName(self)¶Returns the style sheet’s name.
| Return type: | string |
|---|
GetParagraphStyle(self, n)¶Returns the nth paragraph style.
| Parameters: | n (int) – |
|---|---|
| Return type: | wx.richtext.RichTextParagraphStyleDefinition |
GetParagraphStyleCount(self)¶Returns the number of paragraph styles.
| Return type: | int |
|---|
GetProperties(self)¶Returns the sheet’s properties.
| Return type: | wx.richtext.RichTextProperties |
|---|
RemoveCharacterStyle(self, styleDef, deleteStyle=False)¶Removes a character style.
| Parameters: |
|
|---|---|
| Return type: | bool |
RemoveListStyle(self, styleDef, deleteStyle=False)¶Removes a list style.
| Parameters: |
|
|---|---|
| Return type: | bool |
RemoveParagraphStyle(self, styleDef, deleteStyle=False)¶Removes a paragraph style.
| Parameters: |
|
|---|---|
| Return type: | bool |
RemoveStyle(self, styleDef, deleteStyle=False)¶Removes a style.
| Parameters: |
|
|---|---|
| Return type: | bool |
SetDescription(self, descr)¶Sets the style sheet’s description.
| Parameters: | descr (string) – |
|---|
SetName(self, name)¶Sets the style sheet’s name.
| Parameters: | name (string) – |
|---|
SetProperties(self, props)¶Sets the sheet’s properties.
| Parameters: | props (wx.richtext.RichTextProperties) – |
|---|
CharacterStyleCount¶Description¶See GetDescription and SetDescription
ListStyleCount¶ParagraphStyleCount¶Properties¶See GetProperties and SetProperties