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