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.
|