added the mention of library in which each class is defined to the documentation...
[wxWidgets.git] / docs / latex / wx / richtextformattingdialog.tex
1 \section{\class{wxRichTextFormattingDialog}}\label{wxrichtextformattingdialog}
2
3 This dialog allows the user to edit a character and/or paragraph style.
4
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:
8
9 \begin{verbatim}
10 wxRichTextRange range;
11 if (m_richTextCtrl->HasSelection())
12 range = m_richTextCtrl->GetSelectionRange();
13 else
14 range = wxRichTextRange(0, m_richTextCtrl->GetLastPosition()+1);
15
16 int pages = wxRICHTEXT_FORMAT_FONT|wxRICHTEXT_FORMAT_INDENTS_SPACING|wxRICHTEXT_FORMAT_TABS|wxRICHTEXT_FORMAT_BULLETS;
17
18 wxRichTextFormattingDialog formatDlg(pages, this);
19 formatDlg.GetStyle(m_richTextCtrl, range);
20
21 if (formatDlg.ShowModal() == wxID_OK)
22 {
23 formatDlg.ApplyStyle(m_richTextCtrl, range);
24 }
25 \end{verbatim}
26
27 \wxheading{Derived from}
28
29 \helpref{wxPropertySheetDialog}{wxpropertysheetdialog}
30
31 \wxheading{Include files}
32
33 <wx/richtext/richtextformatdlg.h>
34
35 \wxheading{Library}
36
37 \helpref{wxRichtext}{librarieslist}
38
39 \wxheading{Data structures}
40
41 The following flags passed to the dialog constructor indicate the pages to
42 be created:
43
44 \begin{verbatim}
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
50 \end{verbatim}
51
52 \latexignore{\rtfignore{\wxheading{Members}}}
53
54
55 \membersection{wxRichTextFormattingDialog::wxRichTextFormattingDialog}\label{wxrichtextformattingdialogwxrichtextformattingdialog}
56
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}}
58
59 \func{}{wxRichTextFormattingDialog}{\void}
60
61 Constructors.
62
63 \wxheading{Parameters}
64
65 \docparam{flags}{The pages to show.}
66
67 \docparam{parent}{The dialog's parent.}
68
69 \docparam{id}{The dialog's identifier.}
70
71 \docparam{title}{The dialog's caption.}
72
73 \docparam{pos}{The dialog's position.}
74
75 \docparam{size}{The dialog's size.}
76
77 \docparam{style}{The dialog's window style.}
78
79
80 \membersection{wxRichTextFormattingDialog::\destruct{wxRichTextFormattingDialog}}\label{wxrichtextformattingdialogdtor}
81
82 \func{}{\destruct{wxRichTextFormattingDialog}}{\void}
83
84 Destructor.
85
86 \membersection{wxRichTextFormattingDialog::ApplyStyle}\label{wxrichtextformattingdialogapplystyle}
87
88 \func{bool}{ApplyStyle}{\param{wxRichTextCtrl* }{ctrl}, \param{const wxRichTextRange\& }{range}, \param{int }{flags = wxRICHTEXT\_SETSTYLE\_WITH\_UNDO|wxRICHTEXT\_SETSTYLE\_OPTIMIZE}}
89
90 Apply attributes to the given range, only changing attributes that need to be changed.
91
92 \membersection{wxRichTextFormattingDialog::Create}\label{wxrichtextformattingdialogcreate}
93
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}}
95
96 Creation: see \helpref{the constructor}{wxrichtextformattingdialog} for details about the parameters.
97
98 \membersection{wxRichTextFormattingDialog::GetAttributes}\label{wxrichtextformattingdialoggetattributes}
99
100 \constfunc{const wxTextAttrEx\&}{GetAttributes}{\void}
101
102 \func{wxTextAttrEx\&}{GetAttributes}{\void}
103
104 Gets the attributes being edited.
105
106 \membersection{wxRichTextFormattingDialog::GetDialog}\label{wxrichtextformattingdialoggetdialog}
107
108 \func{wxRichTextFormattingDialog*}{GetDialog}{\param{wxWindow* }{win}}
109
110 Helper for pages to get the top-level dialog.
111
112 \membersection{wxRichTextFormattingDialog::GetDialogAttributes}\label{wxrichtextformattingdialoggetdialogattributes}
113
114 \func{wxTextAttrEx*}{GetDialogAttributes}{\param{wxWindow* }{win}}
115
116 Helper for pages to get the attributes.
117
118 \membersection{wxRichTextFormattingDialog::GetDialogStyleDefinition}\label{wxrichtextformattingdialoggetdialogstyledefinition}
119
120 \func{wxRichTextStyleDefinition*}{GetDialogStyleDefinition}{\param{wxWindow* }{win}}
121
122 Helper for pages to get the style.
123
124 \membersection{wxRichTextFormattingDialog::GetFormattingDialogFactory}\label{wxrichtextformattingdialoggetformattingdialogfactory}
125
126 \func{wxRichTextFormattingDialogFactory*}{GetFormattingDialogFactory}{\void}
127
128 Returns the object to be used to customize the dialog and provide pages.
129
130 \membersection{wxRichTextFormattingDialog::GetImageList}\label{wxrichtextformattingdialoggetimagelist}
131
132 \constfunc{wxImageList*}{GetImageList}{\void}
133
134 Returns the image list associated with the dialog, used for example if showing the dialog as a toolbook.
135
136 \membersection{wxRichTextFormattingDialog::GetStyle}\label{wxrichtextformattingdialoggetstyle}
137
138 \func{bool}{GetStyle}{\param{wxRichTextCtrl* }{ctrl}, \param{const wxRichTextRange\& }{range}}
139
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.
142
143 \membersection{wxRichTextFormattingDialog::GetStyleDefinition}\label{wxrichtextformattingdialoggetstyledefinition}
144
145 \constfunc{wxRichTextStyleDefinition*}{GetStyleDefinition}{\void}
146
147 Gets the associated style definition, if any.
148
149 \membersection{wxRichTextFormattingDialog::GetStyleSheet}\label{wxrichtextformattingdialoggetstylesheet}
150
151 \constfunc{wxRichTextStyleSheet*}{GetStyleSheet}{\void}
152
153 Gets the associated style sheet, if any.
154
155 \membersection{wxRichTextFormattingDialog::SetAttributes}\label{wxrichtextformattingdialogsetattributes}
156
157 \func{void}{SetAttributes}{\param{const wxTextAttrEx\& }{attr}}
158
159 Sets the attributes to be edited.
160
161 \membersection{wxRichTextFormattingDialog::SetFormattingDialogFactory}\label{wxrichtextformattingdialogsetformattingdialogfactory}
162
163 \func{void}{SetFormattingDialogFactory}{\param{wxRichTextFormattingDialogFactory* }{factory}}
164
165 Sets the formatting factory object to be used for customization and page creation.
166 It deletes the existing factory object.
167
168 \membersection{wxRichTextFormattingDialog::SetImageList}\label{wxrichtextformattingdialogsetimagelist}
169
170 \func{void}{SetImageList}{\param{wxImageList* }{imageList}}
171
172 Sets the image list associated with the dialog's property sheet.
173
174 \membersection{wxRichTextFormattingDialog::SetStyle}\label{wxrichtextformattingdialogsetstyle}
175
176 \func{bool}{SetStyle}{\param{const wxTextAttrEx\& }{style}, \param{bool }{update = true}}
177
178 Sets the attributes and optionally updates the display, if {\it update} is \true.
179
180 \membersection{wxRichTextFormattingDialog::SetStyleDefinition}\label{wxrichtextformattingdialogsetstyledefinition}
181
182 \func{bool}{SetStyleDefinition}{\param{const wxRichTextStyleDefinition\& }{styleDef}, \param{wxRichTextStyleSheet* }{sheet}, \param{bool }{update = true}}
183
184 Sets the style definition and optionally update the display, if {\it update} is \true.
185
186 \membersection{wxRichTextFormattingDialog::UpdateDisplay}\label{wxrichtextformattingdialogupdatedisplay}
187
188 \func{bool}{UpdateDisplay}{\void}
189
190 Updates the display.
191
192
193 %
194 % automatically generated by HelpGen $Revision$ from
195 % richtextformatdlg.h at 10/Oct/06 15:42:06
196 %
197
198
199 \section{\class{wxRichTextFormattingDialogFactory}}\label{wxrichtextformattingdialogfactory}
200
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.
205
206 \wxheading{Derived from}
207
208 \helpref{wxObject}{wxobject}
209
210 \wxheading{Include files}
211
212 <wx/richtext/richtextformatdlg.h>
213
214 \wxheading{Library}
215
216 \helpref{wxRichtext}{librarieslist}
217
218 \latexignore{\rtfignore{\wxheading{Members}}}
219
220
221 \membersection{wxRichTextFormattingDialogFactory::wxRichTextFormattingDialogFactory}\label{wxrichtextformattingdialogfactorywxrichtextformattingdialogfactory}
222
223 \func{}{wxRichTextFormattingDialogFactory}{\void}
224
225 Constructor.
226
227 \membersection{wxRichTextFormattingDialogFactory::\destruct{wxRichTextFormattingDialogFactory}}\label{wxrichtextformattingdialogfactorydtor}
228
229 \func{}{\destruct{wxRichTextFormattingDialogFactory}}{\void}
230
231 Destructor.
232
233 \membersection{wxRichTextFormattingDialogFactory::CreateButtons}\label{wxrichtextformattingdialogfactorycreatebuttons}
234
235 \func{virtual bool}{CreateButtons}{\param{wxRichTextFormattingDialog* }{dialog}}
236
237 Creates the main dialog buttons.
238
239 \membersection{wxRichTextFormattingDialogFactory::CreatePage}\label{wxrichtextformattingdialogfactorycreatepage}
240
241 \func{virtual wxPanel*}{CreatePage}{\param{int }{page}, \param{wxString\& }{title}, \param{wxRichTextFormattingDialog* }{dialog}}
242
243 Creates a page, given a page identifier.
244
245 \membersection{wxRichTextFormattingDialogFactory::CreatePages}\label{wxrichtextformattingdialogfactorycreatepages}
246
247 \func{virtual bool}{CreatePages}{\param{long }{pages}, \param{wxRichTextFormattingDialog* }{dialog}}
248
249 Creates all pages under the dialog's book control, also calling AddPage.
250
251 \membersection{wxRichTextFormattingDialogFactory::GetPageId}\label{wxrichtextformattingdialogfactorygetpageid}
252
253 \constfunc{virtual int}{GetPageId}{\param{int }{i}}
254
255 Enumerate all available page identifiers.
256
257 \membersection{wxRichTextFormattingDialogFactory::GetPageIdCount}\label{wxrichtextformattingdialogfactorygetpageidcount}
258
259 \constfunc{virtual int}{GetPageIdCount}{\void}
260
261 Gets the number of available page identifiers.
262
263 \membersection{wxRichTextFormattingDialogFactory::GetPageImage}\label{wxrichtextformattingdialogfactorygetpageimage}
264
265 \constfunc{virtual int}{GetPageImage}{\param{int }{id}}
266
267 Gets the image index for the given page identifier.
268
269 \membersection{wxRichTextFormattingDialogFactory::SetSheetStyle}\label{wxrichtextformattingdialogfactorysetsheetstyle}
270
271 \func{virtual bool}{SetSheetStyle}{\param{wxRichTextFormattingDialog* }{dialog}}
272
273 Set the property sheet style, called at the start of wxRichTextFormattingDialog::Create.
274
275 \membersection{wxRichTextFormattingDialogFactory::ShowHelp}\label{wxrichtextformattingdialogfactoryshowhelp}
276
277 \func{virtual bool}{ShowHelp}{\param{int }{page}, \param{wxRichTextFormattingDialog* }{dialog}}
278
279 Invokes help for the dialog.
280