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