.. 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.RichTextStyleOrganiserDialog:
==========================================================================================================================================
|phoenix_title| **wx.richtext.RichTextStyleOrganiserDialog**
==========================================================================================================================================
This class shows a style sheet and allows the user to edit, add and remove styles.
It can also be used as a style browser, for example if the application is not using a permanent :ref:`wx.richtext.RichTextStyleComboCtrl` or :ref:`wx.richtext.RichTextStyleListCtrl` to present styles.
|
|class_hierarchy| Class Hierarchy
=================================
.. raw:: html

Inheritance diagram for class
RichTextStyleOrganiserDialog:
|
|method_summary| Methods Summary
================================
================================================================================ ================================================================================
:meth:`~wx.richtext.RichTextStyleOrganiserDialog.__init__` Default constructor.
:meth:`~wx.richtext.RichTextStyleOrganiserDialog.ApplyStyle` Applies the selected style to selection in the given control or the control passed to the constructor.
:meth:`~wx.richtext.RichTextStyleOrganiserDialog.Create` Creates the dialog.
:meth:`~wx.richtext.RichTextStyleOrganiserDialog.GetClassDefaultAttributes`
:meth:`~wx.richtext.RichTextStyleOrganiserDialog.GetFlags` Returns the flags used to control the interface presented to the user.
:meth:`~wx.richtext.RichTextStyleOrganiserDialog.GetRestartNumbering` Returns ``True`` if the user has opted to restart numbering.
:meth:`~wx.richtext.RichTextStyleOrganiserDialog.GetRichTextCtrl` Returns the associated rich text control (if any).
:meth:`~wx.richtext.RichTextStyleOrganiserDialog.GetSelectedStyle` Returns selected style name.
:meth:`~wx.richtext.RichTextStyleOrganiserDialog.GetSelectedStyleDefinition` Returns selected style definition.
:meth:`~wx.richtext.RichTextStyleOrganiserDialog.GetStyleSheet` Returns the associated style sheet.
:meth:`~wx.richtext.RichTextStyleOrganiserDialog.SetFlags` Sets the flags used to control the interface presented to the user.
:meth:`~wx.richtext.RichTextStyleOrganiserDialog.SetRestartNumbering` Checks or unchecks the restart numbering checkbox.
:meth:`~wx.richtext.RichTextStyleOrganiserDialog.SetRichTextCtrl` Sets the control to be associated with the dialog, for the purposes of applying a style to the selection.
:meth:`~wx.richtext.RichTextStyleOrganiserDialog.SetShowToolTips` Determines whether tooltips will be shown.
:meth:`~wx.richtext.RichTextStyleOrganiserDialog.SetStyleSheet` Sets the associated style sheet.
================================================================================ ================================================================================
|
|property_summary| Properties Summary
=====================================
================================================================================ ================================================================================
:attr:`~wx.richtext.RichTextStyleOrganiserDialog.Flags` See :meth:`~wx.richtext.RichTextStyleOrganiserDialog.GetFlags` and :meth:`~wx.richtext.RichTextStyleOrganiserDialog.SetFlags`
:attr:`~wx.richtext.RichTextStyleOrganiserDialog.RestartNumbering` See :meth:`~wx.richtext.RichTextStyleOrganiserDialog.GetRestartNumbering` and :meth:`~wx.richtext.RichTextStyleOrganiserDialog.SetRestartNumbering`
:attr:`~wx.richtext.RichTextStyleOrganiserDialog.RichTextCtrl` See :meth:`~wx.richtext.RichTextStyleOrganiserDialog.GetRichTextCtrl` and :meth:`~wx.richtext.RichTextStyleOrganiserDialog.SetRichTextCtrl`
:attr:`~wx.richtext.RichTextStyleOrganiserDialog.SelectedStyle` See :meth:`~wx.richtext.RichTextStyleOrganiserDialog.GetSelectedStyle`
:attr:`~wx.richtext.RichTextStyleOrganiserDialog.SelectedStyleDefinition` See :meth:`~wx.richtext.RichTextStyleOrganiserDialog.GetSelectedStyleDefinition`
:attr:`~wx.richtext.RichTextStyleOrganiserDialog.StyleSheet` See :meth:`~wx.richtext.RichTextStyleOrganiserDialog.GetStyleSheet` and :meth:`~wx.richtext.RichTextStyleOrganiserDialog.SetStyleSheet`
================================================================================ ================================================================================
|
|api| Class API
===============
.. class:: wx.richtext.RichTextStyleOrganiserDialog(Dialog)
**Possible constructors**::
RichTextStyleOrganiserDialog() -> None
RichTextStyleOrganiserDialog(flags : int, sheet : RichTextStyleSheet,
ctrl : RichTextCtrl, parent : Window, id: int=ID_ANY, caption:
str=_("StyleOrganiser"), pos: Point=DefaultPosition, size:
Size=DefaultSize, style:
int=DEFAULT_DIALOG_STYLE|RESIZE_BORDER|SYSTEM_MENU|CLOSE_BOX) -> None
This class shows a style sheet and allows the user to edit, add and
remove styles.
.. method:: __init__(self, *args, **kw)
|overload| **Overloaded Implementations:**
:html:`
`
**__init__** `(self)`
Default constructor.
:rtype: `None`
:html:`
`
**__init__** `(self, flags : int, sheet : RichTextStyleSheet, ctrl : RichTextCtrl, parent : Window, id: int=ID_ANY, caption: str=_("StyleOrganiser"), pos: Point=DefaultPosition, size: Size=DefaultSize, style: int=DEFAULT_DIALOG_STYLE|RESIZE_BORDER|SYSTEM_MENU|CLOSE_BOX)`
Constructor.
To create a dialog, pass a bitlist of `flags` (see below), a style sheet, a text control to apply a selected style to (or ``None``), followed by the usual window parameters.
To specify the operations available to the user, pass a combination of these values to `flags:`
- ``wx.richtext.RICHTEXT_ORGANISER_DELETE_STYLES``: Provides a button for deleting styles.
- ``wx.richtext.RICHTEXT_ORGANISER_CREATE_STYLES``: Provides buttons for creating styles.
- ``wx.richtext.RICHTEXT_ORGANISER_APPLY_STYLES``: Provides a button for applying the currently selected style to the selection.
- ``wx.richtext.RICHTEXT_ORGANISER_EDIT_STYLES``: Provides a button for editing styles.
- ``wx.richtext.RICHTEXT_ORGANISER_RENAME_STYLES``: Provides a button for renaming styles.
- ``wx.richtext.RICHTEXT_ORGANISER_OK_CANCEL``: Provides ``wx.OK`` and Cancel buttons.
- ``wx.richtext.RICHTEXT_ORGANISER_RENUMBER``: Provides a checkbox for specifying that the selection should be renumbered.
The following flags determine what will be displayed in the style list:
- ``wx.richtext.RICHTEXT_ORGANISER_SHOW_CHARACTER``: Displays character styles only.
- ``wx.richtext.RICHTEXT_ORGANISER_SHOW_PARAGRAPH``: Displays paragraph styles only.
- ``wx.richtext.RICHTEXT_ORGANISER_SHOW_LIST``: Displays list styles only.
- ``wx.richtext.RICHTEXT_ORGANISER_SHOW_ALL``: Displays all styles.
The following symbols define commonly-used combinations of flags:
- ``wx.richtext.RICHTEXT_ORGANISER_ORGANISE``: Enable all style editing operations so the dialog behaves as a style organiser.
- ``wx.richtext.RICHTEXT_ORGANISER_BROWSE``: Show a list of all styles and their previews, but only allow application of a style or cancellation of the dialog. This makes the dialog behave as a style browser.
- ``wx.richtext.RICHTEXT_ORGANISER_BROWSE_NUMBERING``: Enables only list style browsing, plus a control to specify renumbering. This allows the dialog to be used for applying list styles to the selection.
:param `flags`:
:type `flags`: int
:param `sheet`:
:type `sheet`: wx.richtext.RichTextStyleSheet
:param `ctrl`:
:type `ctrl`: wx.richtext.RichTextCtrl
:param `parent`:
:type `parent`: wx.Window
:param `id`:
:type `id`: wx.WindowID
:param `caption`:
:type `caption`: string
:param `pos`:
:type `pos`: wx.Point
:param `size`:
:type `size`: wx.Size
:param `style`:
:type `style`: long
:rtype: `None`
:html:`
`
.. method:: ApplyStyle(self, ctrl: Optional[RichTextCtrl]=None)
Applies the selected style to selection in the given control or the control passed to the constructor.
:param `ctrl`:
:type `ctrl`: wx.richtext.RichTextCtrl
:rtype: `bool`
.. method:: Create(self, flags : int, sheet : RichTextStyleSheet, ctrl : RichTextCtrl, parent : Window, id: int=ID_ANY, caption: str=GetTranslation("StyleOrganiser"), pos: Point=DefaultPosition, size: Size=Size(400,300), style: int=DEFAULT_DIALOG_STYLE|RESIZE_BORDER|SYSTEM_MENU|CLOSE_BOX)
Creates the dialog.
See the constructor.
:param `flags`:
:type `flags`: int
:param `sheet`:
:type `sheet`: wx.richtext.RichTextStyleSheet
:param `ctrl`:
:type `ctrl`: wx.richtext.RichTextCtrl
:param `parent`:
:type `parent`: wx.Window
:param `id`:
:type `id`: wx.WindowID
:param `caption`:
:type `caption`: string
:param `pos`:
:type `pos`: wx.Point
:param `size`:
:type `size`: wx.Size
:param `style`:
:type `style`: long
:rtype: `bool`
.. staticmethod:: GetClassDefaultAttributes(variant: WindowVariant=WINDOW_VARIANT_NORMAL)
:param `variant`:
:type `variant`: wx.WindowVariant
:rtype: `VisualAttributes`
.. method:: GetFlags(self)
Returns the flags used to control the interface presented to the user.
:rtype: `int`
.. method:: GetRestartNumbering(self)
Returns ``True`` if the user has opted to restart numbering.
:rtype: `bool`
.. method:: GetRichTextCtrl(self)
Returns the associated rich text control (if any).
:rtype: :ref:`wx.richtext.RichTextCtrl`
.. method:: GetSelectedStyle(self)
Returns selected style name.
:rtype: `str`
.. method:: GetSelectedStyleDefinition(self)
Returns selected style definition.
:rtype: :ref:`wx.richtext.RichTextStyleDefinition`
.. method:: GetStyleSheet(self)
Returns the associated style sheet.
:rtype: :ref:`wx.richtext.RichTextStyleSheet`
.. method:: SetFlags(self, flags : int)
Sets the flags used to control the interface presented to the user.
:param `flags`:
:type `flags`: int
:rtype: `None`
.. method:: SetRestartNumbering(self, restartNumbering : bool)
Checks or unchecks the restart numbering checkbox.
:param `restartNumbering`:
:type `restartNumbering`: bool
:rtype: `None`
.. method:: SetRichTextCtrl(self, ctrl : RichTextCtrl)
Sets the control to be associated with the dialog, for the purposes of applying a style to the selection.
:param `ctrl`:
:type `ctrl`: wx.richtext.RichTextCtrl
:rtype: `None`
.. staticmethod:: SetShowToolTips(show : bool)
Determines whether tooltips will be shown.
:param `show`:
:type `show`: bool
:rtype: `None`
.. method:: SetStyleSheet(self, sheet : RichTextStyleSheet)
Sets the associated style sheet.
:param `sheet`:
:type `sheet`: wx.richtext.RichTextStyleSheet
:rtype: `None`
.. attribute:: Flags
See :meth:`~wx.richtext.RichTextStyleOrganiserDialog.GetFlags` and :meth:`~wx.richtext.RichTextStyleOrganiserDialog.SetFlags`
.. attribute:: RestartNumbering
See :meth:`~wx.richtext.RichTextStyleOrganiserDialog.GetRestartNumbering` and :meth:`~wx.richtext.RichTextStyleOrganiserDialog.SetRestartNumbering`
.. attribute:: RichTextCtrl
See :meth:`~wx.richtext.RichTextStyleOrganiserDialog.GetRichTextCtrl` and :meth:`~wx.richtext.RichTextStyleOrganiserDialog.SetRichTextCtrl`
.. attribute:: SelectedStyle
See :meth:`~wx.richtext.RichTextStyleOrganiserDialog.GetSelectedStyle`
.. attribute:: SelectedStyleDefinition
See :meth:`~wx.richtext.RichTextStyleOrganiserDialog.GetSelectedStyleDefinition`
.. attribute:: StyleSheet
See :meth:`~wx.richtext.RichTextStyleOrganiserDialog.GetStyleSheet` and :meth:`~wx.richtext.RichTextStyleOrganiserDialog.SetStyleSheet`