.. wxPython Phoenix documentation
This file was generated by Phoenix's sphinx generator and associated
tools, do not edit by hand.
Copyright: (c) 2011-2020 by Total Control Software
License: wxWindows License
.. include:: headings.inc
.. _wx.richtext.RichTextStyleSheet:
==========================================================================================================================================
|phoenix_title| **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 :ref:`wx.richtext.RichTextCtrl`.
You can use a :ref:`wx.richtext.RichTextStyleListBox` in your user interface to show available styles to the user, and allow application of styles to the control.
|
|class_hierarchy| Class Hierarchy
=================================
.. raw:: html

Inheritance diagram for class
RichTextStyleSheet:
|
|method_summary| Methods Summary
================================
================================================================================ ================================================================================
:meth:`~wx.richtext.RichTextStyleSheet.__init__` Constructor.
:meth:`~wx.richtext.RichTextStyleSheet.AddCharacterStyle` Adds a definition to the character style list.
:meth:`~wx.richtext.RichTextStyleSheet.AddListStyle` Adds a definition to the list style list.
:meth:`~wx.richtext.RichTextStyleSheet.AddParagraphStyle` Adds a definition to the paragraph style list.
:meth:`~wx.richtext.RichTextStyleSheet.AddStyle` Adds a definition to the appropriate style list.
:meth:`~wx.richtext.RichTextStyleSheet.DeleteStyles` Deletes all styles.
:meth:`~wx.richtext.RichTextStyleSheet.FindCharacterStyle` Finds a character definition by name.
:meth:`~wx.richtext.RichTextStyleSheet.FindListStyle` Finds a list definition by name.
:meth:`~wx.richtext.RichTextStyleSheet.FindParagraphStyle` Finds a paragraph definition by name.
:meth:`~wx.richtext.RichTextStyleSheet.FindStyle` Finds a style definition by name.
:meth:`~wx.richtext.RichTextStyleSheet.GetCharacterStyle` Returns the `nth` character style.
:meth:`~wx.richtext.RichTextStyleSheet.GetCharacterStyleCount` Returns the number of character styles.
:meth:`~wx.richtext.RichTextStyleSheet.GetDescription` Returns the style sheet's description.
:meth:`~wx.richtext.RichTextStyleSheet.GetListStyle` Returns the `nth` list style.
:meth:`~wx.richtext.RichTextStyleSheet.GetListStyleCount` Returns the number of list styles.
:meth:`~wx.richtext.RichTextStyleSheet.GetName` Returns the style sheet's name.
:meth:`~wx.richtext.RichTextStyleSheet.GetParagraphStyle` Returns the `nth` paragraph style.
:meth:`~wx.richtext.RichTextStyleSheet.GetParagraphStyleCount` Returns the number of paragraph styles.
:meth:`~wx.richtext.RichTextStyleSheet.GetProperties` Returns the sheet's properties.
:meth:`~wx.richtext.RichTextStyleSheet.RemoveCharacterStyle` Removes a character style.
:meth:`~wx.richtext.RichTextStyleSheet.RemoveListStyle` Removes a list style.
:meth:`~wx.richtext.RichTextStyleSheet.RemoveParagraphStyle` Removes a paragraph style.
:meth:`~wx.richtext.RichTextStyleSheet.RemoveStyle` Removes a style.
:meth:`~wx.richtext.RichTextStyleSheet.SetDescription` Sets the style sheet's description.
:meth:`~wx.richtext.RichTextStyleSheet.SetName` Sets the style sheet's name.
:meth:`~wx.richtext.RichTextStyleSheet.SetProperties` Sets the sheet's properties.
================================================================================ ================================================================================
|
|property_summary| Properties Summary
=====================================
================================================================================ ================================================================================
:attr:`~wx.richtext.RichTextStyleSheet.CharacterStyleCount` See :meth:`~wx.richtext.RichTextStyleSheet.GetCharacterStyleCount`
:attr:`~wx.richtext.RichTextStyleSheet.Description` See :meth:`~wx.richtext.RichTextStyleSheet.GetDescription` and :meth:`~wx.richtext.RichTextStyleSheet.SetDescription`
:attr:`~wx.richtext.RichTextStyleSheet.ListStyleCount` See :meth:`~wx.richtext.RichTextStyleSheet.GetListStyleCount`
:attr:`~wx.richtext.RichTextStyleSheet.Name` See :meth:`~wx.richtext.RichTextStyleSheet.GetName` and :meth:`~wx.richtext.RichTextStyleSheet.SetName`
:attr:`~wx.richtext.RichTextStyleSheet.ParagraphStyleCount` See :meth:`~wx.richtext.RichTextStyleSheet.GetParagraphStyleCount`
:attr:`~wx.richtext.RichTextStyleSheet.Properties` See :meth:`~wx.richtext.RichTextStyleSheet.GetProperties` and :meth:`~wx.richtext.RichTextStyleSheet.SetProperties`
================================================================================ ================================================================================
|
|api| 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.
.. method:: __init__(self)
Constructor.
:rtype: `None`
.. method:: AddCharacterStyle(self, styleDef : RichTextCharacterStyleDefinition)
Adds a definition to the character style list.
:param `styleDef`:
:type `styleDef`: wx.richtext.RichTextCharacterStyleDefinition
:rtype: `bool`
.. method:: AddListStyle(self, styleDef : RichTextListStyleDefinition)
Adds a definition to the list style list.
:param `styleDef`:
:type `styleDef`: wx.richtext.RichTextListStyleDefinition
:rtype: `bool`
.. method:: AddParagraphStyle(self, styleDef : RichTextParagraphStyleDefinition)
Adds a definition to the paragraph style list.
:param `styleDef`:
:type `styleDef`: wx.richtext.RichTextParagraphStyleDefinition
:rtype: `bool`
.. method:: AddStyle(self, styleDef : RichTextStyleDefinition)
Adds a definition to the appropriate style list.
:param `styleDef`:
:type `styleDef`: wx.richtext.RichTextStyleDefinition
:rtype: `bool`
.. method:: DeleteStyles(self)
Deletes all styles.
:rtype: `None`
.. method:: FindCharacterStyle(self, name : str, recurse: bool=True)
Finds a character definition by name.
:param `name`:
:type `name`: string
:param `recurse`:
:type `recurse`: bool
:rtype: :ref:`wx.richtext.RichTextCharacterStyleDefinition`
.. method:: FindListStyle(self, name : str, recurse: bool=True)
Finds a list definition by name.
:param `name`:
:type `name`: string
:param `recurse`:
:type `recurse`: bool
:rtype: :ref:`wx.richtext.RichTextListStyleDefinition`
.. method:: FindParagraphStyle(self, name : str, recurse: bool=True)
Finds a paragraph definition by name.
:param `name`:
:type `name`: string
:param `recurse`:
:type `recurse`: bool
:rtype: :ref:`wx.richtext.RichTextParagraphStyleDefinition`
.. method:: FindStyle(self, name : str)
Finds a style definition by name.
:param `name`:
:type `name`: string
:rtype: :ref:`wx.richtext.RichTextStyleDefinition`
.. method:: GetCharacterStyle(self, n : int)
Returns the `nth` character style.
:param `n`:
:type `n`: int
:rtype: :ref:`wx.richtext.RichTextCharacterStyleDefinition`
.. method:: GetCharacterStyleCount(self)
Returns the number of character styles.
:rtype: `int`
.. method:: GetDescription(self)
Returns the style sheet's description.
:rtype: `str`
.. method:: GetListStyle(self, n : int)
Returns the `nth` list style.
:param `n`:
:type `n`: int
:rtype: :ref:`wx.richtext.RichTextListStyleDefinition`
.. method:: GetListStyleCount(self)
Returns the number of list styles.
:rtype: `int`
.. method:: GetName(self)
Returns the style sheet's name.
:rtype: `str`
.. method:: GetParagraphStyle(self, n : int)
Returns the `nth` paragraph style.
:param `n`:
:type `n`: int
:rtype: :ref:`wx.richtext.RichTextParagraphStyleDefinition`
.. method:: GetParagraphStyleCount(self)
Returns the number of paragraph styles.
:rtype: `int`
.. method:: GetProperties(self)
Returns the sheet's properties.
:rtype: :ref:`wx.richtext.RichTextProperties`
.. method:: RemoveCharacterStyle(self, styleDef : RichTextStyleDefinition, deleteStyle: bool=False)
Removes a character style.
:param `styleDef`:
:type `styleDef`: wx.richtext.RichTextStyleDefinition
:param `deleteStyle`:
:type `deleteStyle`: bool
:rtype: `bool`
.. method:: RemoveListStyle(self, styleDef : RichTextStyleDefinition, deleteStyle: bool=False)
Removes a list style.
:param `styleDef`:
:type `styleDef`: wx.richtext.RichTextStyleDefinition
:param `deleteStyle`:
:type `deleteStyle`: bool
:rtype: `bool`
.. method:: RemoveParagraphStyle(self, styleDef : RichTextStyleDefinition, deleteStyle: bool=False)
Removes a paragraph style.
:param `styleDef`:
:type `styleDef`: wx.richtext.RichTextStyleDefinition
:param `deleteStyle`:
:type `deleteStyle`: bool
:rtype: `bool`
.. method:: RemoveStyle(self, styleDef : RichTextStyleDefinition, deleteStyle: bool=False)
Removes a style.
:param `styleDef`:
:type `styleDef`: wx.richtext.RichTextStyleDefinition
:param `deleteStyle`:
:type `deleteStyle`: bool
:rtype: `bool`
.. method:: SetDescription(self, descr : str)
Sets the style sheet's description.
:param `descr`:
:type `descr`: string
:rtype: `None`
.. method:: SetName(self, name : str)
Sets the style sheet's name.
:param `name`:
:type `name`: string
:rtype: `None`
.. method:: SetProperties(self, props : RichTextProperties)
Sets the sheet's properties.
:param `props`:
:type `props`: wx.richtext.RichTextProperties
:rtype: `None`
.. attribute:: CharacterStyleCount
See :meth:`~wx.richtext.RichTextStyleSheet.GetCharacterStyleCount`
.. attribute:: Description
See :meth:`~wx.richtext.RichTextStyleSheet.GetDescription` and :meth:`~wx.richtext.RichTextStyleSheet.SetDescription`
.. attribute:: ListStyleCount
See :meth:`~wx.richtext.RichTextStyleSheet.GetListStyleCount`
.. attribute:: Name
See :meth:`~wx.richtext.RichTextStyleSheet.GetName` and :meth:`~wx.richtext.RichTextStyleSheet.SetName`
.. attribute:: ParagraphStyleCount
See :meth:`~wx.richtext.RichTextStyleSheet.GetParagraphStyleCount`
.. attribute:: Properties
See :meth:`~wx.richtext.RichTextStyleSheet.GetProperties` and :meth:`~wx.richtext.RichTextStyleSheet.SetProperties`