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 wx.richtext.RichTextStyleComboCtrl or wx.richtext.RichTextStyleListCtrl to present styles.
Class Hierarchy¶
Methods Summary¶
Default constructor. |
|
Applies the selected style to selection in the given control or the control passed to the constructor. |
|
Creates the dialog. |
|
Returns the flags used to control the interface presented to the user. |
|
Returns |
|
Returns the associated rich text control (if any). |
|
Returns selected style name. |
|
Returns selected style definition. |
|
Returns the associated style sheet. |
|
Sets the flags used to control the interface presented to the user. |
|
Checks or unchecks the restart numbering checkbox. |
|
Sets the control to be associated with the dialog, for the purposes of applying a style to the selection. |
|
Determines whether tooltips will be shown. |
|
Sets the associated style sheet. |
Properties Summary¶
See |
|
See |
|
See |
Class API¶
- class wx.richtext.RichTextStyleOrganiserDialog(Dialog)¶
Possible constructors:
RichTextStyleOrganiserDialog() -> None RichTextStyleOrganiserDialog(flags, sheet, ctrl, parent, id=ID_ANY, caption=_("StyleOrganiser"), pos=DefaultPosition, size=DefaultSize, style=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.
Methods¶
- __init__(self, *args, **kw)¶
-
__init__ (self)
Default constructor.
- Return type:
None
__init__ (self, flags, sheet, ctrl, parent, id=ID_ANY, caption=_(“StyleOrganiser”), pos=DefaultPosition, size=DefaultSize, style=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
: Provideswx.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.
- Parameters:
flags (int)
sheet (wx.richtext.RichTextStyleSheet)
ctrl (wx.richtext.RichTextCtrl)
parent (wx.Window)
id (wx.WindowID)
caption (string)
pos (wx.Point)
size (wx.Size)
style (long)
- Return type:
None
- ApplyStyle(self, ctrl=None)¶
Applies the selected style to selection in the given control or the control passed to the constructor.
- Parameters:
ctrl (wx.richtext.RichTextCtrl)
- Return type:
bool
- Create(self, flags, sheet, ctrl, parent, id=ID_ANY, caption=GetTranslation('StyleOrganiser'), pos=DefaultPosition, size=Size(400, 300), style=DEFAULT_DIALOG_STYLE | RESIZE_BORDER | SYSTEM_MENU | CLOSE_BOX)¶
Creates the dialog.
See the constructor.
- Parameters:
flags (int)
sheet (wx.richtext.RichTextStyleSheet)
ctrl (wx.richtext.RichTextCtrl)
parent (wx.Window)
id (wx.WindowID)
caption (string)
pos (wx.Point)
size (wx.Size)
style (long)
- Return type:
bool
- static GetClassDefaultAttributes(variant=WINDOW_VARIANT_NORMAL)¶
- Parameters:
variant (WindowVariant)
- Return type:
VisualAttributes
- GetFlags(self)¶
Returns the flags used to control the interface presented to the user.
- Return type:
int
- GetRestartNumbering(self)¶
Returns
True
if the user has opted to restart numbering.- Return type:
bool
- GetRichTextCtrl(self)¶
Returns the associated rich text control (if any).
- Return type:
- GetSelectedStyle(self)¶
Returns selected style name.
- Return type:
str
- GetSelectedStyleDefinition(self)¶
Returns selected style definition.
- Return type:
- GetStyleSheet(self)¶
Returns the associated style sheet.
- Return type:
- SetFlags(self, flags)¶
Sets the flags used to control the interface presented to the user.
- Parameters:
flags (int)
- Return type:
None
- SetRestartNumbering(self, restartNumbering)¶
Checks or unchecks the restart numbering checkbox.
- Parameters:
restartNumbering (bool)
- Return type:
None
- SetRichTextCtrl(self, ctrl)¶
Sets the control to be associated with the dialog, for the purposes of applying a style to the selection.
- Parameters:
ctrl (wx.richtext.RichTextCtrl)
- Return type:
None
- static SetShowToolTips(show)¶
Determines whether tooltips will be shown.
- Parameters:
show (bool)
- Return type:
None
- SetStyleSheet(self, sheet)¶
Sets the associated style sheet.
- Parameters:
sheet (wx.richtext.RichTextStyleSheet)
- Return type:
None
Properties¶
- RestartNumbering¶
- RichTextCtrl¶
See
GetRichTextCtrl
andSetRichTextCtrl
- SelectedStyle¶
See
GetSelectedStyle
- SelectedStyleDefinition¶
- StyleSheet¶
See
GetStyleSheet
andSetStyleSheet