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