1 \section{\class{wxRichTextFormattingDialog
}}\label{wxrichtextformattingdialog
}
3 This dialog allows the user to edit a character and/or paragraph style.
5 In the constructor, specify the pages that will be created. Use GetStyle
6 to retrieve the common style for a given range, and then use ApplyStyle
7 to apply the user-selected formatting to a control. For example:
10 wxRichTextRange range;
11 if (m_richTextCtrl->HasSelection())
12 range = m_richTextCtrl->GetSelectionRange();
14 range = wxRichTextRange(
0, m_richTextCtrl->GetLastPosition()+
1);
16 int pages = wxRICHTEXT_FORMAT_FONT|wxRICHTEXT_FORMAT_INDENTS_SPACING|wxRICHTEXT_FORMAT_TABS|wxRICHTEXT_FORMAT_BULLETS;
18 wxRichTextFormattingDialog formatDlg(pages, this);
19 formatDlg.GetStyle(m_richTextCtrl, range);
21 if (formatDlg.ShowModal() == wxID_OK)
23 formatDlg.ApplyStyle(m_richTextCtrl, range);
27 \wxheading{Derived from
}
29 \helpref{wxPropertySheetDialog
}{wxpropertysheetdialog
}
31 \wxheading{Include files
}
33 <wx/richtext/richtextformatdlg.h>
37 \helpref{wxRichtext
}{librarieslist
}
39 \wxheading{Data structures
}
41 The following flags passed to the dialog constructor indicate the pages to
45 #define wxRICHTEXT_FORMAT_STYLE_EDITOR
0x0001
46 #define wxRICHTEXT_FORMAT_FONT
0x0002
47 #define wxRICHTEXT_FORMAT_TABS
0x0004
48 #define wxRICHTEXT_FORMAT_BULLETS
0x0008
49 #define wxRICHTEXT_FORMAT_INDENTS_SPACING
0x0010
52 \latexignore{\rtfignore{\wxheading{Members
}}}
55 \membersection{wxRichTextFormattingDialog::wxRichTextFormattingDialog
}\label{wxrichtextformattingdialogwxrichtextformattingdialog
}
57 \func{}{wxRichTextFormattingDialog
}{\param{long
}{flags
},
\param{wxWindow*
}{parent
},
\param{const wxString\&
}{title =
\_("Formatting")
},
\param{wxWindowID
}{id = wxID
\_ANY},
\param{const wxPoint\&
}{pos = wxDefaultPosition
},
\param{const wxSize\&
}{sz = wxDefaultSize
},
\param{long
}{style = wxDEFAULT
\_DIALOG\_STYLE}}
59 \func{}{wxRichTextFormattingDialog
}{\void}
63 \wxheading{Parameters
}
65 \docparam{flags
}{The pages to show.
}
67 \docparam{parent
}{The dialog's parent.
}
69 \docparam{id
}{The dialog's identifier.
}
71 \docparam{title
}{The dialog's caption.
}
73 \docparam{pos
}{The dialog's position.
}
75 \docparam{size
}{The dialog's size.
}
77 \docparam{style
}{The dialog's window style.
}
80 \membersection{wxRichTextFormattingDialog::
\destruct{wxRichTextFormattingDialog
}}\label{wxrichtextformattingdialogdtor
}
82 \func{}{\destruct{wxRichTextFormattingDialog
}}{\void}
86 \membersection{wxRichTextFormattingDialog::ApplyStyle
}\label{wxrichtextformattingdialogapplystyle
}
88 \func{bool
}{ApplyStyle
}{\param{wxRichTextCtrl*
}{ctrl
},
\param{const wxRichTextRange\&
}{range
},
\param{int
}{flags = wxRICHTEXT
\_SETSTYLE\_WITH\_UNDO|wxRICHTEXT
\_SETSTYLE\_OPTIMIZE}}
90 Apply attributes to the given range, only changing attributes that need to be changed.
92 \membersection{wxRichTextFormattingDialog::Create
}\label{wxrichtextformattingdialogcreate
}
94 \func{bool
}{Create
}{\param{long
}{flags
},
\param{wxWindow*
}{parent
},
\param{const wxString\&
}{title
},
\param{wxWindowID
}{id
},
\param{const wxPoint\&
}{pos = wxDefaultPosition
},
\param{const wxSize\&
}{sz = wxDefaultSize
},
\param{long
}{style = wxDEFAULT
\_DIALOG\_STYLE}}
96 Creation: see
\helpref{the constructor
}{wxrichtextformattingdialog
} for details about the parameters.
98 \membersection{wxRichTextFormattingDialog::GetAttributes
}\label{wxrichtextformattingdialoggetattributes
}
100 \constfunc{const wxTextAttrEx\&
}{GetAttributes
}{\void}
102 \func{wxTextAttrEx\&
}{GetAttributes
}{\void}
104 Gets the attributes being edited.
106 \membersection{wxRichTextFormattingDialog::GetDialog
}\label{wxrichtextformattingdialoggetdialog
}
108 \func{wxRichTextFormattingDialog*
}{GetDialog
}{\param{wxWindow*
}{win
}}
110 Helper for pages to get the top-level dialog.
112 \membersection{wxRichTextFormattingDialog::GetDialogAttributes
}\label{wxrichtextformattingdialoggetdialogattributes
}
114 \func{wxTextAttrEx*
}{GetDialogAttributes
}{\param{wxWindow*
}{win
}}
116 Helper for pages to get the attributes.
118 \membersection{wxRichTextFormattingDialog::GetDialogStyleDefinition
}\label{wxrichtextformattingdialoggetdialogstyledefinition
}
120 \func{wxRichTextStyleDefinition*
}{GetDialogStyleDefinition
}{\param{wxWindow*
}{win
}}
122 Helper for pages to get the style.
124 \membersection{wxRichTextFormattingDialog::GetFormattingDialogFactory
}\label{wxrichtextformattingdialoggetformattingdialogfactory
}
126 \func{wxRichTextFormattingDialogFactory*
}{GetFormattingDialogFactory
}{\void}
128 Returns the object to be used to customize the dialog and provide pages.
130 \membersection{wxRichTextFormattingDialog::GetImageList
}\label{wxrichtextformattingdialoggetimagelist
}
132 \constfunc{wxImageList*
}{GetImageList
}{\void}
134 Returns the image list associated with the dialog, used for example if showing the dialog as a toolbook.
136 \membersection{wxRichTextFormattingDialog::GetStyle
}\label{wxrichtextformattingdialoggetstyle
}
138 \func{bool
}{GetStyle
}{\param{wxRichTextCtrl*
}{ctrl
},
\param{const wxRichTextRange\&
}{range
}}
140 Gets common attributes from the given range and calls SetAttributes. Attributes that do not have common values in the given range
141 will be omitted from the style's flags.
143 \membersection{wxRichTextFormattingDialog::GetStyleDefinition
}\label{wxrichtextformattingdialoggetstyledefinition
}
145 \constfunc{wxRichTextStyleDefinition*
}{GetStyleDefinition
}{\void}
147 Gets the associated style definition, if any.
149 \membersection{wxRichTextFormattingDialog::GetStyleSheet
}\label{wxrichtextformattingdialoggetstylesheet
}
151 \constfunc{wxRichTextStyleSheet*
}{GetStyleSheet
}{\void}
153 Gets the associated style sheet, if any.
155 \membersection{wxRichTextFormattingDialog::SetAttributes
}\label{wxrichtextformattingdialogsetattributes
}
157 \func{void
}{SetAttributes
}{\param{const wxTextAttrEx\&
}{attr
}}
159 Sets the attributes to be edited.
161 \membersection{wxRichTextFormattingDialog::SetFormattingDialogFactory
}\label{wxrichtextformattingdialogsetformattingdialogfactory
}
163 \func{void
}{SetFormattingDialogFactory
}{\param{wxRichTextFormattingDialogFactory*
}{factory
}}
165 Sets the formatting factory object to be used for customization and page creation.
166 It deletes the existing factory object.
168 \membersection{wxRichTextFormattingDialog::SetImageList
}\label{wxrichtextformattingdialogsetimagelist
}
170 \func{void
}{SetImageList
}{\param{wxImageList*
}{imageList
}}
172 Sets the image list associated with the dialog's property sheet.
174 \membersection{wxRichTextFormattingDialog::SetStyle
}\label{wxrichtextformattingdialogsetstyle
}
176 \func{bool
}{SetStyle
}{\param{const wxTextAttrEx\&
}{style
},
\param{bool
}{update = true
}}
178 Sets the attributes and optionally updates the display, if
{\it update
} is
\true.
180 \membersection{wxRichTextFormattingDialog::SetStyleDefinition
}\label{wxrichtextformattingdialogsetstyledefinition
}
182 \func{bool
}{SetStyleDefinition
}{\param{const wxRichTextStyleDefinition\&
}{styleDef
},
\param{wxRichTextStyleSheet*
}{sheet
},
\param{bool
}{update = true
}}
184 Sets the style definition and optionally update the display, if
{\it update
} is
\true.
186 \membersection{wxRichTextFormattingDialog::UpdateDisplay
}\label{wxrichtextformattingdialogupdatedisplay
}
188 \func{bool
}{UpdateDisplay
}{\void}
194 % automatically generated by HelpGen $Revision$ from
195 % richtextformatdlg.h at 10/Oct/06 15:42:06
199 \section{\class{wxRichTextFormattingDialogFactory
}}\label{wxrichtextformattingdialogfactory
}
201 This class provides pages for wxRichTextFormattingDialog, and allows other customization of the dialog.
202 A default instance of this class is provided automatically. If you wish to change the behaviour of the
203 formatting dialog (for example add or replace a page), you may derive from this class,
204 override one or more functions, and call the static function wxRichTextFormattingDialog::SetFormattingDialogFactory.
206 \wxheading{Derived from
}
208 \helpref{wxObject
}{wxobject
}
210 \wxheading{Include files
}
212 <wx/richtext/richtextformatdlg.h>
216 \helpref{wxRichtext
}{librarieslist
}
218 \latexignore{\rtfignore{\wxheading{Members
}}}
221 \membersection{wxRichTextFormattingDialogFactory::wxRichTextFormattingDialogFactory
}\label{wxrichtextformattingdialogfactorywxrichtextformattingdialogfactory
}
223 \func{}{wxRichTextFormattingDialogFactory
}{\void}
227 \membersection{wxRichTextFormattingDialogFactory::
\destruct{wxRichTextFormattingDialogFactory
}}\label{wxrichtextformattingdialogfactorydtor
}
229 \func{}{\destruct{wxRichTextFormattingDialogFactory
}}{\void}
233 \membersection{wxRichTextFormattingDialogFactory::CreateButtons
}\label{wxrichtextformattingdialogfactorycreatebuttons
}
235 \func{virtual bool
}{CreateButtons
}{\param{wxRichTextFormattingDialog*
}{dialog
}}
237 Creates the main dialog buttons.
239 \membersection{wxRichTextFormattingDialogFactory::CreatePage
}\label{wxrichtextformattingdialogfactorycreatepage
}
241 \func{virtual wxPanel*
}{CreatePage
}{\param{int
}{page
},
\param{wxString\&
}{title
},
\param{wxRichTextFormattingDialog*
}{dialog
}}
243 Creates a page, given a page identifier.
245 \membersection{wxRichTextFormattingDialogFactory::CreatePages
}\label{wxrichtextformattingdialogfactorycreatepages
}
247 \func{virtual bool
}{CreatePages
}{\param{long
}{pages
},
\param{wxRichTextFormattingDialog*
}{dialog
}}
249 Creates all pages under the dialog's book control, also calling AddPage.
251 \membersection{wxRichTextFormattingDialogFactory::GetPageId
}\label{wxrichtextformattingdialogfactorygetpageid
}
253 \constfunc{virtual int
}{GetPageId
}{\param{int
}{i
}}
255 Enumerate all available page identifiers.
257 \membersection{wxRichTextFormattingDialogFactory::GetPageIdCount
}\label{wxrichtextformattingdialogfactorygetpageidcount
}
259 \constfunc{virtual int
}{GetPageIdCount
}{\void}
261 Gets the number of available page identifiers.
263 \membersection{wxRichTextFormattingDialogFactory::GetPageImage
}\label{wxrichtextformattingdialogfactorygetpageimage
}
265 \constfunc{virtual int
}{GetPageImage
}{\param{int
}{id
}}
267 Gets the image index for the given page identifier.
269 \membersection{wxRichTextFormattingDialogFactory::SetSheetStyle
}\label{wxrichtextformattingdialogfactorysetsheetstyle
}
271 \func{virtual bool
}{SetSheetStyle
}{\param{wxRichTextFormattingDialog*
}{dialog
}}
273 Set the property sheet style, called at the start of wxRichTextFormattingDialog::Create.
275 \membersection{wxRichTextFormattingDialogFactory::ShowHelp
}\label{wxrichtextformattingdialogfactoryshowhelp
}
277 \func{virtual bool
}{ShowHelp
}{\param{int
}{page
},
\param{wxRichTextFormattingDialog*
}{dialog
}}
279 Invokes help for the dialog.