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