.. 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() 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. .. method:: AddCharacterStyle(self, styleDef) Adds a definition to the character style list. :param `styleDef`: :type `styleDef`: wx.richtext.RichTextCharacterStyleDefinition :rtype: `bool` .. method:: AddListStyle(self, styleDef) Adds a definition to the list style list. :param `styleDef`: :type `styleDef`: wx.richtext.RichTextListStyleDefinition :rtype: `bool` .. method:: AddParagraphStyle(self, styleDef) Adds a definition to the paragraph style list. :param `styleDef`: :type `styleDef`: wx.richtext.RichTextParagraphStyleDefinition :rtype: `bool` .. method:: AddStyle(self, styleDef) Adds a definition to the appropriate style list. :param `styleDef`: :type `styleDef`: wx.richtext.RichTextStyleDefinition :rtype: `bool` .. method:: DeleteStyles(self) Deletes all styles. .. method:: FindCharacterStyle(self, name, recurse=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, recurse=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, recurse=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) Finds a style definition by name. :param `name`: :type `name`: string :rtype: :ref:`wx.richtext.RichTextStyleDefinition` .. method:: GetCharacterStyle(self, n) 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: `string` .. method:: GetListStyle(self, n) 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: `string` .. method:: GetParagraphStyle(self, n) 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, deleteStyle=False) Removes a character style. :param `styleDef`: :type `styleDef`: wx.richtext.RichTextStyleDefinition :param `deleteStyle`: :type `deleteStyle`: bool :rtype: `bool` .. method:: RemoveListStyle(self, styleDef, deleteStyle=False) Removes a list style. :param `styleDef`: :type `styleDef`: wx.richtext.RichTextStyleDefinition :param `deleteStyle`: :type `deleteStyle`: bool :rtype: `bool` .. method:: RemoveParagraphStyle(self, styleDef, deleteStyle=False) Removes a paragraph style. :param `styleDef`: :type `styleDef`: wx.richtext.RichTextStyleDefinition :param `deleteStyle`: :type `deleteStyle`: bool :rtype: `bool` .. method:: RemoveStyle(self, styleDef, deleteStyle=False) Removes a style. :param `styleDef`: :type `styleDef`: wx.richtext.RichTextStyleDefinition :param `deleteStyle`: :type `deleteStyle`: bool :rtype: `bool` .. method:: SetDescription(self, descr) Sets the style sheet's description. :param `descr`: :type `descr`: string .. method:: SetName(self, name) Sets the style sheet's name. :param `name`: :type `name`: string .. method:: SetProperties(self, props) Sets the sheet's properties. :param `props`: :type `props`: wx.richtext.RichTextProperties .. 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`