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.
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. |
See |
|
See |
|
See |
wx.richtext.
RichTextStyleOrganiserDialog
(Dialog)¶Possible constructors:
RichTextStyleOrganiserDialog()
RichTextStyleOrganiserDialog(flags, sheet, ctrl, parent, id=ID_ANY,
caption=_("StyleOrganiser"), pos=DefaultPosition, size=DefaultSize,
style=DEFAULT_DIALOG_STYLE|RESIZE_BORDER|SYSTEM_MENU|CLOSE_BOX)
This class shows a style sheet and allows the user to edit, add and remove styles.
__init__
(self, *args, **kw)¶__init__ (self)
Default constructor.
__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
: 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.
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) –
ApplyStyle
(self, ctrl=None)¶Applies the selected style to selection in the given control or the control passed to the constructor.
ctrl (wx.richtext.RichTextCtrl) –
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.
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) –
bool
GetClassDefaultAttributes
(variant=WINDOW_VARIANT_NORMAL)¶variant (WindowVariant) –
VisualAttributes
GetFlags
(self)¶Returns the flags used to control the interface presented to the user.
int
GetRestartNumbering
(self)¶Returns True
if the user has opted to restart numbering.
bool
GetRichTextCtrl
(self)¶Returns the associated rich text control (if any).
GetSelectedStyle
(self)¶Returns selected style name.
string
GetSelectedStyleDefinition
(self)¶Returns selected style definition.
GetStyleSheet
(self)¶Returns the associated style sheet.
SetFlags
(self, flags)¶Sets the flags used to control the interface presented to the user.
flags (int) –
SetRestartNumbering
(self, restartNumbering)¶Checks or unchecks the restart numbering checkbox.
restartNumbering (bool) –
SetRichTextCtrl
(self, ctrl)¶Sets the control to be associated with the dialog, for the purposes of applying a style to the selection.
ctrl (wx.richtext.RichTextCtrl) –
SetShowToolTips
(show)¶Determines whether tooltips will be shown.
show (bool) –
SetStyleSheet
(self, sheet)¶Sets the associated style sheet.
sheet (wx.richtext.RichTextStyleSheet) –
RestartNumbering
¶RichTextCtrl
¶See GetRichTextCtrl
and SetRichTextCtrl
SelectedStyle
¶See GetSelectedStyle
SelectedStyleDefinition
¶StyleSheet
¶See GetStyleSheet
and SetStyleSheet