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