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