]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/richtextattr.tex
Typo fix
[wxWidgets.git] / docs / latex / wx / richtextattr.tex
CommitLineData
5f35b46a
JS
1\section{\class{wxRichTextAttr}}\label{wxrichtextattr}
2
3wxRichTextAttr represents the character and paragraph attributes, or style,
4for a range of text in a \helpref{wxRichTextCtrl}{wxrichtextctrl}. This class
5is specific to wxRichTextCtrl, although you can also use the
6standard \helpref{wxTextAttr}{wxtextattr} class with wxRichTextCtrl.
7
8When setting up a wxRichTextAttr object, pass a bitlist mask to \helpref{SetFlags}{wxrichtextattrsetflags} to
9indicate which style elements should be changed. As a convenience, when you call a setter such
1f65137f 10as SetFont, the relevant bit will be set.
5f35b46a 11
1f65137f 12wxRichTextAttr stores attributes without a wxFont object, so is a more
5f35b46a
JS
13efficient way to query styles than using a \helpref{wxTextAttr}{wxtextattr} or \helpref{wxTextAttrEx}{wxtextattrex} object.
14
15\wxheading{Derived from}
16
17No base class
18
19\wxheading{Include files}
20
21<wx/richtext/richtextbuffer.h>
22
a7af285d
VZ
23\wxheading{Library}
24
25\helpref{wxRichtext}{librarieslist}
26
5f35b46a
JS
27\wxheading{Constants}
28
1f65137f 29The following values can be passed to wxRichTextAttr::SetAlignment to determine
5f35b46a
JS
30paragraph alignment.
31
32{\small
33\begin{verbatim}
34enum wxTextAttrAlignment
35{
36 wxTEXT_ALIGNMENT_DEFAULT,
37 wxTEXT_ALIGNMENT_LEFT,
38 wxTEXT_ALIGNMENT_CENTRE,
39 wxTEXT_ALIGNMENT_CENTER = wxTEXT_ALIGNMENT_CENTRE,
40 wxTEXT_ALIGNMENT_RIGHT,
41 wxTEXT_ALIGNMENT_JUSTIFIED
42};
43\end{verbatim}
44}
45
1f65137f
JS
46Of these, wxTEXT\_ALIGNMENT\_JUSTIFIED is unimplemented. In future justification may be supported
47when printing or previewing, only.
48
49The following values are passed in a bitlist to wxRichTextAttr::SetFlags to determine
5f35b46a
JS
50what attributes will be considered when setting the attributes
51for a text control.
52
53{\small
54\begin{verbatim}
55// Standard wxTextAttr constants
56
1f65137f
JS
57#define wxTEXT_ATTR_TEXT_COLOUR 0x00000001
58#define wxTEXT_ATTR_BACKGROUND_COLOUR 0x00000002
59#define wxTEXT_ATTR_FONT_FACE 0x00000004
60#define wxTEXT_ATTR_FONT_SIZE 0x00000008
61#define wxTEXT_ATTR_FONT_WEIGHT 0x00000010
62#define wxTEXT_ATTR_FONT_ITALIC 0x00000020
63#define wxTEXT_ATTR_FONT_UNDERLINE 0x00000040
5f35b46a
JS
64#define wxTEXT_ATTR_FONT \
65 wxTEXT_ATTR_FONT_FACE | wxTEXT_ATTR_FONT_SIZE | wxTEXT_ATTR_FONT_WEIGHT \
66| wxTEXT_ATTR_FONT_ITALIC | wxTEXT_ATTR_FONT_UNDERLINE
1f65137f
JS
67#define wxTEXT_ATTR_ALIGNMENT 0x00000080
68#define wxTEXT_ATTR_LEFT_INDENT 0x00000100
69#define wxTEXT_ATTR_RIGHT_INDENT 0x00000200
70#define wxTEXT_ATTR_TABS 0x00000400
5f35b46a
JS
71
72// Extra formatting flags not in wxTextAttr
73
74#define wxTEXT_ATTR_PARA_SPACING_AFTER 0x00000800
75#define wxTEXT_ATTR_PARA_SPACING_BEFORE 0x00001000
76#define wxTEXT_ATTR_LINE_SPACING 0x00002000
77#define wxTEXT_ATTR_CHARACTER_STYLE_NAME 0x00004000
78#define wxTEXT_ATTR_PARAGRAPH_STYLE_NAME 0x00008000
d2d0adc7
JS
79#define wxTEXT_ATTR_LIST_STYLE_NAME 0x00010000
80#define wxTEXT_ATTR_BULLET_STYLE 0x00020000
81#define wxTEXT_ATTR_BULLET_NUMBER 0x00040000
82#define wxTEXT_ATTR_BULLET_TEXT 0x00080000
83#define wxTEXT_ATTR_BULLET_NAME 0x00100000
84#define wxTEXT_ATTR_URL 0x00200000
36f01cc7 85#define wxTEXT_ATTR_PAGE_BREAK 0x00400000
1f65137f 86#define wxTEXT_ATTR_EFFECTS 0x00800000
4d6d8bf4 87#define wxTEXT_ATTR_OUTLINE_LEVEL 0x01000000
5f35b46a
JS
88\end{verbatim}
89}
90
91The following styles can be passed to wxRichTextAttr::SetBulletStyle:
92
93{\small
94\begin{verbatim}
d2d0adc7
JS
95#define wxTEXT_ATTR_BULLET_STYLE_NONE 0x00000000
96#define wxTEXT_ATTR_BULLET_STYLE_ARABIC 0x00000001
97#define wxTEXT_ATTR_BULLET_STYLE_LETTERS_UPPER 0x00000002
98#define wxTEXT_ATTR_BULLET_STYLE_LETTERS_LOWER 0x00000004
99#define wxTEXT_ATTR_BULLET_STYLE_ROMAN_UPPER 0x00000008
100#define wxTEXT_ATTR_BULLET_STYLE_ROMAN_LOWER 0x00000010
101#define wxTEXT_ATTR_BULLET_STYLE_SYMBOL 0x00000020
102#define wxTEXT_ATTR_BULLET_STYLE_BITMAP 0x00000040
103#define wxTEXT_ATTR_BULLET_STYLE_PARENTHESES 0x00000080
104#define wxTEXT_ATTR_BULLET_STYLE_PERIOD 0x00000100
105#define wxTEXT_ATTR_BULLET_STYLE_STANDARD 0x00000200
106#define wxTEXT_ATTR_BULLET_STYLE_RIGHT_PARENTHESIS 0x00000400
107#define wxTEXT_ATTR_BULLET_STYLE_OUTLINE 0x00000800
108#define wxTEXT_ATTR_BULLET_STYLE_ALIGN_LEFT 0x00000000
109#define wxTEXT_ATTR_BULLET_STYLE_ALIGN_RIGHT 0x00001000
110#define wxTEXT_ATTR_BULLET_STYLE_ALIGN_CENTRE 0x00002000
5f35b46a
JS
111\end{verbatim}
112}
113
1f65137f
JS
114Of these, wxTEXT\_ATTR\_BULLET\_STYLE\_BITMAP is unimplemented.
115
5f35b46a
JS
116The following constants can be passed to wxRichTextAttr::SetLineSpacing:
117
118{\small
119\begin{verbatim}
120#define wxTEXT_ATTR_LINE_SPACING_NORMAL 10
121#define wxTEXT_ATTR_LINE_SPACING_HALF 15
122#define wxTEXT_ATTR_LINE_SPACING_TWICE 20
123\end{verbatim}
124}
125
1f65137f
JS
126The following styles can be passed to wxTextAttrEx::SetTextEffects:
127
128{\small
129\begin{verbatim}
130#define wxTEXT_ATTR_EFFECT_NONE 0x00000000
131#define wxTEXT_ATTR_EFFECT_CAPITALS 0x00000001
132#define wxTEXT_ATTR_EFFECT_SMALL_CAPITALS 0x00000002
133#define wxTEXT_ATTR_EFFECT_STRIKETHROUGH 0x00000004
134#define wxTEXT_ATTR_EFFECT_DOUBLE_STRIKETHROUGH 0x00000008
135#define wxTEXT_ATTR_EFFECT_SHADOW 0x00000010
136#define wxTEXT_ATTR_EFFECT_EMBOSS 0x00000020
137#define wxTEXT_ATTR_EFFECT_OUTLINE 0x00000040
138#define wxTEXT_ATTR_EFFECT_ENGRAVE 0x00000080
139#define wxTEXT_ATTR_EFFECT_SUPERSCRIPT 0x00000100
140#define wxTEXT_ATTR_EFFECT_SUBSCRIPT 0x00000200
141\end{verbatim}
142}
143
144Of these, only wxTEXT\_ATTR\_EFFECT\_CAPITALS and wxTEXT\_ATTR\_EFFECT\_STRIKETHROUGH are implemented.
145
5f35b46a
JS
146\wxheading{See also}
147
148\helpref{wxTextAttr}{wxtextattr}, \helpref{wxTextAttrEx}{wxtextattrex}, \helpref{wxRichTextCtrl}{wxrichtextctrl}
149
150\latexignore{\rtfignore{\wxheading{Members}}}
151
152\membersection{wxRichTextAttr::wxRichTextAttr}\label{wxrichtextattrwxrichtextattr}
153
154\func{}{wxRichTextAttr}{\void}
155
156\func{}{wxRichTextAttr}{\param{const wxColour\& }{colText}, \param{const wxColour\& }{colBack = wxNullColour}, \param{wxTextAttrAlignment }{alignment = wxTEXT\_ALIGNMENT\_DEFAULT}}
157
158\func{}{wxRichTextAttr}{\param{const wxTextAttrEx\& }{attr}}
159
160Constructors.
161
336d8ae9 162\membersection{wxRichTextAttr::Apply}\label{wxrichtextattrapply}
5f35b46a 163
336d8ae9 164\func{bool}{Combine}{\param{const wxRichTextAttrEx\& }{style}, \param{const wxRichTextAttrEx* }{compareWith = NULL}}
5f35b46a 165
336d8ae9
VZ
166Applies the attributes in {\it style} to the original object, but not those attributes from {\it style} that are the same as those in {\it compareWith} (if passed).
167
168See also \helpref{wxRichTextAttr::Combine}{wxrichtextattrcombine} for a function that does almost the same but returns a new object instead of modifying the original object.
169
170\membersection{wxRichTextAttr::Combine}\label{wxrichtextattrcombine}
171
172\constfunc{wxRichTextAttr}{Combine}{\param{const wxRichTextAttrEx\& }{style}, \param{const wxRichTextAttrEx* }{compareWith = NULL}}
173
174Combines 'this' with {\it style}, but not applying attributes from {\it style} that are the same as those in {\it compareWith} (if passed).
175A wxRichTextAttr object is returned and the original object is not changed.
176
177See also \helpref{wxRichTextAttr::Apply}{wxrichtextattrapply} for a function that does almost the same but modifies the original object instead of returning a new one.
5f35b46a
JS
178
179\membersection{wxRichTextAttr::CreateFont}\label{wxrichtextattrcreatefont}
180
181\constfunc{wxFont}{CreateFont}{\void}
182
183Creates a font from the font attributes.
184
185\membersection{wxRichTextAttr::GetAlignment}\label{wxrichtextattrgetalignment}
186
187\constfunc{wxTextAttrAlignment}{GetAlignment}{\void}
188
189Returns the alignment flags.
190See \helpref{wxRichTextAttr::SetAlignment}{wxrichtextattrsetalignment} for a list of available styles.
191
192\membersection{wxRichTextAttr::GetBackgroundColour}\label{wxrichtextattrgetbackgroundcolour}
193
194\constfunc{const wxColour\&}{GetBackgroundColour}{\void}
195
196Returns the background colour.
197
62a268cc
JS
198\membersection{wxRichTextAttr::GetBulletFont}\label{wxrichtextattrgetbulletfont}
199
200\constfunc{const wxString\&}{GetBulletFont}{\void}
201
202Returns a string containing the name of the font associated with the bullet symbol.
203Only valid for attributes with wxTEXT\_ATTR\_BULLET\_SYMBOL.
204
d2d0adc7
JS
205\membersection{wxRichTextAttr::GetBulletName}\label{wxrichtextattrgetbulletname}
206
207\constfunc{const wxString\&}{GetBulletName}{\void}
208
209Returns the standard bullet name, applicable if the bullet style is wxTEXT\_ATTR\_BULLET\_STYLE\_STANDARD.
210Currently the following standard bullet names are supported:
211
212\begin{itemize}\itemsep=0pt
213\item {\tt standard/circle}
214\item {\tt standard/square}
215\item {\tt standard/diamond}
216\item {\tt standard/triangle}
217\end{itemize}
218
219If you wish your application to support further bullet graphics, you can derive a
220class from wxRichTextRenderer or wxRichTextStdRenderer, override {\tt DrawStandardBullet} and {\tt EnumerateStandardBulletNames}, and
221set an instance of the class using \helpref{wxRichTextBuffer::SetRenderer}{wxrichtextbuffersetrenderer}.
222
5f35b46a
JS
223\membersection{wxRichTextAttr::GetBulletNumber}\label{wxrichtextattrgetbulletnumber}
224
225\constfunc{int}{GetBulletNumber}{\void}
226
227Returns the bullet number.
228
229\membersection{wxRichTextAttr::GetBulletStyle}\label{wxrichtextattrgetbulletstyle}
230
231\constfunc{int}{GetBulletStyle}{\void}
232
233Returns the bullet style.
234See \helpref{wxRichTextAttr::SetBulletStyle}{wxrichtextattrsetbulletstyle} for a list of available styles.
235
d2d0adc7 236\membersection{wxRichTextAttr::GetBulletText}\label{wxrichtextattrgetbullettext}
5f35b46a 237
d2d0adc7 238\constfunc{const wxString\&}{GetBulletText}{\void}
5f35b46a 239
d2d0adc7 240Returns the bullet text, which could be a symbol, or (for example) cached outline text.
5f35b46a
JS
241
242\membersection{wxRichTextAttr::GetCharacterStyleName}\label{wxrichtextattrgetcharacterstylename}
243
244\constfunc{const wxString\&}{GetCharacterStyleName}{\void}
245
246Returns the name of the character style.
247
248\membersection{wxRichTextAttr::GetFlags}\label{wxrichtextattrgetflags}
249
250\constfunc{long}{GetFlags}{\void}
251
252Returns flags indicating which attributes are applicable.
253See \helpref{wxRichTextAttr::SetFlags}{wxrichtextattrsetflags} for a list of available flags.
254
255\membersection{wxRichTextAttr::GetFontAttributes}\label{wxrichtextattrgetfontattributes}
256
257\func{bool}{GetFontAttributes}{\param{const wxFont\& }{font}}
258
259Sets the font attributes from the given font.
260
261\membersection{wxRichTextAttr::GetFontFaceName}\label{wxrichtextattrgetfontfacename}
262
263\constfunc{const wxString\&}{GetFontFaceName}{\void}
264
265Returns the font face name.
266
267\membersection{wxRichTextAttr::GetFontSize}\label{wxrichtextattrgetfontsize}
268
269\constfunc{int}{GetFontSize}{\void}
270
271Returns the font size in points.
272
273\membersection{wxRichTextAttr::GetFontStyle}\label{wxrichtextattrgetfontstyle}
274
275\constfunc{int}{GetFontStyle}{\void}
276
277Returns the font style.
278
279\membersection{wxRichTextAttr::GetFontUnderlined}\label{wxrichtextattrgetfontunderlined}
280
281\constfunc{bool}{GetFontUnderlined}{\void}
282
283Returns \true if the font is underlined.
284
285\membersection{wxRichTextAttr::GetFontWeight}\label{wxrichtextattrgetfontweight}
286
287\constfunc{int}{GetFontWeight}{\void}
288
289Returns the font weight.
290
291\membersection{wxRichTextAttr::GetLeftIndent}\label{wxrichtextattrgetleftindent}
292
293\constfunc{long}{GetLeftIndent}{\void}
294
295Returns the left indent in tenths of a millimetre.
296
297\membersection{wxRichTextAttr::GetLeftSubIndent}\label{wxrichtextattrgetleftsubindent}
298
299\constfunc{long}{GetLeftSubIndent}{\void}
300
301Returns the left sub-indent in tenths of a millimetre.
302
303\membersection{wxRichTextAttr::GetLineSpacing}\label{wxrichtextattrgetlinespacing}
304
305\constfunc{int}{GetLineSpacing}{\void}
306
307Returns the line spacing value, one of wxTEXT\_ATTR\_LINE\_SPACING\_NORMAL,
308wxTEXT\_ATTR\_LINE\_SPACING\_HALF, and wxTEXT\_ATTR\_LINE\_SPACING\_TWICE.
309
d2d0adc7
JS
310\membersection{wxRichTextAttr::GetListStyleName}\label{wxrichtextattrgetliststylename}
311
312\constfunc{const wxString\&}{GetListStyleName}{\void}
313
314Returns the name of the list style.
315
4d6d8bf4
JS
316\membersection{wxRichTextAttr::GetOutlineLevel}\label{wxrichtextattrgetoutlinelevel}
317
318\constfunc{bool}{GetOutlineLevel}{\void}
319
320Returns the outline level.
321
5f35b46a
JS
322\membersection{wxRichTextAttr::GetParagraphSpacingAfter}\label{wxrichtextattrgetparagraphspacingafter}
323
324\constfunc{int}{GetParagraphSpacingAfter}{\void}
325
326Returns the space in tenths of a millimeter after the paragraph.
327
328\membersection{wxRichTextAttr::GetParagraphSpacingBefore}\label{wxrichtextattrgetparagraphspacingbefore}
329
330\constfunc{int}{GetParagraphSpacingBefore}{\void}
331
332Returns the space in tenths of a millimeter before the paragraph.
333
334\membersection{wxRichTextAttr::GetParagraphStyleName}\label{wxrichtextattrgetparagraphstylename}
335
336\constfunc{const wxString\&}{GetParagraphStyleName}{\void}
337
338Returns the name of the paragraph style.
339
340\membersection{wxRichTextAttr::GetRightIndent}\label{wxrichtextattrgetrightindent}
341
342\constfunc{long}{GetRightIndent}{\void}
343
344Returns the right indent in tenths of a millimeter.
345
346\membersection{wxRichTextAttr::GetTabs}\label{wxrichtextattrgettabs}
347
348\constfunc{const wxArrayInt\&}{GetTabs}{\void}
349
350Returns an array of tab stops, each expressed in tenths of a millimeter. Each stop
351is measured from the left margin and therefore each value must be larger than the last.
352
353\membersection{wxRichTextAttr::GetTextColour}\label{wxrichtextattrgettextcolour}
354
355\constfunc{const wxColour\&}{GetTextColour}{\void}
356
357Returns the text foreground colour.
358
1f65137f
JS
359\membersection{wxRichTextAttr::GetTextEffectFlags}\label{wxrichtextattrgettexteffectflags}
360
361\constfunc{int}{GetTextEffectFlags}{\void}
362
363Returns the text effect bits of interest. See \helpref{wxRichTextAttr::SetFlags}{wxrichtextattrsetflags} for further information.
364
365\membersection{wxRichTextAttr::GetTextEffects}\label{wxrichtextattrgettexteffects}
366
367\constfunc{int}{GetTextEffects}{\void}
368
369Returns the text effects, a bit list of styles. See \helpref{wxRichTextAttr::SetTextEffects}{wxrichtextattrsettexteffects} for
370details.
371
d2d0adc7
JS
372\membersection{wxRichTextAttr::GetURL}\label{wxrichtextattrgeturl}
373
374\constfunc{const wxString\&}{GetURL}{\void}
375
376Returns the URL for the content. Content with wxTEXT\_ATTR\_URL style
377causes wxRichTextCtrl to show a hand cursor over it, and wxRichTextCtrl generates
378a wxTextUrlEvent when the content is clicked.
379
5f35b46a
JS
380\membersection{wxRichTextAttr::HasAlignment}\label{wxrichtextattrhasalignment}
381
382\constfunc{bool}{HasAlignment}{\void}
383
384Returns \true if the attribute object specifies alignment.
385
386\membersection{wxRichTextAttr::HasBackgroundColour}\label{wxrichtextattrhasbackgroundcolour}
387
388\constfunc{bool}{HasBackgroundColour}{\void}
389
390Returns \true if the attribute object specifies a background colour.
391
d2d0adc7
JS
392\membersection{wxRichTextAttr::HasBulletName}\label{wxrichtextattrhasbulletname}
393
394\constfunc{bool}{HasBulletName}{\void}
395
396Returns \true if the attribute object specifies a standard bullet name.
397
5f35b46a
JS
398\membersection{wxRichTextAttr::HasBulletNumber}\label{wxrichtextattrhasbulletnumber}
399
400\constfunc{bool}{HasBulletNumber}{\void}
401
402Returns \true if the attribute object specifies a bullet number.
403
404\membersection{wxRichTextAttr::HasBulletStyle}\label{wxrichtextattrhasbulletstyle}
405
406\constfunc{bool}{HasBulletStyle}{\void}
407
408Returns \true if the attribute object specifies a bullet style.
409
d2d0adc7 410\membersection{wxRichTextAttr::HasBulletText}\label{wxrichtextattrhasbullettext}
5f35b46a 411
d2d0adc7 412\constfunc{bool}{HasBulletText}{\void}
5f35b46a 413
d2d0adc7 414Returns \true if the attribute object specifies bullet text (usually specifying a symbol).
5f35b46a
JS
415
416\membersection{wxRichTextAttr::HasCharacterStyleName}\label{wxrichtextattrhascharacterstylename}
417
418\constfunc{bool}{HasCharacterStyleName}{\void}
419
420Returns \true if the attribute object specifies a character style name.
421
336d8ae9 422\membersection{wxRichTextAttr::HasFontFaceName}\label{wxrichtextattrhasfontfacename}
5f35b46a 423
336d8ae9 424\constfunc{bool}{HasFontFaceName}{\void}
5f35b46a
JS
425
426Returns \true if the attribute object specifies a font face name.
427
428\membersection{wxRichTextAttr::HasFlag}\label{wxrichtextattrhasflag}
429
430\constfunc{bool}{HasFlag}{\param{long }{flag}}
431
432Returns \true if the {\it flag} is present in the attribute object's flag bitlist.
433
434\membersection{wxRichTextAttr::HasFont}\label{wxrichtextattrhasfont}
435
436\constfunc{bool}{HasFont}{\void}
437
438Returns \true if the attribute object specifies any font attributes.
439
336d8ae9 440\membersection{wxRichTextAttr::HasFontItalic}\label{wxrichtextattrhasfontitalic}
5f35b46a 441
336d8ae9 442\constfunc{bool}{HasFontItalic}{\void}
5f35b46a
JS
443
444Returns \true if the attribute object specifies italic style.
445
446\membersection{wxRichTextAttr::HasLeftIndent}\label{wxrichtextattrhasleftindent}
447
448\constfunc{bool}{HasLeftIndent}{\void}
449
450Returns \true if the attribute object specifies a left indent.
451
452\membersection{wxRichTextAttr::HasLineSpacing}\label{wxrichtextattrhaslinespacing}
453
454\constfunc{bool}{HasLineSpacing}{\void}
455
456Returns \true if the attribute object specifies line spacing.
457
d2d0adc7
JS
458\membersection{wxRichTextAttr::HasListStyleName}\label{wxrichtextattrhasliststylename}
459
460\constfunc{bool}{HasListStyleName}{\void}
461
462Returns \true if the attribute object specifies a list style name.
463
4d6d8bf4
JS
464\membersection{wxRichTextAttr::HasOutlineLevel}\label{wxrichtextattrhasoutlinelevel}
465
466\constfunc{bool}{HasOutlineLevel}{\void}
467
468Returns \true if the attribute object specifies an outline level.
469
36f01cc7
JS
470\membersection{wxRichTextAttr::HasPageBreak}\label{wxrichtextattrhaspagebreak}
471
472\constfunc{bool}{HasPageBreak}{\void}
473
474Returns \true if the attribute object specifies a page break before this paragraph.
475
5f35b46a
JS
476\membersection{wxRichTextAttr::HasParagraphSpacingAfter}\label{wxrichtextattrhasparagraphspacingafter}
477
478\constfunc{bool}{HasParagraphSpacingAfter}{\void}
479
480Returns \true if the attribute object specifies spacing after a paragraph.
481
482\membersection{wxRichTextAttr::HasParagraphSpacingBefore}\label{wxrichtextattrhasparagraphspacingbefore}
483
484\constfunc{bool}{HasParagraphSpacingBefore}{\void}
485
486Returns \true if the attribute object specifies spacing before a paragraph.
487
488\membersection{wxRichTextAttr::HasParagraphStyleName}\label{wxrichtextattrhasparagraphstylename}
489
490\constfunc{bool}{HasParagraphStyleName}{\void}
491
492Returns \true if the attribute object specifies a paragraph style name.
493
494\membersection{wxRichTextAttr::HasRightIndent}\label{wxrichtextattrhasrightindent}
495
496\constfunc{bool}{HasRightIndent}{\void}
497
498Returns \true if the attribute object specifies a right indent.
499
336d8ae9 500\membersection{wxRichTextAttr::HasFontSize}\label{wxrichtextattrhasfontsize}
5f35b46a 501
336d8ae9 502\constfunc{bool}{HasFontSize}{\void}
5f35b46a
JS
503
504Returns \true if the attribute object specifies a font point size.
505
506\membersection{wxRichTextAttr::HasTabs}\label{wxrichtextattrhastabs}
507
508\constfunc{bool}{HasTabs}{\void}
509
510Returns \true if the attribute object specifies tab stops.
511
512\membersection{wxRichTextAttr::HasTextColour}\label{wxrichtextattrhastextcolour}
513
514\constfunc{bool}{HasTextColour}{\void}
515
516Returns \true if the attribute object specifies a text foreground colour.
517
4d6d8bf4
JS
518\membersection{wxRichTextAttr::HasTextEffects}\label{wxrichtextattrhastexteffects}
519
520\constfunc{bool}{HasTextEffects}{\void}
521
522Returns \true if the attribute object specifies text effects.
523
336d8ae9 524\membersection{wxRichTextAttr::HasFontUnderlined}\label{wxrichtextattrhasfontunderlined}
5f35b46a 525
336d8ae9 526\constfunc{bool}{HasFontUnderlined}{\void}
5f35b46a
JS
527
528Returns \true if the attribute object specifies either underlining or no underlining.
529
4d6d8bf4
JS
530\membersection{wxRichTextAttr::HasURL}\label{wxrichtextattrhasurl}
531
532\constfunc{bool}{HasURL}{\void}
533
534Returns \true if the attribute object specifies a URL.
535
336d8ae9 536\membersection{wxRichTextAttr::HasFontWeight}\label{wxrichtextattrhasfontweight}
5f35b46a 537
336d8ae9 538\constfunc{bool}{HasFontWeight}{\void}
5f35b46a
JS
539
540Returns \true if the attribute object specifies font weight (bold, light or normal).
541
5f35b46a
JS
542\membersection{wxRichTextAttr::IsCharacterStyle}\label{wxrichtextattrischaracterstyle}
543
544\constfunc{bool}{IsCharacterStyle}{\void}
545
546Returns \true if the object represents a character style, that is,
547the flags specify a font or a text background or foreground colour.
548
549\membersection{wxRichTextAttr::IsDefault}\label{wxrichtextattrisdefault}
550
551\constfunc{bool}{IsDefault}{\void}
552
553Returns \false if we have any attributes set, \true otherwise.
554
555\membersection{wxRichTextAttr::IsParagraphStyle}\label{wxrichtextattrisparagraphstyle}
556
557\constfunc{bool}{IsParagraphStyle}{\void}
558
559Returns \true if the object represents a paragraph style, that is,
560the flags specify alignment, indentation, tabs, paragraph spacing, or
561bullet style.
562
563\membersection{wxRichTextAttr::SetAlignment}\label{wxrichtextattrsetalignment}
564
565\func{void}{SetAlignment}{\param{wxTextAttrAlignment }{alignment}}
566
567Sets the paragraph alignment. These are the possible values for {\it alignment}:
568
569{\small
570\begin{verbatim}
571enum wxTextAttrAlignment
572{
573 wxTEXT_ALIGNMENT_DEFAULT,
574 wxTEXT_ALIGNMENT_LEFT,
575 wxTEXT_ALIGNMENT_CENTRE,
576 wxTEXT_ALIGNMENT_CENTER = wxTEXT_ALIGNMENT_CENTRE,
577 wxTEXT_ALIGNMENT_RIGHT,
578 wxTEXT_ALIGNMENT_JUSTIFIED
579};
580\end{verbatim}
581}
582
1f65137f
JS
583Of these, wxTEXT\_ALIGNMENT\_JUSTIFIED is unimplemented. In future justification may be supported
584when printing or previewing, only.
585
5f35b46a
JS
586\membersection{wxRichTextAttr::SetBackgroundColour}\label{wxrichtextattrsetbackgroundcolour}
587
588\func{void}{SetBackgroundColour}{\param{const wxColour\& }{colBack}}
589
590Sets the background colour.
591
62a268cc
JS
592\membersection{wxRichTextAttr::SetBulletFont}\label{wxrichtextattrsetbulletfont}
593
594\func{void}{SetBulletFont}{\param{const wxString\& }{font}}
595
596Sets the name of the font associated with the bullet symbol.
597Only valid for attributes with wxTEXT\_ATTR\_BULLET\_SYMBOL.
598
d2d0adc7
JS
599\membersection{wxRichTextAttr::SetBulletName}\label{wxrichtextattrsetbulletname}
600
601\func{void}{SetBulletName}{\param{const wxString\& }{name}}
602
603Sets the standard bullet name, applicable if the bullet style is wxTEXT\_ATTR\_BULLET\_STYLE\_STANDARD.
604See \helpref{wxRichTextAttr::GetBulletName}{wxrichtextattrgetbulletname} for a list
605of supported names, and how to expand the range of supported types.
606
5f35b46a
JS
607\membersection{wxRichTextAttr::SetBulletNumber}\label{wxrichtextattrsetbulletnumber}
608
609\func{void}{SetBulletNumber}{\param{int }{n}}
610
611Sets the bullet number.
612
613\membersection{wxRichTextAttr::SetBulletStyle}\label{wxrichtextattrsetbulletstyle}
614
615\func{void}{SetBulletStyle}{\param{int }{style}}
616
617Sets the bullet style. The following styles can be passed:
618
619{\small
620\begin{verbatim}
d2d0adc7
JS
621#define wxTEXT_ATTR_BULLET_STYLE_NONE 0x00000000
622#define wxTEXT_ATTR_BULLET_STYLE_ARABIC 0x00000001
623#define wxTEXT_ATTR_BULLET_STYLE_LETTERS_UPPER 0x00000002
624#define wxTEXT_ATTR_BULLET_STYLE_LETTERS_LOWER 0x00000004
625#define wxTEXT_ATTR_BULLET_STYLE_ROMAN_UPPER 0x00000008
626#define wxTEXT_ATTR_BULLET_STYLE_ROMAN_LOWER 0x00000010
627#define wxTEXT_ATTR_BULLET_STYLE_SYMBOL 0x00000020
628#define wxTEXT_ATTR_BULLET_STYLE_BITMAP 0x00000040
629#define wxTEXT_ATTR_BULLET_STYLE_PARENTHESES 0x00000080
630#define wxTEXT_ATTR_BULLET_STYLE_PERIOD 0x00000100
631#define wxTEXT_ATTR_BULLET_STYLE_STANDARD 0x00000200
632#define wxTEXT_ATTR_BULLET_STYLE_RIGHT_PARENTHESIS 0x00000400
633#define wxTEXT_ATTR_BULLET_STYLE_OUTLINE 0x00000800
634#define wxTEXT_ATTR_BULLET_STYLE_ALIGN_LEFT 0x00000000
635#define wxTEXT_ATTR_BULLET_STYLE_ALIGN_RIGHT 0x00001000
636#define wxTEXT_ATTR_BULLET_STYLE_ALIGN_CENTRE 0x00002000
5f35b46a
JS
637\end{verbatim}
638}
639
1f65137f
JS
640Currently wxTEXT\_ATTR\_BULLET\_STYLE\_BITMAP is not supported.
641
d2d0adc7 642\membersection{wxRichTextAttr::SetBulletText}\label{wxrichtextattrsetbullettext}
5f35b46a 643
d2d0adc7 644\func{void}{SetBulletText}{\param{const wxString& }{text}}
5f35b46a 645
d2d0adc7 646Sets the bullet text, which could be a symbol, or (for example) cached outline text.
5f35b46a
JS
647
648\membersection{wxRichTextAttr::SetCharacterStyleName}\label{wxrichtextattrsetcharacterstylename}
649
650\func{void}{SetCharacterStyleName}{\param{const wxString\& }{name}}
651
652Sets the character style name.
653
654\membersection{wxRichTextAttr::SetFlags}\label{wxrichtextattrsetflags}
655
656\func{void}{SetFlags}{\param{long }{flags}}
657
658Sets the flags determining which styles are being specified. The following
659flags can be passed in a bitlist:
660
661{\small
662\begin{verbatim}
663// Standard wxTextAttr constants
664
1f65137f
JS
665#define wxTEXT_ATTR_TEXT_COLOUR 0x00000001
666#define wxTEXT_ATTR_BACKGROUND_COLOUR 0x00000002
667#define wxTEXT_ATTR_FONT_FACE 0x00000004
668#define wxTEXT_ATTR_FONT_SIZE 0x00000008
669#define wxTEXT_ATTR_FONT_WEIGHT 0x00000010
670#define wxTEXT_ATTR_FONT_ITALIC 0x00000020
671#define wxTEXT_ATTR_FONT_UNDERLINE 0x00000040
5f35b46a
JS
672#define wxTEXT_ATTR_FONT \
673 wxTEXT_ATTR_FONT_FACE | wxTEXT_ATTR_FONT_SIZE | wxTEXT_ATTR_FONT_WEIGHT \
674| wxTEXT_ATTR_FONT_ITALIC | wxTEXT_ATTR_FONT_UNDERLINE
1f65137f
JS
675#define wxTEXT_ATTR_ALIGNMENT 0x00000080
676#define wxTEXT_ATTR_LEFT_INDENT 0x00000100
677#define wxTEXT_ATTR_RIGHT_INDENT 0x00000200
678#define wxTEXT_ATTR_TABS 0x00000400
5f35b46a
JS
679
680// Extra formatting flags not in wxTextAttr
681
682#define wxTEXT_ATTR_PARA_SPACING_AFTER 0x00000800
683#define wxTEXT_ATTR_PARA_SPACING_BEFORE 0x00001000
684#define wxTEXT_ATTR_LINE_SPACING 0x00002000
685#define wxTEXT_ATTR_CHARACTER_STYLE_NAME 0x00004000
686#define wxTEXT_ATTR_PARAGRAPH_STYLE_NAME 0x00008000
d2d0adc7
JS
687#define wxTEXT_ATTR_LIST_STYLE_NAME 0x00010000
688#define wxTEXT_ATTR_BULLET_STYLE 0x00020000
689#define wxTEXT_ATTR_BULLET_NUMBER 0x00040000
690#define wxTEXT_ATTR_BULLET_TEXT 0x00080000
691#define wxTEXT_ATTR_BULLET_NAME 0x00100000
692#define wxTEXT_ATTR_URL 0x00200000
1f65137f
JS
693#define wxTEXT_ATTR_PAGE_BREAK 0x00400000
694#define wxTEXT_ATTR_EFFECTS 0x00800000
4d6d8bf4 695#define wxTEXT_ATTR_OUTLINE_LEVEL 0x01000000
5f35b46a
JS
696\end{verbatim}
697}
698
699\membersection{wxRichTextAttr::SetFontFaceName}\label{wxrichtextattrsetfontfacename}
700
701\func{void}{SetFontFaceName}{\param{const wxString\& }{faceName}}
702
703Sets the paragraph alignment.
704
705\membersection{wxRichTextAttr::SetFontSize}\label{wxrichtextattrsetfontsize}
706
707\func{void}{SetFontSize}{\param{int }{pointSize}}
708
709Sets the font size in points.
710
711\membersection{wxRichTextAttr::SetFontStyle}\label{wxrichtextattrsetfontstyle}
712
713\func{void}{SetFontStyle}{\param{int }{fontStyle}}
714
715Sets the font style (normal, italic or slanted).
716
717\membersection{wxRichTextAttr::SetFontUnderlined}\label{wxrichtextattrsetfontunderlined}
718
719\func{void}{SetFontUnderlined}{\param{bool }{underlined}}
720
721Sets the font underlining.
722
723\membersection{wxRichTextAttr::SetFontWeight}\label{wxrichtextattrsetfontweight}
724
725\func{void}{SetFontWeight}{\param{int }{fontWeight}}
726
727Sets the font weight.
728
729\membersection{wxRichTextAttr::SetLeftIndent}\label{wxrichtextattrsetleftindent}
730
731\func{void}{SetLeftIndent}{\param{int }{indent}, \param{int }{subIndent = 0}}
732
733Sets the left indent and left subindent in tenths of a millimetre.
734
735The sub-indent is an offset from the left of the paragraph, and is used for all but the
736first line in a paragraph. A positive value will cause the first line to appear to the left
737of the subsequent lines, and a negative value will cause the first line to be indented
738relative to the subsequent lines.
739
740wxRichTextBuffer uses indentation to render a bulleted item. The left indent is the distance between
741the margin and the bullet. The content of the paragraph, including the first line, starts
742at leftMargin + leftSubIndent. So the distance between the left edge of the bullet and the
743left of the actual paragraph is leftSubIndent.
744
745\membersection{wxRichTextAttr::SetLineSpacing}\label{wxrichtextattrsetlinespacing}
746
747\func{void}{SetLineSpacing}{\param{int }{spacing}}
748
749Sets the line spacing. {\it spacing} is a multiple, where 10 means single-spacing,
75015 means 1.5 spacing, and 20 means double spacing. The following constants are
751defined for convenience:
752
753{\small
754\begin{verbatim}
755#define wxTEXT_ATTR_LINE_SPACING_NORMAL 10
756#define wxTEXT_ATTR_LINE_SPACING_HALF 15
757#define wxTEXT_ATTR_LINE_SPACING_TWICE 20
758\end{verbatim}
759}
760
d2d0adc7
JS
761\membersection{wxRichTextAttr::SetListStyleName}\label{wxrichtextattrsetliststylename}
762
763\func{void}{SetListStyleName}{\param{const wxString\& }{name}}
764
765Sets the list style name.
766
4d6d8bf4
JS
767\membersection{wxRichTextAttr::SetOutlineLevel}\label{wxrichtextattrsetoutlinelevel}
768
769\func{void}{SetOutlineLevel}{\param{int}{ level}}
770
771Specifies the outline level. Zero represents normal text. At present, the outline level is
772not used, but may be used in future for determining list levels and for applications
773that need to store document structure information.
774
36f01cc7
JS
775\membersection{wxRichTextAttr::SetPageBreak}\label{wxrichtextattrsetpagebreak}
776
777\func{void}{SetPageBreak}{\param{bool}{ pageBreak = true}}
778
779Specifies a page break before this paragraph.
780
5f35b46a
JS
781\membersection{wxRichTextAttr::SetParagraphSpacingAfter}\label{wxrichtextattrsetparagraphspacingafter}
782
783\func{void}{SetParagraphSpacingAfter}{\param{int }{spacing}}
784
785Sets the spacing after a paragraph, in tenths of a millimetre.
786
787\membersection{wxRichTextAttr::SetParagraphSpacingBefore}\label{wxrichtextattrsetparagraphspacingbefore}
788
789\func{void}{SetParagraphSpacingBefore}{\param{int }{spacing}}
790
791Sets the spacing before a paragraph, in tenths of a millimetre.
792
793\membersection{wxRichTextAttr::SetParagraphStyleName}\label{wxrichtextattrsetparagraphstylename}
794
795\func{void}{SetParagraphStyleName}{\param{const wxString\& }{name}}
796
797Sets the name of the paragraph style.
798
799\membersection{wxRichTextAttr::SetRightIndent}\label{wxrichtextattrsetrightindent}
800
801\func{void}{SetRightIndent}{\param{int }{indent}}
802
803Sets the right indent in tenths of a millimetre.
804
805\membersection{wxRichTextAttr::SetTabs}\label{wxrichtextattrsettabs}
806
807\func{void}{SetTabs}{\param{const wxArrayInt\& }{tabs}}
808
809Sets the tab stops, expressed in tenths of a millimetre.
810Each stop is measured from the left margin and therefore each value must be larger than the last.
811
812\membersection{wxRichTextAttr::SetTextColour}\label{wxrichtextattrsettextcolour}
813
814\func{void}{SetTextColour}{\param{const wxColour\& }{colText}}
815
816Sets the text foreground colout.
817
1f65137f
JS
818\membersection{wxRichTextAttr::SetTextEffectFlags}\label{wxrichtextattrsettexteffectflags}
819
820\func{void}{SetTextEffectFlags}{\param{int }{flags}}
821
822Sets the text effect bits of interest. You should also pass wxTEXT\_ATTR\_EFFECTS to \helpref{wxRichTextAttr::SetFlags}{wxrichtextattrsetflags}.
823See \helpref{wxRichTextAttr::SetFlags}{wxrichtextattrsetflags} for further information.
824
825\membersection{wxRichTextAttr::SetTextEffects}\label{wxrichtextattrsettexteffects}
826
827\func{void}{SetTextEffects}{\param{int }{effects}}
828
829Sets the text effects, a bit list of styles.
830
831The following styles can be passed:
832
833{\small
834\begin{verbatim}
835#define wxTEXT_ATTR_EFFECT_NONE 0x00000000
836#define wxTEXT_ATTR_EFFECT_CAPITALS 0x00000001
837#define wxTEXT_ATTR_EFFECT_SMALL_CAPITALS 0x00000002
838#define wxTEXT_ATTR_EFFECT_STRIKETHROUGH 0x00000004
839#define wxTEXT_ATTR_EFFECT_DOUBLE_STRIKETHROUGH 0x00000008
840#define wxTEXT_ATTR_EFFECT_SHADOW 0x00000010
841#define wxTEXT_ATTR_EFFECT_EMBOSS 0x00000020
842#define wxTEXT_ATTR_EFFECT_OUTLINE 0x00000040
843#define wxTEXT_ATTR_EFFECT_ENGRAVE 0x00000080
844#define wxTEXT_ATTR_EFFECT_SUPERSCRIPT 0x00000100
845#define wxTEXT_ATTR_EFFECT_SUBSCRIPT 0x00000200
846\end{verbatim}
847}
848
849Of these, only wxTEXT\_ATTR\_EFFECT\_CAPITALS and wxTEXT\_ATTR\_EFFECT\_STRIKETHROUGH are implemented.
850wxTEXT\_ATTR\_EFFECT\_CAPITALS capitalises text when displayed (leaving the case of the actual buffer
851text unchanged), and wxTEXT\_ATTR\_EFFECT\_STRIKETHROUGH draws a line through text.
852
853To set effects, you should also pass wxTEXT\_ATTR\_EFFECTS to \helpref{wxRichTextAttr::SetFlags}{wxrichtextattrsetflags}, and call\rtfsp
854\helpref{wxRichTextAttr::SetTextEffectFlags}{wxrichtextattrsettexteffectflags} with the styles (taken from the
855above set) that you are interested in setting.
856
d2d0adc7
JS
857\membersection{wxRichTextAttr::SetURL}\label{wxrichtextattrseturl}
858
859\func{void}{SetURL}{\param{const wxString\& }{url}}
860
861Sets the URL for the content. Sets the wxTEXT\_ATTR\_URL style; content with this style
862causes wxRichTextCtrl to show a hand cursor over it, and wxRichTextCtrl generates
863a wxTextUrlEvent when the content is clicked.
864
5f35b46a
JS
865\membersection{wxRichTextAttr::operator=}\label{wxrichtextattroperatorassign}
866
867\func{void operator}{operator=}{\param{const wxTextAttrEx\& }{attr}}
868
869Assignment from a \helpref{wxTextAttrEx}{wxtextattr} object.
870
871\func{void operator}{operator=}{\param{const wxRichTextAttr\& }{attr}}
872
873Assignment from a \helpref{wxRichTextAttr}{wxrichtextattr} object.
874
875\membersection{wxRichTextAttr::wxTextAttrEx}\label{wxrichtextattrwxtextattrex}
876
877\constfunc{operator}{wxTextAttrEx}{\void}
878
879Makes a \helpref{wxTextAttrEx}{wxtextattrex} object from this object.
62a268cc 880