1 \section{\class{wxRichTextAttr
}}\label{wxrichtextattr
}
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.
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.
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.
15 \wxheading{Derived from
}
19 \wxheading{Include files
}
21 <wx/richtext/richtextbuffer.h>
25 The following values can be passed to wxRichTextAttr::SetAlignment to determine
30 enum wxTextAttrAlignment
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
42 Of these, wxTEXT
\_ALIGNMENT\_JUSTIFIED is unimplemented. In future justification may be supported
43 when printing or previewing, only.
45 The following values are passed in a bitlist to wxRichTextAttr::SetFlags to determine
46 what attributes will be considered when setting the attributes
51 // Standard wxTextAttr constants
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
68 // Extra formatting flags not in wxTextAttr
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
86 The following styles can be passed to wxRichTextAttr::SetBulletStyle:
90 #define wxTEXT_ATTR_BULLET_STYLE_NONE
0x00000000
91 #define wxTEXT_ATTR_BULLET_STYLE_ARABIC
0x00000001
92 #define wxTEXT_ATTR_BULLET_STYLE_LETTERS_UPPER
0x00000002
93 #define wxTEXT_ATTR_BULLET_STYLE_LETTERS_LOWER
0x00000004
94 #define wxTEXT_ATTR_BULLET_STYLE_ROMAN_UPPER
0x00000008
95 #define wxTEXT_ATTR_BULLET_STYLE_ROMAN_LOWER
0x00000010
96 #define wxTEXT_ATTR_BULLET_STYLE_SYMBOL
0x00000020
97 #define wxTEXT_ATTR_BULLET_STYLE_BITMAP
0x00000040
98 #define wxTEXT_ATTR_BULLET_STYLE_PARENTHESES
0x00000080
99 #define wxTEXT_ATTR_BULLET_STYLE_PERIOD
0x00000100
100 #define wxTEXT_ATTR_BULLET_STYLE_STANDARD
0x00000200
101 #define wxTEXT_ATTR_BULLET_STYLE_RIGHT_PARENTHESIS
0x00000400
102 #define wxTEXT_ATTR_BULLET_STYLE_OUTLINE
0x00000800
103 #define wxTEXT_ATTR_BULLET_STYLE_ALIGN_LEFT
0x00000000
104 #define wxTEXT_ATTR_BULLET_STYLE_ALIGN_RIGHT
0x00001000
105 #define wxTEXT_ATTR_BULLET_STYLE_ALIGN_CENTRE
0x00002000
109 Of these, wxTEXT
\_ATTR\_BULLET\_STYLE\_BITMAP is unimplemented.
111 The following constants can be passed to wxRichTextAttr::SetLineSpacing:
115 #define wxTEXT_ATTR_LINE_SPACING_NORMAL
10
116 #define wxTEXT_ATTR_LINE_SPACING_HALF
15
117 #define wxTEXT_ATTR_LINE_SPACING_TWICE
20
121 The following styles can be passed to wxTextAttrEx::SetTextEffects:
125 #define wxTEXT_ATTR_EFFECT_NONE
0x00000000
126 #define wxTEXT_ATTR_EFFECT_CAPITALS
0x00000001
127 #define wxTEXT_ATTR_EFFECT_SMALL_CAPITALS
0x00000002
128 #define wxTEXT_ATTR_EFFECT_STRIKETHROUGH
0x00000004
129 #define wxTEXT_ATTR_EFFECT_DOUBLE_STRIKETHROUGH
0x00000008
130 #define wxTEXT_ATTR_EFFECT_SHADOW
0x00000010
131 #define wxTEXT_ATTR_EFFECT_EMBOSS
0x00000020
132 #define wxTEXT_ATTR_EFFECT_OUTLINE
0x00000040
133 #define wxTEXT_ATTR_EFFECT_ENGRAVE
0x00000080
134 #define wxTEXT_ATTR_EFFECT_SUPERSCRIPT
0x00000100
135 #define wxTEXT_ATTR_EFFECT_SUBSCRIPT
0x00000200
139 Of these, only wxTEXT
\_ATTR\_EFFECT\_CAPITALS and wxTEXT
\_ATTR\_EFFECT\_STRIKETHROUGH are implemented.
143 \helpref{wxTextAttr
}{wxtextattr
},
\helpref{wxTextAttrEx
}{wxtextattrex
},
\helpref{wxRichTextCtrl
}{wxrichtextctrl
}
145 \latexignore{\rtfignore{\wxheading{Members
}}}
147 \membersection{wxRichTextAttr::wxRichTextAttr
}\label{wxrichtextattrwxrichtextattr
}
149 \func{}{wxRichTextAttr
}{\void}
151 \func{}{wxRichTextAttr
}{\param{const wxColour\&
}{colText
},
\param{const wxColour\&
}{colBack = wxNullColour
},
\param{wxTextAttrAlignment
}{alignment = wxTEXT
\_ALIGNMENT\_DEFAULT}}
153 \func{}{wxRichTextAttr
}{\param{const wxTextAttrEx\&
}{attr
}}
157 \membersection{wxRichTextAttr::CopyTo
}\label{wxrichtextattrcopyto
}
159 \constfunc{void
}{CopyTo
}{\param{wxTextAttrEx\&
}{attr
}}
161 Copies the wxRichTextAttr attributes to a
\helpref{wxTextAttrEx
}{wxtextattrex
} object.
163 \membersection{wxRichTextAttr::CreateFont
}\label{wxrichtextattrcreatefont
}
165 \constfunc{wxFont
}{CreateFont
}{\void}
167 Creates a font from the font attributes.
169 \membersection{wxRichTextAttr::GetAlignment
}\label{wxrichtextattrgetalignment
}
171 \constfunc{wxTextAttrAlignment
}{GetAlignment
}{\void}
173 Returns the alignment flags.
174 See
\helpref{wxRichTextAttr::SetAlignment
}{wxrichtextattrsetalignment
} for a list of available styles.
176 \membersection{wxRichTextAttr::GetBackgroundColour
}\label{wxrichtextattrgetbackgroundcolour
}
178 \constfunc{const wxColour\&
}{GetBackgroundColour
}{\void}
180 Returns the background colour.
182 \membersection{wxRichTextAttr::GetBulletFont
}\label{wxrichtextattrgetbulletfont
}
184 \constfunc{const wxString\&
}{GetBulletFont
}{\void}
186 Returns a string containing the name of the font associated with the bullet symbol.
187 Only valid for attributes with wxTEXT
\_ATTR\_BULLET\_SYMBOL.
189 \membersection{wxRichTextAttr::GetBulletName
}\label{wxrichtextattrgetbulletname
}
191 \constfunc{const wxString\&
}{GetBulletName
}{\void}
193 Returns the standard bullet name, applicable if the bullet style is wxTEXT
\_ATTR\_BULLET\_STYLE\_STANDARD.
194 Currently the following standard bullet names are supported:
196 \begin{itemize
}\itemsep=
0pt
197 \item {\tt standard/circle
}
198 \item {\tt standard/square
}
199 \item {\tt standard/diamond
}
200 \item {\tt standard/triangle
}
203 If you wish your application to support further bullet graphics, you can derive a
204 class from wxRichTextRenderer or wxRichTextStdRenderer, override
{\tt DrawStandardBullet
} and
{\tt EnumerateStandardBulletNames
}, and
205 set an instance of the class using
\helpref{wxRichTextBuffer::SetRenderer
}{wxrichtextbuffersetrenderer
}.
207 \membersection{wxRichTextAttr::GetBulletNumber
}\label{wxrichtextattrgetbulletnumber
}
209 \constfunc{int
}{GetBulletNumber
}{\void}
211 Returns the bullet number.
213 \membersection{wxRichTextAttr::GetBulletStyle
}\label{wxrichtextattrgetbulletstyle
}
215 \constfunc{int
}{GetBulletStyle
}{\void}
217 Returns the bullet style.
218 See
\helpref{wxRichTextAttr::SetBulletStyle
}{wxrichtextattrsetbulletstyle
} for a list of available styles.
220 \membersection{wxRichTextAttr::GetBulletText
}\label{wxrichtextattrgetbullettext
}
222 \constfunc{const wxString\&
}{GetBulletText
}{\void}
224 Returns the bullet text, which could be a symbol, or (for example) cached outline text.
226 \membersection{wxRichTextAttr::GetCharacterStyleName
}\label{wxrichtextattrgetcharacterstylename
}
228 \constfunc{const wxString\&
}{GetCharacterStyleName
}{\void}
230 Returns the name of the character style.
232 \membersection{wxRichTextAttr::GetFlags
}\label{wxrichtextattrgetflags
}
234 \constfunc{long
}{GetFlags
}{\void}
236 Returns flags indicating which attributes are applicable.
237 See
\helpref{wxRichTextAttr::SetFlags
}{wxrichtextattrsetflags
} for a list of available flags.
239 \membersection{wxRichTextAttr::GetFontAttributes
}\label{wxrichtextattrgetfontattributes
}
241 \func{bool
}{GetFontAttributes
}{\param{const wxFont\&
}{font
}}
243 Sets the font attributes from the given font.
245 \membersection{wxRichTextAttr::GetFontFaceName
}\label{wxrichtextattrgetfontfacename
}
247 \constfunc{const wxString\&
}{GetFontFaceName
}{\void}
249 Returns the font face name.
251 \membersection{wxRichTextAttr::GetFontSize
}\label{wxrichtextattrgetfontsize
}
253 \constfunc{int
}{GetFontSize
}{\void}
255 Returns the font size in points.
257 \membersection{wxRichTextAttr::GetFontStyle
}\label{wxrichtextattrgetfontstyle
}
259 \constfunc{int
}{GetFontStyle
}{\void}
261 Returns the font style.
263 \membersection{wxRichTextAttr::GetFontUnderlined
}\label{wxrichtextattrgetfontunderlined
}
265 \constfunc{bool
}{GetFontUnderlined
}{\void}
267 Returns
\true if the font is underlined.
269 \membersection{wxRichTextAttr::GetFontWeight
}\label{wxrichtextattrgetfontweight
}
271 \constfunc{int
}{GetFontWeight
}{\void}
273 Returns the font weight.
275 \membersection{wxRichTextAttr::GetLeftIndent
}\label{wxrichtextattrgetleftindent
}
277 \constfunc{long
}{GetLeftIndent
}{\void}
279 Returns the left indent in tenths of a millimetre.
281 \membersection{wxRichTextAttr::GetLeftSubIndent
}\label{wxrichtextattrgetleftsubindent
}
283 \constfunc{long
}{GetLeftSubIndent
}{\void}
285 Returns the left sub-indent in tenths of a millimetre.
287 \membersection{wxRichTextAttr::GetLineSpacing
}\label{wxrichtextattrgetlinespacing
}
289 \constfunc{int
}{GetLineSpacing
}{\void}
291 Returns the line spacing value, one of wxTEXT
\_ATTR\_LINE\_SPACING\_NORMAL,
292 wxTEXT
\_ATTR\_LINE\_SPACING\_HALF, and wxTEXT
\_ATTR\_LINE\_SPACING\_TWICE.
294 \membersection{wxRichTextAttr::GetListStyleName
}\label{wxrichtextattrgetliststylename
}
296 \constfunc{const wxString\&
}{GetListStyleName
}{\void}
298 Returns the name of the list style.
300 \membersection{wxRichTextAttr::GetParagraphSpacingAfter
}\label{wxrichtextattrgetparagraphspacingafter
}
302 \constfunc{int
}{GetParagraphSpacingAfter
}{\void}
304 Returns the space in tenths of a millimeter after the paragraph.
306 \membersection{wxRichTextAttr::GetParagraphSpacingBefore
}\label{wxrichtextattrgetparagraphspacingbefore
}
308 \constfunc{int
}{GetParagraphSpacingBefore
}{\void}
310 Returns the space in tenths of a millimeter before the paragraph.
312 \membersection{wxRichTextAttr::GetParagraphStyleName
}\label{wxrichtextattrgetparagraphstylename
}
314 \constfunc{const wxString\&
}{GetParagraphStyleName
}{\void}
316 Returns the name of the paragraph style.
318 \membersection{wxRichTextAttr::GetRightIndent
}\label{wxrichtextattrgetrightindent
}
320 \constfunc{long
}{GetRightIndent
}{\void}
322 Returns the right indent in tenths of a millimeter.
324 \membersection{wxRichTextAttr::GetTabs
}\label{wxrichtextattrgettabs
}
326 \constfunc{const wxArrayInt\&
}{GetTabs
}{\void}
328 Returns an array of tab stops, each expressed in tenths of a millimeter. Each stop
329 is measured from the left margin and therefore each value must be larger than the last.
331 \membersection{wxRichTextAttr::GetTextColour
}\label{wxrichtextattrgettextcolour
}
333 \constfunc{const wxColour\&
}{GetTextColour
}{\void}
335 Returns the text foreground colour.
337 \membersection{wxRichTextAttr::GetTextEffectFlags
}\label{wxrichtextattrgettexteffectflags
}
339 \constfunc{int
}{GetTextEffectFlags
}{\void}
341 Returns the text effect bits of interest. See
\helpref{wxRichTextAttr::SetFlags
}{wxrichtextattrsetflags
} for further information.
343 \membersection{wxRichTextAttr::GetTextEffects
}\label{wxrichtextattrgettexteffects
}
345 \constfunc{int
}{GetTextEffects
}{\void}
347 Returns the text effects, a bit list of styles. See
\helpref{wxRichTextAttr::SetTextEffects
}{wxrichtextattrsettexteffects
} for
350 \membersection{wxRichTextAttr::GetURL
}\label{wxrichtextattrgeturl
}
352 \constfunc{const wxString\&
}{GetURL
}{\void}
354 Returns the URL for the content. Content with wxTEXT
\_ATTR\_URL style
355 causes wxRichTextCtrl to show a hand cursor over it, and wxRichTextCtrl generates
356 a wxTextUrlEvent when the content is clicked.
358 \membersection{wxRichTextAttr::HasAlignment
}\label{wxrichtextattrhasalignment
}
360 \constfunc{bool
}{HasAlignment
}{\void}
362 Returns
\true if the attribute object specifies alignment.
364 \membersection{wxRichTextAttr::HasBackgroundColour
}\label{wxrichtextattrhasbackgroundcolour
}
366 \constfunc{bool
}{HasBackgroundColour
}{\void}
368 Returns
\true if the attribute object specifies a background colour.
370 \membersection{wxRichTextAttr::HasBulletName
}\label{wxrichtextattrhasbulletname
}
372 \constfunc{bool
}{HasBulletName
}{\void}
374 Returns
\true if the attribute object specifies a standard bullet name.
376 \membersection{wxRichTextAttr::HasBulletNumber
}\label{wxrichtextattrhasbulletnumber
}
378 \constfunc{bool
}{HasBulletNumber
}{\void}
380 Returns
\true if the attribute object specifies a bullet number.
382 \membersection{wxRichTextAttr::HasBulletStyle
}\label{wxrichtextattrhasbulletstyle
}
384 \constfunc{bool
}{HasBulletStyle
}{\void}
386 Returns
\true if the attribute object specifies a bullet style.
388 \membersection{wxRichTextAttr::HasBulletText
}\label{wxrichtextattrhasbullettext
}
390 \constfunc{bool
}{HasBulletText
}{\void}
392 Returns
\true if the attribute object specifies bullet text (usually specifying a symbol).
394 \membersection{wxRichTextAttr::HasCharacterStyleName
}\label{wxrichtextattrhascharacterstylename
}
396 \constfunc{bool
}{HasCharacterStyleName
}{\void}
398 Returns
\true if the attribute object specifies a character style name.
400 \membersection{wxRichTextAttr::HasFaceName
}\label{wxrichtextattrhasfacename
}
402 \constfunc{bool
}{HasFaceName
}{\void}
404 Returns
\true if the attribute object specifies a font face name.
406 \membersection{wxRichTextAttr::HasFlag
}\label{wxrichtextattrhasflag
}
408 \constfunc{bool
}{HasFlag
}{\param{long
}{flag
}}
410 Returns
\true if the
{\it flag
} is present in the attribute object's flag bitlist.
412 \membersection{wxRichTextAttr::HasFont
}\label{wxrichtextattrhasfont
}
414 \constfunc{bool
}{HasFont
}{\void}
416 Returns
\true if the attribute object specifies any font attributes.
418 \membersection{wxRichTextAttr::HasItalic
}\label{wxrichtextattrhasitalic
}
420 \constfunc{bool
}{HasItalic
}{\void}
422 Returns
\true if the attribute object specifies italic style.
424 \membersection{wxRichTextAttr::HasLeftIndent
}\label{wxrichtextattrhasleftindent
}
426 \constfunc{bool
}{HasLeftIndent
}{\void}
428 Returns
\true if the attribute object specifies a left indent.
430 \membersection{wxRichTextAttr::HasLineSpacing
}\label{wxrichtextattrhaslinespacing
}
432 \constfunc{bool
}{HasLineSpacing
}{\void}
434 Returns
\true if the attribute object specifies line spacing.
436 \membersection{wxRichTextAttr::HasListStyleName
}\label{wxrichtextattrhasliststylename
}
438 \constfunc{bool
}{HasListStyleName
}{\void}
440 Returns
\true if the attribute object specifies a list style name.
442 \membersection{wxRichTextAttr::HasPageBreak
}\label{wxrichtextattrhaspagebreak
}
444 \constfunc{bool
}{HasPageBreak
}{\void}
446 Returns
\true if the attribute object specifies a page break before this paragraph.
448 \membersection{wxRichTextAttr::HasParagraphSpacingAfter
}\label{wxrichtextattrhasparagraphspacingafter
}
450 \constfunc{bool
}{HasParagraphSpacingAfter
}{\void}
452 Returns
\true if the attribute object specifies spacing after a paragraph.
454 \membersection{wxRichTextAttr::HasParagraphSpacingBefore
}\label{wxrichtextattrhasparagraphspacingbefore
}
456 \constfunc{bool
}{HasParagraphSpacingBefore
}{\void}
458 Returns
\true if the attribute object specifies spacing before a paragraph.
460 \membersection{wxRichTextAttr::HasParagraphStyleName
}\label{wxrichtextattrhasparagraphstylename
}
462 \constfunc{bool
}{HasParagraphStyleName
}{\void}
464 Returns
\true if the attribute object specifies a paragraph style name.
466 \membersection{wxRichTextAttr::HasRightIndent
}\label{wxrichtextattrhasrightindent
}
468 \constfunc{bool
}{HasRightIndent
}{\void}
470 Returns
\true if the attribute object specifies a right indent.
472 \membersection{wxRichTextAttr::HasSize
}\label{wxrichtextattrhassize
}
474 \constfunc{bool
}{HasSize
}{\void}
476 Returns
\true if the attribute object specifies a font point size.
478 \membersection{wxRichTextAttr::HasTabs
}\label{wxrichtextattrhastabs
}
480 \constfunc{bool
}{HasTabs
}{\void}
482 Returns
\true if the attribute object specifies tab stops.
484 \membersection{wxRichTextAttr::HasTextColour
}\label{wxrichtextattrhastextcolour
}
486 \constfunc{bool
}{HasTextColour
}{\void}
488 Returns
\true if the attribute object specifies a text foreground colour.
490 \membersection{wxRichTextAttr::HasUnderlined
}\label{wxrichtextattrhasunderlined
}
492 \constfunc{bool
}{HasUnderlined
}{\void}
494 Returns
\true if the attribute object specifies either underlining or no underlining.
496 \membersection{wxRichTextAttr::HasWeight
}\label{wxrichtextattrhasweight
}
498 \constfunc{bool
}{HasWeight
}{\void}
500 Returns
\true if the attribute object specifies font weight (bold, light or normal).
502 \membersection{wxRichTextAttr::Init
}\label{wxrichtextattrinit
}
504 \func{void
}{Init
}{\void}
506 Initialise the object.
508 \membersection{wxRichTextAttr::IsCharacterStyle
}\label{wxrichtextattrischaracterstyle
}
510 \constfunc{bool
}{IsCharacterStyle
}{\void}
512 Returns
\true if the object represents a character style, that is,
513 the flags specify a font or a text background or foreground colour.
515 \membersection{wxRichTextAttr::IsDefault
}\label{wxrichtextattrisdefault
}
517 \constfunc{bool
}{IsDefault
}{\void}
519 Returns
\false if we have any attributes set,
\true otherwise.
521 \membersection{wxRichTextAttr::IsParagraphStyle
}\label{wxrichtextattrisparagraphstyle
}
523 \constfunc{bool
}{IsParagraphStyle
}{\void}
525 Returns
\true if the object represents a paragraph style, that is,
526 the flags specify alignment, indentation, tabs, paragraph spacing, or
529 \membersection{wxRichTextAttr::SetAlignment
}\label{wxrichtextattrsetalignment
}
531 \func{void
}{SetAlignment
}{\param{wxTextAttrAlignment
}{alignment
}}
533 Sets the paragraph alignment. These are the possible values for
{\it alignment
}:
537 enum wxTextAttrAlignment
539 wxTEXT_ALIGNMENT_DEFAULT,
540 wxTEXT_ALIGNMENT_LEFT,
541 wxTEXT_ALIGNMENT_CENTRE,
542 wxTEXT_ALIGNMENT_CENTER = wxTEXT_ALIGNMENT_CENTRE,
543 wxTEXT_ALIGNMENT_RIGHT,
544 wxTEXT_ALIGNMENT_JUSTIFIED
549 Of these, wxTEXT
\_ALIGNMENT\_JUSTIFIED is unimplemented. In future justification may be supported
550 when printing or previewing, only.
552 \membersection{wxRichTextAttr::SetBackgroundColour
}\label{wxrichtextattrsetbackgroundcolour
}
554 \func{void
}{SetBackgroundColour
}{\param{const wxColour\&
}{colBack
}}
556 Sets the background colour.
558 \membersection{wxRichTextAttr::SetBulletFont
}\label{wxrichtextattrsetbulletfont
}
560 \func{void
}{SetBulletFont
}{\param{const wxString\&
}{font
}}
562 Sets the name of the font associated with the bullet symbol.
563 Only valid for attributes with wxTEXT
\_ATTR\_BULLET\_SYMBOL.
565 \membersection{wxRichTextAttr::SetBulletName
}\label{wxrichtextattrsetbulletname
}
567 \func{void
}{SetBulletName
}{\param{const wxString\&
}{name
}}
569 Sets the standard bullet name, applicable if the bullet style is wxTEXT
\_ATTR\_BULLET\_STYLE\_STANDARD.
570 See
\helpref{wxRichTextAttr::GetBulletName
}{wxrichtextattrgetbulletname
} for a list
571 of supported names, and how to expand the range of supported types.
573 \membersection{wxRichTextAttr::SetBulletNumber
}\label{wxrichtextattrsetbulletnumber
}
575 \func{void
}{SetBulletNumber
}{\param{int
}{n
}}
577 Sets the bullet number.
579 \membersection{wxRichTextAttr::SetBulletStyle
}\label{wxrichtextattrsetbulletstyle
}
581 \func{void
}{SetBulletStyle
}{\param{int
}{style
}}
583 Sets the bullet style. The following styles can be passed:
587 #define wxTEXT_ATTR_BULLET_STYLE_NONE
0x00000000
588 #define wxTEXT_ATTR_BULLET_STYLE_ARABIC
0x00000001
589 #define wxTEXT_ATTR_BULLET_STYLE_LETTERS_UPPER
0x00000002
590 #define wxTEXT_ATTR_BULLET_STYLE_LETTERS_LOWER
0x00000004
591 #define wxTEXT_ATTR_BULLET_STYLE_ROMAN_UPPER
0x00000008
592 #define wxTEXT_ATTR_BULLET_STYLE_ROMAN_LOWER
0x00000010
593 #define wxTEXT_ATTR_BULLET_STYLE_SYMBOL
0x00000020
594 #define wxTEXT_ATTR_BULLET_STYLE_BITMAP
0x00000040
595 #define wxTEXT_ATTR_BULLET_STYLE_PARENTHESES
0x00000080
596 #define wxTEXT_ATTR_BULLET_STYLE_PERIOD
0x00000100
597 #define wxTEXT_ATTR_BULLET_STYLE_STANDARD
0x00000200
598 #define wxTEXT_ATTR_BULLET_STYLE_RIGHT_PARENTHESIS
0x00000400
599 #define wxTEXT_ATTR_BULLET_STYLE_OUTLINE
0x00000800
600 #define wxTEXT_ATTR_BULLET_STYLE_ALIGN_LEFT
0x00000000
601 #define wxTEXT_ATTR_BULLET_STYLE_ALIGN_RIGHT
0x00001000
602 #define wxTEXT_ATTR_BULLET_STYLE_ALIGN_CENTRE
0x00002000
606 Currently wxTEXT
\_ATTR\_BULLET\_STYLE\_BITMAP is not supported.
608 \membersection{wxRichTextAttr::SetBulletText
}\label{wxrichtextattrsetbullettext
}
610 \func{void
}{SetBulletText
}{\param{const wxString&
}{text
}}
612 Sets the bullet text, which could be a symbol, or (for example) cached outline text.
614 \membersection{wxRichTextAttr::SetCharacterStyleName
}\label{wxrichtextattrsetcharacterstylename
}
616 \func{void
}{SetCharacterStyleName
}{\param{const wxString\&
}{name
}}
618 Sets the character style name.
620 \membersection{wxRichTextAttr::SetFlags
}\label{wxrichtextattrsetflags
}
622 \func{void
}{SetFlags
}{\param{long
}{flags
}}
624 Sets the flags determining which styles are being specified. The following
625 flags can be passed in a bitlist:
629 // Standard wxTextAttr constants
631 #define wxTEXT_ATTR_TEXT_COLOUR
0x00000001
632 #define wxTEXT_ATTR_BACKGROUND_COLOUR
0x00000002
633 #define wxTEXT_ATTR_FONT_FACE
0x00000004
634 #define wxTEXT_ATTR_FONT_SIZE
0x00000008
635 #define wxTEXT_ATTR_FONT_WEIGHT
0x00000010
636 #define wxTEXT_ATTR_FONT_ITALIC
0x00000020
637 #define wxTEXT_ATTR_FONT_UNDERLINE
0x00000040
638 #define wxTEXT_ATTR_FONT \
639 wxTEXT_ATTR_FONT_FACE | wxTEXT_ATTR_FONT_SIZE | wxTEXT_ATTR_FONT_WEIGHT \
640 | wxTEXT_ATTR_FONT_ITALIC | wxTEXT_ATTR_FONT_UNDERLINE
641 #define wxTEXT_ATTR_ALIGNMENT
0x00000080
642 #define wxTEXT_ATTR_LEFT_INDENT
0x00000100
643 #define wxTEXT_ATTR_RIGHT_INDENT
0x00000200
644 #define wxTEXT_ATTR_TABS
0x00000400
646 // Extra formatting flags not in wxTextAttr
648 #define wxTEXT_ATTR_PARA_SPACING_AFTER
0x00000800
649 #define wxTEXT_ATTR_PARA_SPACING_BEFORE
0x00001000
650 #define wxTEXT_ATTR_LINE_SPACING
0x00002000
651 #define wxTEXT_ATTR_CHARACTER_STYLE_NAME
0x00004000
652 #define wxTEXT_ATTR_PARAGRAPH_STYLE_NAME
0x00008000
653 #define wxTEXT_ATTR_LIST_STYLE_NAME
0x00010000
654 #define wxTEXT_ATTR_BULLET_STYLE
0x00020000
655 #define wxTEXT_ATTR_BULLET_NUMBER
0x00040000
656 #define wxTEXT_ATTR_BULLET_TEXT
0x00080000
657 #define wxTEXT_ATTR_BULLET_NAME
0x00100000
658 #define wxTEXT_ATTR_URL
0x00200000
659 #define wxTEXT_ATTR_PAGE_BREAK
0x00400000
660 #define wxTEXT_ATTR_EFFECTS
0x00800000
664 \membersection{wxRichTextAttr::SetFontFaceName
}\label{wxrichtextattrsetfontfacename
}
666 \func{void
}{SetFontFaceName
}{\param{const wxString\&
}{faceName
}}
668 Sets the paragraph alignment.
670 \membersection{wxRichTextAttr::SetFontSize
}\label{wxrichtextattrsetfontsize
}
672 \func{void
}{SetFontSize
}{\param{int
}{pointSize
}}
674 Sets the font size in points.
676 \membersection{wxRichTextAttr::SetFontStyle
}\label{wxrichtextattrsetfontstyle
}
678 \func{void
}{SetFontStyle
}{\param{int
}{fontStyle
}}
680 Sets the font style (normal, italic or slanted).
682 \membersection{wxRichTextAttr::SetFontUnderlined
}\label{wxrichtextattrsetfontunderlined
}
684 \func{void
}{SetFontUnderlined
}{\param{bool
}{underlined
}}
686 Sets the font underlining.
688 \membersection{wxRichTextAttr::SetFontWeight
}\label{wxrichtextattrsetfontweight
}
690 \func{void
}{SetFontWeight
}{\param{int
}{fontWeight
}}
692 Sets the font weight.
694 \membersection{wxRichTextAttr::SetLeftIndent
}\label{wxrichtextattrsetleftindent
}
696 \func{void
}{SetLeftIndent
}{\param{int
}{indent
},
\param{int
}{subIndent =
0}}
698 Sets the left indent and left subindent in tenths of a millimetre.
700 The sub-indent is an offset from the left of the paragraph, and is used for all but the
701 first line in a paragraph. A positive value will cause the first line to appear to the left
702 of the subsequent lines, and a negative value will cause the first line to be indented
703 relative to the subsequent lines.
705 wxRichTextBuffer uses indentation to render a bulleted item. The left indent is the distance between
706 the margin and the bullet. The content of the paragraph, including the first line, starts
707 at leftMargin + leftSubIndent. So the distance between the left edge of the bullet and the
708 left of the actual paragraph is leftSubIndent.
710 \membersection{wxRichTextAttr::SetLineSpacing
}\label{wxrichtextattrsetlinespacing
}
712 \func{void
}{SetLineSpacing
}{\param{int
}{spacing
}}
714 Sets the line spacing.
{\it spacing
} is a multiple, where
10 means single-spacing,
715 15 means
1.5 spacing, and
20 means double spacing. The following constants are
716 defined for convenience:
720 #define wxTEXT_ATTR_LINE_SPACING_NORMAL
10
721 #define wxTEXT_ATTR_LINE_SPACING_HALF
15
722 #define wxTEXT_ATTR_LINE_SPACING_TWICE
20
726 \membersection{wxRichTextAttr::SetListStyleName
}\label{wxrichtextattrsetliststylename
}
728 \func{void
}{SetListStyleName
}{\param{const wxString\&
}{name
}}
730 Sets the list style name.
732 \membersection{wxRichTextAttr::SetPageBreak
}\label{wxrichtextattrsetpagebreak
}
734 \func{void
}{SetPageBreak
}{\param{bool
}{ pageBreak = true
}}
736 Specifies a page break before this paragraph.
738 \membersection{wxRichTextAttr::SetParagraphSpacingAfter
}\label{wxrichtextattrsetparagraphspacingafter
}
740 \func{void
}{SetParagraphSpacingAfter
}{\param{int
}{spacing
}}
742 Sets the spacing after a paragraph, in tenths of a millimetre.
744 \membersection{wxRichTextAttr::SetParagraphSpacingBefore
}\label{wxrichtextattrsetparagraphspacingbefore
}
746 \func{void
}{SetParagraphSpacingBefore
}{\param{int
}{spacing
}}
748 Sets the spacing before a paragraph, in tenths of a millimetre.
750 \membersection{wxRichTextAttr::SetParagraphStyleName
}\label{wxrichtextattrsetparagraphstylename
}
752 \func{void
}{SetParagraphStyleName
}{\param{const wxString\&
}{name
}}
754 Sets the name of the paragraph style.
756 \membersection{wxRichTextAttr::SetRightIndent
}\label{wxrichtextattrsetrightindent
}
758 \func{void
}{SetRightIndent
}{\param{int
}{indent
}}
760 Sets the right indent in tenths of a millimetre.
762 \membersection{wxRichTextAttr::SetTabs
}\label{wxrichtextattrsettabs
}
764 \func{void
}{SetTabs
}{\param{const wxArrayInt\&
}{tabs
}}
766 Sets the tab stops, expressed in tenths of a millimetre.
767 Each stop is measured from the left margin and therefore each value must be larger than the last.
769 \membersection{wxRichTextAttr::SetTextColour
}\label{wxrichtextattrsettextcolour
}
771 \func{void
}{SetTextColour
}{\param{const wxColour\&
}{colText
}}
773 Sets the text foreground colout.
775 \membersection{wxRichTextAttr::SetTextEffectFlags
}\label{wxrichtextattrsettexteffectflags
}
777 \func{void
}{SetTextEffectFlags
}{\param{int
}{flags
}}
779 Sets the text effect bits of interest. You should also pass wxTEXT
\_ATTR\_EFFECTS to
\helpref{wxRichTextAttr::SetFlags
}{wxrichtextattrsetflags
}.
780 See
\helpref{wxRichTextAttr::SetFlags
}{wxrichtextattrsetflags
} for further information.
782 \membersection{wxRichTextAttr::SetTextEffects
}\label{wxrichtextattrsettexteffects
}
784 \func{void
}{SetTextEffects
}{\param{int
}{effects
}}
786 Sets the text effects, a bit list of styles.
788 The following styles can be passed:
792 #define wxTEXT_ATTR_EFFECT_NONE
0x00000000
793 #define wxTEXT_ATTR_EFFECT_CAPITALS
0x00000001
794 #define wxTEXT_ATTR_EFFECT_SMALL_CAPITALS
0x00000002
795 #define wxTEXT_ATTR_EFFECT_STRIKETHROUGH
0x00000004
796 #define wxTEXT_ATTR_EFFECT_DOUBLE_STRIKETHROUGH
0x00000008
797 #define wxTEXT_ATTR_EFFECT_SHADOW
0x00000010
798 #define wxTEXT_ATTR_EFFECT_EMBOSS
0x00000020
799 #define wxTEXT_ATTR_EFFECT_OUTLINE
0x00000040
800 #define wxTEXT_ATTR_EFFECT_ENGRAVE
0x00000080
801 #define wxTEXT_ATTR_EFFECT_SUPERSCRIPT
0x00000100
802 #define wxTEXT_ATTR_EFFECT_SUBSCRIPT
0x00000200
806 Of these, only wxTEXT
\_ATTR\_EFFECT\_CAPITALS and wxTEXT
\_ATTR\_EFFECT\_STRIKETHROUGH are implemented.
807 wxTEXT
\_ATTR\_EFFECT\_CAPITALS capitalises text when displayed (leaving the case of the actual buffer
808 text unchanged), and wxTEXT
\_ATTR\_EFFECT\_STRIKETHROUGH draws a line through text.
810 To set effects, you should also pass wxTEXT
\_ATTR\_EFFECTS to
\helpref{wxRichTextAttr::SetFlags
}{wxrichtextattrsetflags
}, and call
\rtfsp
811 \helpref{wxRichTextAttr::SetTextEffectFlags
}{wxrichtextattrsettexteffectflags
} with the styles (taken from the
812 above set) that you are interested in setting.
814 \membersection{wxRichTextAttr::SetURL
}\label{wxrichtextattrseturl
}
816 \func{void
}{SetURL
}{\param{const wxString\&
}{url
}}
818 Sets the URL for the content. Sets the wxTEXT
\_ATTR\_URL style; content with this style
819 causes wxRichTextCtrl to show a hand cursor over it, and wxRichTextCtrl generates
820 a wxTextUrlEvent when the content is clicked.
822 \membersection{wxRichTextAttr::operator=
}\label{wxrichtextattroperatorassign
}
824 \func{void operator
}{operator=
}{\param{const wxTextAttrEx\&
}{attr
}}
826 Assignment from a
\helpref{wxTextAttrEx
}{wxtextattr
} object.
828 \func{void operator
}{operator=
}{\param{const wxRichTextAttr\&
}{attr
}}
830 Assignment from a
\helpref{wxRichTextAttr
}{wxrichtextattr
} object.
832 \membersection{wxRichTextAttr::wxTextAttrEx
}\label{wxrichtextattrwxtextattrex
}
834 \constfunc{operator
}{wxTextAttrEx
}{\void}
836 Makes a
\helpref{wxTextAttrEx
}{wxtextattrex
} object from this object.