This dialog allows the user to edit a character and/or paragraph style.
In the constructor, specify the pages that will be created. Use wx.richtext.RichTextFormattingDialog.GetStyle
to retrieve the common style for a given range, and then use wx.richtext.RichTextFormattingDialog.ApplyStyle
to apply the user-selected formatting to a control.
For example:
if self.richTextCtrl.HasSelection():
range = self.richTextCtrl.GetSelectionRange()
else:
range = wx.RichTextRange(0, self.richTextCtrl.GetLastPosition()+1)
pages = wx.richtext.RICHTEXT_FORMAT_FONT \
| wx.richtext.RICHTEXT_FORMAT_INDENTS_SPACING \
| wx.richtext.RICHTEXT_FORMAT_TABS \
| wx.richtext.RICHTEXT_FORMAT_BULLETS
with wx.richtext.RichTextFormattingDialog(pages, self) as dlg:
dlg.GetStyle(self.richTextCtrl, range)
if dlg.ShowModal() == wx.ID_OK:
dlg.ApplyStyle(self.richTextCtrl, range)
Default constructor. |
|
Apply attributes to the given range, only changing attributes that need to be changed. |
|
Creation: see wx.richtext.RichTextFormattingDialog “the constructor” for details about the parameters. |
|
Gets the attributes being edited. |
|
Helper for pages to get the top-level dialog. |
|
Helper for pages to get the attributes. |
|
Helper for pages to get the style. |
|
Returns the object to be used to customize the dialog and provide pages. |
|
Returns the image list associated with the dialog, used for example if showing the dialog as a toolbook. |
|
Gets the dialog options, determining what the interface presents to the user. |
|
Gets common attributes from the given range and calls |
|
Gets the associated style definition, if any. |
|
Gets the associated style sheet, if any. |
|
Returns |
|
Sets the attributes to be edited. |
|
Sets the formatting factory object to be used for customization and page creation. |
|
Sets the image list associated with the dialog’s property sheet. |
|
Sets the dialog options, determining what the interface presents to the user. |
|
Sets the attributes and optionally updates the display, if update is |
|
Sets the style definition and optionally update the display, if update is |
|
Updates the display. |
See |
|
See |
|
See |
|
See |
|
See |
Possible constructors:
RichTextFormattingDialog()
RichTextFormattingDialog(flags, parent, title="Formatting", id=ID_ANY,
pos=DefaultPosition, sz=DefaultSize, style=DEFAULT_DIALOG_STYLE)
This dialog allows the user to edit a character and/or paragraph style.
__init__ (self)
Default constructor.
__init__ (self, flags, parent, title=”Formatting”, id=ID_ANY, pos=DefaultPosition, sz=DefaultSize, style=DEFAULT_DIALOG_STYLE)
Constructors.
Apply attributes to the given range, only changing attributes that need to be changed.
ctrl (wx.richtext.RichTextCtrl) –
range (wx.richtext.RichTextRange) –
flags (int) –
bool
Creation: see wx.richtext.RichTextFormattingDialog “the constructor” for details about the parameters.
Gets the attributes being edited.
TextAttr
variant (WindowVariant) –
VisualAttributes
Helper for pages to get the top-level dialog.
win (wx.Window) –
Helper for pages to get the attributes.
win (wx.Window) –
TextAttr
Helper for pages to get the style.
win (wx.Window) –
Returns the object to be used to customize the dialog and provide pages.
Returns the image list associated with the dialog, used for example if showing the dialog as a toolbook.
Gets the dialog options, determining what the interface presents to the user.
Currently the only option is Option_AllowPixelFontSize.
int
Gets common attributes from the given range and calls SetAttributes
.
Attributes that do not have common values in the given range will be omitted from the style’s flags.
ctrl (wx.richtext.RichTextCtrl) –
range (wx.richtext.RichTextRange) –
bool
Gets the associated style definition, if any.
Gets the associated style sheet, if any.
Returns True
if the given option is present.
option (int) –
bool
Sets the attributes to be edited.
attr (wx.TextAttr) –
Sets the formatting factory object to be used for customization and page creation.
It deletes the existing factory object.
factory (wx.richtext.RichTextFormattingDialogFactory) –
Sets the image list associated with the dialog’s property sheet.
imageList (wx.ImageList) –
Sets the dialog options, determining what the interface presents to the user.
Currently the only option is Option_AllowPixelFontSize.
options (int) –
Sets the attributes and optionally updates the display, if update is True
.
style (wx.TextAttr) –
update (bool) –
bool
Sets the style definition and optionally update the display, if update is True
.
styleDef (wx.richtext.RichTextStyleDefinition) –
sheet (wx.richtext.RichTextStyleSheet) –
update (bool) –
bool
Updates the display.
bool
See GetAttributes
and SetAttributes
See GetImageList
and SetImageList
See GetOptions
and SetOptions
See GetStyleDefinition
and SetStyleDefinition
See GetStyleSheet