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¶
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¶
- class 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.
Methods¶
- __init__(self)¶
Constructor.
- Return type:
None
- 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.
- Return type:
None
- FindCharacterStyle(self, name, recurse=True)¶
Finds a character definition by name.
- Parameters:
name (string)
recurse (bool)
- Return type:
- FindListStyle(self, name, recurse=True)¶
Finds a list definition by name.
- Parameters:
name (string)
recurse (bool)
- Return type:
- FindParagraphStyle(self, name, recurse=True)¶
Finds a paragraph definition by name.
- Parameters:
name (string)
recurse (bool)
- Return type:
- FindStyle(self, name)¶
Finds a style definition by name.
- Parameters:
name (string)
- Return type:
- GetCharacterStyle(self, n)¶
Returns the nth character style.
- Parameters:
n (int)
- Return type:
- GetCharacterStyleCount(self)¶
Returns the number of character styles.
- Return type:
int
- GetDescription(self)¶
Returns the style sheet’s description.
- Return type:
str
- GetListStyle(self, n)¶
Returns the nth list style.
- Parameters:
n (int)
- Return type:
- GetListStyleCount(self)¶
Returns the number of list styles.
- Return type:
int
- GetName(self)¶
Returns the style sheet’s name.
- Return type:
str
- GetParagraphStyle(self, n)¶
Returns the nth paragraph style.
- Parameters:
n (int)
- Return type:
- GetParagraphStyleCount(self)¶
Returns the number of paragraph styles.
- Return type:
int
- GetProperties(self)¶
Returns the sheet’s properties.
- Return type:
- RemoveCharacterStyle(self, styleDef, deleteStyle=False)¶
Removes a character style.
- Parameters:
styleDef (wx.richtext.RichTextStyleDefinition)
deleteStyle (bool)
- Return type:
bool
- RemoveListStyle(self, styleDef, deleteStyle=False)¶
Removes a list style.
- Parameters:
styleDef (wx.richtext.RichTextStyleDefinition)
deleteStyle (bool)
- Return type:
bool
- RemoveParagraphStyle(self, styleDef, deleteStyle=False)¶
Removes a paragraph style.
- Parameters:
styleDef (wx.richtext.RichTextStyleDefinition)
deleteStyle (bool)
- Return type:
bool
- RemoveStyle(self, styleDef, deleteStyle=False)¶
Removes a style.
- Parameters:
styleDef (wx.richtext.RichTextStyleDefinition)
deleteStyle (bool)
- Return type:
bool
- SetDescription(self, descr)¶
Sets the style sheet’s description.
- Parameters:
descr (string)
- Return type:
None
- SetName(self, name)¶
Sets the style sheet’s name.
- Parameters:
name (string)
- Return type:
None
- SetProperties(self, props)¶
Sets the sheet’s properties.
- Parameters:
props (wx.richtext.RichTextProperties)
- Return type:
None
Properties¶
- CharacterStyleCount¶
- Description¶
See
GetDescription
andSetDescription
- ListStyleCount¶
- ParagraphStyleCount¶
- Properties¶
See
GetProperties
andSetProperties