wxRichTextFormattingDialogThis 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:
wxRichTextRange range; if (m_richTextCtrl->HasSelection()) range = m_richTextCtrl->GetSelectionRange(); else range = wxRichTextRange(0, m_richTextCtrl->GetLastPosition()+1); int pages = wxRICHTEXT_FORMAT_FONT|wxRICHTEXT_FORMAT_INDENTS_SPACING|wxRICHTEXT_FORMAT_TABS|wxRICHTEXT_FORMAT_BULLETS; wxRichTextFormattingDialog formatDlg(pages, this); formatDlg.GetStyle(m_richTextCtrl, range); if (formatDlg.ShowModal() == wxID_OK) { formatDlg.ApplyStyle(m_richTextCtrl, range); }Derived from Include files <wx/richtext/richtextformatdlg.h> Data structures The following flags passed to the dialog constructor indicate the pages to be created:
#define wxRICHTEXT_FORMAT_STYLE_EDITOR 0x0001 #define wxRICHTEXT_FORMAT_FONT 0x0002 #define wxRICHTEXT_FORMAT_TABS 0x0004 #define wxRICHTEXT_FORMAT_BULLETS 0x0008 #define wxRICHTEXT_FORMAT_INDENTS_SPACING 0x0010Members
wxRichTextFormattingDialog::wxRichTextFormattingDialog
wxRichTextFormattingDialog::wxRichTextFormattingDialogwxRichTextFormattingDialog(long flags, wxWindow* parent, const wxString& title = _("Formatting"), wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& sz = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE) wxRichTextFormattingDialog() Constructors. Parameters flags
parent
id
title
pos
size
style
wxRichTextFormattingDialog::~wxRichTextFormattingDialog~wxRichTextFormattingDialog() Destructor.
wxRichTextFormattingDialog::ApplyStylebool ApplyStyle(wxRichTextCtrl* ctrl, const wxRichTextRange& range, int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO|wxRICHTEXT_SETSTYLE_OPTIMIZE) Apply attributes to the given range, only changing attributes that need to be changed.
wxRichTextFormattingDialog::Createbool Create(long flags, wxWindow* parent, const wxString& title, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& sz = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE) Creation: see the constructor for details about the parameters.
wxRichTextFormattingDialog::GetAttributesconst wxTextAttrEx& GetAttributes() const wxTextAttrEx& GetAttributes() Gets the attributes being edited.
wxRichTextFormattingDialog::GetDialogwxRichTextFormattingDialog* GetDialog(wxWindow* win) Helper for pages to get the top-level dialog.
wxRichTextFormattingDialog::GetDialogAttributeswxTextAttrEx* GetDialogAttributes(wxWindow* win) Helper for pages to get the attributes.
wxRichTextFormattingDialog::GetDialogStyleDefinitionwxRichTextStyleDefinition* GetDialogStyleDefinition(wxWindow* win) Helper for pages to get the style.
wxRichTextFormattingDialog::GetFormattingDialogFactorywxRichTextFormattingDialogFactory* GetFormattingDialogFactory() Returns the object to be used to customize the dialog and provide pages.
wxRichTextFormattingDialog::GetImageListwxImageList* GetImageList() const Returns the image list associated with the dialog, used for example if showing the dialog as a toolbook.
wxRichTextFormattingDialog::GetStylebool GetStyle(wxRichTextCtrl* ctrl, const wxRichTextRange& 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.
wxRichTextFormattingDialog::GetStyleDefinitionwxRichTextStyleDefinition* GetStyleDefinition() const Gets the associated style definition, if any.
wxRichTextFormattingDialog::GetStyleSheetwxRichTextStyleSheet* GetStyleSheet() const Gets the associated style sheet, if any.
wxRichTextFormattingDialog::SetAttributesvoid SetAttributes(const wxTextAttrEx& attr) Sets the attributes to be edited.
wxRichTextFormattingDialog::SetFormattingDialogFactoryvoid SetFormattingDialogFactory(wxRichTextFormattingDialogFactory* factory) Sets the formatting factory object to be used for customization and page creation. It deletes the existing factory object.
wxRichTextFormattingDialog::SetImageListvoid SetImageList(wxImageList* imageList) Sets the image list associated with the dialog's property sheet.
wxRichTextFormattingDialog::SetStylebool SetStyle(const wxTextAttrEx& style, bool update = true) Sets the attributes and optionally updates the display, if update is true.
wxRichTextFormattingDialog::SetStyleDefinitionbool SetStyleDefinition(const wxRichTextStyleDefinition& styleDef, wxRichTextStyleSheet* sheet, bool update = true) Sets the style definition and optionally update the display, if update is true.
wxRichTextFormattingDialog::UpdateDisplaybool UpdateDisplay() Updates the display.
|