wxRuby Documentation Home

Wx::RichTextFormattingDialog

This dialog allows the user to edit a character and/or paragraph style.

In the constructor, specify the pages that will be created. Use GetStyle
to retrieve the common style for a given range, and then use ApplyStyle
to apply the user-selected formatting to a control. For example:

RichTextRange range; if (m_richTextCtrl→HasSelection()) range = m_richTextCtrl→GetSelectionRange(); else range = RichTextRange(0, m_richTextCtrl→GetLastPosition()+1); int pages = RICHTEXT_FORMAT_FONT|RICHTEXT_FORMAT_INDENTS_SPACING|RICHTEXT_FORMAT_TABS|RICHTEXT_FORMAT_BULLETS; RichTextFormattingDialog formatDlg(pages, this); formatDlg.GetStyle(m_richTextCtrl, range); if (formatDlg.ShowModal() == ID_OK) { formatDlg.ApplyStyle(m_richTextCtrl, range); }

Derived from

PropertySheetDialog

Data structures

The following flags passed to the dialog constructor indicate the pages to
be created:

#define RICHTEXT_FORMAT_STYLE_EDITOR 0×0001 #define RICHTEXT_FORMAT_FONT 0×0002 #define RICHTEXT_FORMAT_TABS 0×0004 #define RICHTEXT_FORMAT_BULLETS 0×0008 #define RICHTEXT_FORMAT_INDENTS_SPACING 0×0010

Methods

RichTextFormattingDialog.new

RichTextFormattingDialog.new(%(arg-type)Integer% flags, Window parent, String title = _(“Formatting”), Integer id = ID_ANY, Point pos = DEFAULT_POSITION, Size sz = DEFAULT_SIZE, Integer style = DEFAULT_DIALOG_STYLE)

Parameters

destructor()

Destructor.

RichTextFormattingDialog#apply_style

Boolean apply_style(%(arg-type)RichTextCtrl% ctrl, Range range, Integer flags = RICHTEXT_SETSTYLE_WITH_UNDO|RICHTEXT_SETSTYLE_OPTIMIZE)

Apply attributes to the given range, only changing attributes that need to be changed.

RichTextFormattingDialog#create

Boolean create(%(arg-type)Integer% flags, Window parent, String title, Integer id, Point pos = DEFAULT_POSITION, Size sz = DEFAULT_SIZE, Integer style = DEFAULT_DIALOG_STYLE)

Creation: see the constructor for details about the parameters.

RichTextFormattingDialog#get_attributes

RichTextAttr get_attributes() RichTextAttr get_attributes()

Gets the attributes being edited.

RichTextFormattingDialog#get_dialog

RichTextFormattingDialog get_dialog(%(arg-type)Window% win)

Helper for pages to get the top-level dialog.

RichTextFormattingDialog#get_dialog_attributes

RichTextAttr get_dialog_attributes(%(arg-type)Window% win)

Helper for pages to get the attributes.

RichTextFormattingDialog#get_dialog_style_definition

RichTextStyleDefinition get_dialog_style_definition(%(arg-type)Window% win)

Helper for pages to get the style.

RichTextFormattingDialog#get_formatting_dialog_factory

RichTextFormattingDialogFactory get_formatting_dialog_factory()

Returns the object to be used to customize the dialog and provide pages.

RichTextFormattingDialog#get_image_list

ImageList get_image_list()

Returns the image list associated with the dialog, used for example if showing the dialog as a toolbook.

RichTextFormattingDialog#get_style

Boolean get_style(%(arg-type)RichTextCtrl% ctrl, Range range)

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.

RichTextFormattingDialog#get_style_definition

RichTextStyleDefinition get_style_definition()

Gets the associated style definition, if any.

RichTextFormattingDialog#get_style_sheet

RichTextStyleSheet get_style_sheet()

Gets the associated style sheet, if any.

RichTextFormattingDialog#set_attributes

set_attributes(%(arg-type)RichTextAttr% attr)

Sets the attributes to be edited.

RichTextFormattingDialog#set_formatting_dialog_factory

set_formatting_dialog_factory(%(arg-type)RichTextFormattingDialogFactory% factory)

Sets the formatting factory object to be used for customization and page creation.
It deletes the existing factory object.

RichTextFormattingDialog#set_image_list

set_image_list(%(arg-type)ImageList% imageList)

Sets the image list associated with the dialog’s property sheet.

RichTextFormattingDialog#set_style

Boolean set_style(%(arg-type)RichTextAttr% style, Boolean update = true)

Sets the attributes and optionally updates the display, if update is .

RichTextFormattingDialog#set_style_definition

Boolean set_style_definition(%(arg-type)RichTextStyleDefinition% styleDef, RichTextStyleSheet sheet, Boolean update = true)

Sets the style definition and optionally update the display, if update is .

RichTextFormattingDialog#update_display

Boolean update_display()

Updates the display.

[This page automatically generated from the Textile source at 2023-06-09 00:45:26 +0000]