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 s SetFont, the relevant bit will be set.
12 wxRichTextAttr stores attributes without a wxFont object, so is a much more
13 efficient way to query styles than using a
\helpref{wxTextAttr
}{wxtextattr
} or
\helpref{wxTextAttrEx
}{wxtextattrex
} object.
15 \wxheading{Derived from
}
19 \wxheading{Include files
}
21 <wx/richtext/richtextbuffer.h>
25 The following values can be passed to 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 These values are passed in a bitlist to SetFlags to determine
43 what attributes will be considered when setting the attributes
48 // Standard wxTextAttr constants
50 #define wxTEXT_ATTR_TEXT_COLOUR
0x0001
51 #define wxTEXT_ATTR_BACKGROUND_COLOUR
0x0002
52 #define wxTEXT_ATTR_FONT_FACE
0x0004
53 #define wxTEXT_ATTR_FONT_SIZE
0x0008
54 #define wxTEXT_ATTR_FONT_WEIGHT
0x0010
55 #define wxTEXT_ATTR_FONT_ITALIC
0x0020
56 #define wxTEXT_ATTR_FONT_UNDERLINE
0x0040
57 #define wxTEXT_ATTR_FONT \
58 wxTEXT_ATTR_FONT_FACE | wxTEXT_ATTR_FONT_SIZE | wxTEXT_ATTR_FONT_WEIGHT \
59 | wxTEXT_ATTR_FONT_ITALIC | wxTEXT_ATTR_FONT_UNDERLINE
60 #define wxTEXT_ATTR_ALIGNMENT
0x0080
61 #define wxTEXT_ATTR_LEFT_INDENT
0x0100
62 #define wxTEXT_ATTR_RIGHT_INDENT
0x0200
63 #define wxTEXT_ATTR_TABS
0x0400
65 // Extra formatting flags not in wxTextAttr
67 #define wxTEXT_ATTR_PARA_SPACING_AFTER
0x00000800
68 #define wxTEXT_ATTR_PARA_SPACING_BEFORE
0x00001000
69 #define wxTEXT_ATTR_LINE_SPACING
0x00002000
70 #define wxTEXT_ATTR_CHARACTER_STYLE_NAME
0x00004000
71 #define wxTEXT_ATTR_PARAGRAPH_STYLE_NAME
0x00008000
72 #define wxTEXT_ATTR_LIST_STYLE_NAME
0x00010000
73 #define wxTEXT_ATTR_BULLET_STYLE
0x00020000
74 #define wxTEXT_ATTR_BULLET_NUMBER
0x00040000
75 #define wxTEXT_ATTR_BULLET_TEXT
0x00080000
76 #define wxTEXT_ATTR_BULLET_NAME
0x00100000
77 #define wxTEXT_ATTR_URL
0x00200000
78 #define wxTEXT_ATTR_PAGE_BREAK
0x00400000
82 The following styles can be passed to wxRichTextAttr::SetBulletStyle:
86 #define wxTEXT_ATTR_BULLET_STYLE_NONE
0x00000000
87 #define wxTEXT_ATTR_BULLET_STYLE_ARABIC
0x00000001
88 #define wxTEXT_ATTR_BULLET_STYLE_LETTERS_UPPER
0x00000002
89 #define wxTEXT_ATTR_BULLET_STYLE_LETTERS_LOWER
0x00000004
90 #define wxTEXT_ATTR_BULLET_STYLE_ROMAN_UPPER
0x00000008
91 #define wxTEXT_ATTR_BULLET_STYLE_ROMAN_LOWER
0x00000010
92 #define wxTEXT_ATTR_BULLET_STYLE_SYMBOL
0x00000020
93 #define wxTEXT_ATTR_BULLET_STYLE_BITMAP
0x00000040
94 #define wxTEXT_ATTR_BULLET_STYLE_PARENTHESES
0x00000080
95 #define wxTEXT_ATTR_BULLET_STYLE_PERIOD
0x00000100
96 #define wxTEXT_ATTR_BULLET_STYLE_STANDARD
0x00000200
97 #define wxTEXT_ATTR_BULLET_STYLE_RIGHT_PARENTHESIS
0x00000400
98 #define wxTEXT_ATTR_BULLET_STYLE_OUTLINE
0x00000800
99 #define wxTEXT_ATTR_BULLET_STYLE_ALIGN_LEFT
0x00000000
100 #define wxTEXT_ATTR_BULLET_STYLE_ALIGN_RIGHT
0x00001000
101 #define wxTEXT_ATTR_BULLET_STYLE_ALIGN_CENTRE
0x00002000
105 The following constants can be passed to wxRichTextAttr::SetLineSpacing:
109 #define wxTEXT_ATTR_LINE_SPACING_NORMAL
10
110 #define wxTEXT_ATTR_LINE_SPACING_HALF
15
111 #define wxTEXT_ATTR_LINE_SPACING_TWICE
20
117 \helpref{wxTextAttr
}{wxtextattr
},
\helpref{wxTextAttrEx
}{wxtextattrex
},
\helpref{wxRichTextCtrl
}{wxrichtextctrl
}
119 \latexignore{\rtfignore{\wxheading{Members
}}}
121 \membersection{wxRichTextAttr::wxRichTextAttr
}\label{wxrichtextattrwxrichtextattr
}
123 \func{}{wxRichTextAttr
}{\void}
125 \func{}{wxRichTextAttr
}{\param{const wxColour\&
}{colText
},
\param{const wxColour\&
}{colBack = wxNullColour
},
\param{wxTextAttrAlignment
}{alignment = wxTEXT
\_ALIGNMENT\_DEFAULT}}
127 \func{}{wxRichTextAttr
}{\param{const wxTextAttrEx\&
}{attr
}}
131 \membersection{wxRichTextAttr::CopyTo
}\label{wxrichtextattrcopyto
}
133 \constfunc{void
}{CopyTo
}{\param{wxTextAttrEx\&
}{attr
}}
135 Copies the wxRichTextAttr attributes to a
\helpref{wxTextAttrEx
}{wxtextattrex
} object.
137 \membersection{wxRichTextAttr::CreateFont
}\label{wxrichtextattrcreatefont
}
139 \constfunc{wxFont
}{CreateFont
}{\void}
141 Creates a font from the font attributes.
143 \membersection{wxRichTextAttr::GetAlignment
}\label{wxrichtextattrgetalignment
}
145 \constfunc{wxTextAttrAlignment
}{GetAlignment
}{\void}
147 Returns the alignment flags.
148 See
\helpref{wxRichTextAttr::SetAlignment
}{wxrichtextattrsetalignment
} for a list of available styles.
150 \membersection{wxRichTextAttr::GetBackgroundColour
}\label{wxrichtextattrgetbackgroundcolour
}
152 \constfunc{const wxColour\&
}{GetBackgroundColour
}{\void}
154 Returns the background colour.
156 \membersection{wxRichTextAttr::GetBulletFont
}\label{wxrichtextattrgetbulletfont
}
158 \constfunc{const wxString\&
}{GetBulletFont
}{\void}
160 Returns a string containing the name of the font associated with the bullet symbol.
161 Only valid for attributes with wxTEXT
\_ATTR\_BULLET\_SYMBOL.
163 \membersection{wxRichTextAttr::GetBulletName
}\label{wxrichtextattrgetbulletname
}
165 \constfunc{const wxString\&
}{GetBulletName
}{\void}
167 Returns the standard bullet name, applicable if the bullet style is wxTEXT
\_ATTR\_BULLET\_STYLE\_STANDARD.
168 Currently the following standard bullet names are supported:
170 \begin{itemize
}\itemsep=
0pt
171 \item {\tt standard/circle
}
172 \item {\tt standard/square
}
173 \item {\tt standard/diamond
}
174 \item {\tt standard/triangle
}
177 If you wish your application to support further bullet graphics, you can derive a
178 class from wxRichTextRenderer or wxRichTextStdRenderer, override
{\tt DrawStandardBullet
} and
{\tt EnumerateStandardBulletNames
}, and
179 set an instance of the class using
\helpref{wxRichTextBuffer::SetRenderer
}{wxrichtextbuffersetrenderer
}.
181 \membersection{wxRichTextAttr::GetBulletNumber
}\label{wxrichtextattrgetbulletnumber
}
183 \constfunc{int
}{GetBulletNumber
}{\void}
185 Returns the bullet number.
187 \membersection{wxRichTextAttr::GetBulletStyle
}\label{wxrichtextattrgetbulletstyle
}
189 \constfunc{int
}{GetBulletStyle
}{\void}
191 Returns the bullet style.
192 See
\helpref{wxRichTextAttr::SetBulletStyle
}{wxrichtextattrsetbulletstyle
} for a list of available styles.
194 \membersection{wxRichTextAttr::GetBulletText
}\label{wxrichtextattrgetbullettext
}
196 \constfunc{const wxString\&
}{GetBulletText
}{\void}
198 Returns the bullet text, which could be a symbol, or (for example) cached outline text.
200 \membersection{wxRichTextAttr::GetCharacterStyleName
}\label{wxrichtextattrgetcharacterstylename
}
202 \constfunc{const wxString\&
}{GetCharacterStyleName
}{\void}
204 Returns the name of the character style.
206 \membersection{wxRichTextAttr::GetFlags
}\label{wxrichtextattrgetflags
}
208 \constfunc{long
}{GetFlags
}{\void}
210 Returns flags indicating which attributes are applicable.
211 See
\helpref{wxRichTextAttr::SetFlags
}{wxrichtextattrsetflags
} for a list of available flags.
213 \membersection{wxRichTextAttr::GetFontAttributes
}\label{wxrichtextattrgetfontattributes
}
215 \func{bool
}{GetFontAttributes
}{\param{const wxFont\&
}{font
}}
217 Sets the font attributes from the given font.
219 \membersection{wxRichTextAttr::GetFontFaceName
}\label{wxrichtextattrgetfontfacename
}
221 \constfunc{const wxString\&
}{GetFontFaceName
}{\void}
223 Returns the font face name.
225 \membersection{wxRichTextAttr::GetFontSize
}\label{wxrichtextattrgetfontsize
}
227 \constfunc{int
}{GetFontSize
}{\void}
229 Returns the font size in points.
231 \membersection{wxRichTextAttr::GetFontStyle
}\label{wxrichtextattrgetfontstyle
}
233 \constfunc{int
}{GetFontStyle
}{\void}
235 Returns the font style.
237 \membersection{wxRichTextAttr::GetFontUnderlined
}\label{wxrichtextattrgetfontunderlined
}
239 \constfunc{bool
}{GetFontUnderlined
}{\void}
241 Returns
\true if the font is underlined.
243 \membersection{wxRichTextAttr::GetFontWeight
}\label{wxrichtextattrgetfontweight
}
245 \constfunc{int
}{GetFontWeight
}{\void}
247 Returns the font weight.
249 \membersection{wxRichTextAttr::GetLeftIndent
}\label{wxrichtextattrgetleftindent
}
251 \constfunc{long
}{GetLeftIndent
}{\void}
253 Returns the left indent in tenths of a millimetre.
255 \membersection{wxRichTextAttr::GetLeftSubIndent
}\label{wxrichtextattrgetleftsubindent
}
257 \constfunc{long
}{GetLeftSubIndent
}{\void}
259 Returns the left sub-indent in tenths of a millimetre.
261 \membersection{wxRichTextAttr::GetLineSpacing
}\label{wxrichtextattrgetlinespacing
}
263 \constfunc{int
}{GetLineSpacing
}{\void}
265 Returns the line spacing value, one of wxTEXT
\_ATTR\_LINE\_SPACING\_NORMAL,
266 wxTEXT
\_ATTR\_LINE\_SPACING\_HALF, and wxTEXT
\_ATTR\_LINE\_SPACING\_TWICE.
268 \membersection{wxRichTextAttr::GetListStyleName
}\label{wxrichtextattrgetliststylename
}
270 \constfunc{const wxString\&
}{GetListStyleName
}{\void}
272 Returns the name of the list style.
274 \membersection{wxRichTextAttr::GetParagraphSpacingAfter
}\label{wxrichtextattrgetparagraphspacingafter
}
276 \constfunc{int
}{GetParagraphSpacingAfter
}{\void}
278 Returns the space in tenths of a millimeter after the paragraph.
280 \membersection{wxRichTextAttr::GetParagraphSpacingBefore
}\label{wxrichtextattrgetparagraphspacingbefore
}
282 \constfunc{int
}{GetParagraphSpacingBefore
}{\void}
284 Returns the space in tenths of a millimeter before the paragraph.
286 \membersection{wxRichTextAttr::GetParagraphStyleName
}\label{wxrichtextattrgetparagraphstylename
}
288 \constfunc{const wxString\&
}{GetParagraphStyleName
}{\void}
290 Returns the name of the paragraph style.
292 \membersection{wxRichTextAttr::GetRightIndent
}\label{wxrichtextattrgetrightindent
}
294 \constfunc{long
}{GetRightIndent
}{\void}
296 Returns the right indent in tenths of a millimeter.
298 \membersection{wxRichTextAttr::GetTabs
}\label{wxrichtextattrgettabs
}
300 \constfunc{const wxArrayInt\&
}{GetTabs
}{\void}
302 Returns an array of tab stops, each expressed in tenths of a millimeter. Each stop
303 is measured from the left margin and therefore each value must be larger than the last.
305 \membersection{wxRichTextAttr::GetTextColour
}\label{wxrichtextattrgettextcolour
}
307 \constfunc{const wxColour\&
}{GetTextColour
}{\void}
309 Returns the text foreground colour.
311 \membersection{wxRichTextAttr::GetURL
}\label{wxrichtextattrgeturl
}
313 \constfunc{const wxString\&
}{GetURL
}{\void}
315 Returns the URL for the content. Content with wxTEXT
\_ATTR\_URL style
316 causes wxRichTextCtrl to show a hand cursor over it, and wxRichTextCtrl generates
317 a wxTextUrlEvent when the content is clicked.
319 \membersection{wxRichTextAttr::HasAlignment
}\label{wxrichtextattrhasalignment
}
321 \constfunc{bool
}{HasAlignment
}{\void}
323 Returns
\true if the attribute object specifies alignment.
325 \membersection{wxRichTextAttr::HasBackgroundColour
}\label{wxrichtextattrhasbackgroundcolour
}
327 \constfunc{bool
}{HasBackgroundColour
}{\void}
329 Returns
\true if the attribute object specifies a background colour.
331 \membersection{wxRichTextAttr::HasBulletName
}\label{wxrichtextattrhasbulletname
}
333 \constfunc{bool
}{HasBulletName
}{\void}
335 Returns
\true if the attribute object specifies a standard bullet name.
337 \membersection{wxRichTextAttr::HasBulletNumber
}\label{wxrichtextattrhasbulletnumber
}
339 \constfunc{bool
}{HasBulletNumber
}{\void}
341 Returns
\true if the attribute object specifies a bullet number.
343 \membersection{wxRichTextAttr::HasBulletStyle
}\label{wxrichtextattrhasbulletstyle
}
345 \constfunc{bool
}{HasBulletStyle
}{\void}
347 Returns
\true if the attribute object specifies a bullet style.
349 \membersection{wxRichTextAttr::HasBulletText
}\label{wxrichtextattrhasbullettext
}
351 \constfunc{bool
}{HasBulletText
}{\void}
353 Returns
\true if the attribute object specifies bullet text (usually specifying a symbol).
355 \membersection{wxRichTextAttr::HasCharacterStyleName
}\label{wxrichtextattrhascharacterstylename
}
357 \constfunc{bool
}{HasCharacterStyleName
}{\void}
359 Returns
\true if the attribute object specifies a character style name.
361 \membersection{wxRichTextAttr::HasFaceName
}\label{wxrichtextattrhasfacename
}
363 \constfunc{bool
}{HasFaceName
}{\void}
365 Returns
\true if the attribute object specifies a font face name.
367 \membersection{wxRichTextAttr::HasFlag
}\label{wxrichtextattrhasflag
}
369 \constfunc{bool
}{HasFlag
}{\param{long
}{flag
}}
371 Returns
\true if the
{\it flag
} is present in the attribute object's flag bitlist.
373 \membersection{wxRichTextAttr::HasFont
}\label{wxrichtextattrhasfont
}
375 \constfunc{bool
}{HasFont
}{\void}
377 Returns
\true if the attribute object specifies any font attributes.
379 \membersection{wxRichTextAttr::HasItalic
}\label{wxrichtextattrhasitalic
}
381 \constfunc{bool
}{HasItalic
}{\void}
383 Returns
\true if the attribute object specifies italic style.
385 \membersection{wxRichTextAttr::HasLeftIndent
}\label{wxrichtextattrhasleftindent
}
387 \constfunc{bool
}{HasLeftIndent
}{\void}
389 Returns
\true if the attribute object specifies a left indent.
391 \membersection{wxRichTextAttr::HasLineSpacing
}\label{wxrichtextattrhaslinespacing
}
393 \constfunc{bool
}{HasLineSpacing
}{\void}
395 Returns
\true if the attribute object specifies line spacing.
397 \membersection{wxRichTextAttr::HasListStyleName
}\label{wxrichtextattrhasliststylename
}
399 \constfunc{bool
}{HasListStyleName
}{\void}
401 Returns
\true if the attribute object specifies a list style name.
403 \membersection{wxRichTextAttr::HasPageBreak
}\label{wxrichtextattrhaspagebreak
}
405 \constfunc{bool
}{HasPageBreak
}{\void}
407 Returns
\true if the attribute object specifies a page break before this paragraph.
409 \membersection{wxRichTextAttr::HasParagraphSpacingAfter
}\label{wxrichtextattrhasparagraphspacingafter
}
411 \constfunc{bool
}{HasParagraphSpacingAfter
}{\void}
413 Returns
\true if the attribute object specifies spacing after a paragraph.
415 \membersection{wxRichTextAttr::HasParagraphSpacingBefore
}\label{wxrichtextattrhasparagraphspacingbefore
}
417 \constfunc{bool
}{HasParagraphSpacingBefore
}{\void}
419 Returns
\true if the attribute object specifies spacing before a paragraph.
421 \membersection{wxRichTextAttr::HasParagraphStyleName
}\label{wxrichtextattrhasparagraphstylename
}
423 \constfunc{bool
}{HasParagraphStyleName
}{\void}
425 Returns
\true if the attribute object specifies a paragraph style name.
427 \membersection{wxRichTextAttr::HasRightIndent
}\label{wxrichtextattrhasrightindent
}
429 \constfunc{bool
}{HasRightIndent
}{\void}
431 Returns
\true if the attribute object specifies a right indent.
433 \membersection{wxRichTextAttr::HasSize
}\label{wxrichtextattrhassize
}
435 \constfunc{bool
}{HasSize
}{\void}
437 Returns
\true if the attribute object specifies a font point size.
439 \membersection{wxRichTextAttr::HasTabs
}\label{wxrichtextattrhastabs
}
441 \constfunc{bool
}{HasTabs
}{\void}
443 Returns
\true if the attribute object specifies tab stops.
445 \membersection{wxRichTextAttr::HasTextColour
}\label{wxrichtextattrhastextcolour
}
447 \constfunc{bool
}{HasTextColour
}{\void}
449 Returns
\true if the attribute object specifies a text foreground colour.
451 \membersection{wxRichTextAttr::HasUnderlined
}\label{wxrichtextattrhasunderlined
}
453 \constfunc{bool
}{HasUnderlined
}{\void}
455 Returns
\true if the attribute object specifies either underlining or no underlining.
457 \membersection{wxRichTextAttr::HasWeight
}\label{wxrichtextattrhasweight
}
459 \constfunc{bool
}{HasWeight
}{\void}
461 Returns
\true if the attribute object specifies font weight (bold, light or normal).
463 \membersection{wxRichTextAttr::Init
}\label{wxrichtextattrinit
}
465 \func{void
}{Init
}{\void}
467 Initialise the object.
469 \membersection{wxRichTextAttr::IsCharacterStyle
}\label{wxrichtextattrischaracterstyle
}
471 \constfunc{bool
}{IsCharacterStyle
}{\void}
473 Returns
\true if the object represents a character style, that is,
474 the flags specify a font or a text background or foreground colour.
476 \membersection{wxRichTextAttr::IsDefault
}\label{wxrichtextattrisdefault
}
478 \constfunc{bool
}{IsDefault
}{\void}
480 Returns
\false if we have any attributes set,
\true otherwise.
482 \membersection{wxRichTextAttr::IsParagraphStyle
}\label{wxrichtextattrisparagraphstyle
}
484 \constfunc{bool
}{IsParagraphStyle
}{\void}
486 Returns
\true if the object represents a paragraph style, that is,
487 the flags specify alignment, indentation, tabs, paragraph spacing, or
490 \membersection{wxRichTextAttr::SetAlignment
}\label{wxrichtextattrsetalignment
}
492 \func{void
}{SetAlignment
}{\param{wxTextAttrAlignment
}{alignment
}}
494 Sets the paragraph alignment. These are the possible values for
{\it alignment
}:
498 enum wxTextAttrAlignment
500 wxTEXT_ALIGNMENT_DEFAULT,
501 wxTEXT_ALIGNMENT_LEFT,
502 wxTEXT_ALIGNMENT_CENTRE,
503 wxTEXT_ALIGNMENT_CENTER = wxTEXT_ALIGNMENT_CENTRE,
504 wxTEXT_ALIGNMENT_RIGHT,
505 wxTEXT_ALIGNMENT_JUSTIFIED
510 \membersection{wxRichTextAttr::SetBackgroundColour
}\label{wxrichtextattrsetbackgroundcolour
}
512 \func{void
}{SetBackgroundColour
}{\param{const wxColour\&
}{colBack
}}
514 Sets the background colour.
516 \membersection{wxRichTextAttr::SetBulletFont
}\label{wxrichtextattrsetbulletfont
}
518 \func{void
}{SetBulletFont
}{\param{const wxString\&
}{font
}}
520 Sets the name of the font associated with the bullet symbol.
521 Only valid for attributes with wxTEXT
\_ATTR\_BULLET\_SYMBOL.
523 \membersection{wxRichTextAttr::SetBulletName
}\label{wxrichtextattrsetbulletname
}
525 \func{void
}{SetBulletName
}{\param{const wxString\&
}{name
}}
527 Sets the standard bullet name, applicable if the bullet style is wxTEXT
\_ATTR\_BULLET\_STYLE\_STANDARD.
528 See
\helpref{wxRichTextAttr::GetBulletName
}{wxrichtextattrgetbulletname
} for a list
529 of supported names, and how to expand the range of supported types.
531 \membersection{wxRichTextAttr::SetBulletNumber
}\label{wxrichtextattrsetbulletnumber
}
533 \func{void
}{SetBulletNumber
}{\param{int
}{n
}}
535 Sets the bullet number.
537 \membersection{wxRichTextAttr::SetBulletStyle
}\label{wxrichtextattrsetbulletstyle
}
539 \func{void
}{SetBulletStyle
}{\param{int
}{style
}}
541 Sets the bullet style. The following styles can be passed:
545 #define wxTEXT_ATTR_BULLET_STYLE_NONE
0x00000000
546 #define wxTEXT_ATTR_BULLET_STYLE_ARABIC
0x00000001
547 #define wxTEXT_ATTR_BULLET_STYLE_LETTERS_UPPER
0x00000002
548 #define wxTEXT_ATTR_BULLET_STYLE_LETTERS_LOWER
0x00000004
549 #define wxTEXT_ATTR_BULLET_STYLE_ROMAN_UPPER
0x00000008
550 #define wxTEXT_ATTR_BULLET_STYLE_ROMAN_LOWER
0x00000010
551 #define wxTEXT_ATTR_BULLET_STYLE_SYMBOL
0x00000020
552 #define wxTEXT_ATTR_BULLET_STYLE_BITMAP
0x00000040
553 #define wxTEXT_ATTR_BULLET_STYLE_PARENTHESES
0x00000080
554 #define wxTEXT_ATTR_BULLET_STYLE_PERIOD
0x00000100
555 #define wxTEXT_ATTR_BULLET_STYLE_STANDARD
0x00000200
556 #define wxTEXT_ATTR_BULLET_STYLE_RIGHT_PARENTHESIS
0x00000400
557 #define wxTEXT_ATTR_BULLET_STYLE_OUTLINE
0x00000800
558 #define wxTEXT_ATTR_BULLET_STYLE_ALIGN_LEFT
0x00000000
559 #define wxTEXT_ATTR_BULLET_STYLE_ALIGN_RIGHT
0x00001000
560 #define wxTEXT_ATTR_BULLET_STYLE_ALIGN_CENTRE
0x00002000
564 \membersection{wxRichTextAttr::SetBulletText
}\label{wxrichtextattrsetbullettext
}
566 \func{void
}{SetBulletText
}{\param{const wxString&
}{text
}}
568 Sets the bullet text, which could be a symbol, or (for example) cached outline text.
570 \membersection{wxRichTextAttr::SetCharacterStyleName
}\label{wxrichtextattrsetcharacterstylename
}
572 \func{void
}{SetCharacterStyleName
}{\param{const wxString\&
}{name
}}
574 Sets the character style name.
576 \membersection{wxRichTextAttr::SetFlags
}\label{wxrichtextattrsetflags
}
578 \func{void
}{SetFlags
}{\param{long
}{flags
}}
580 Sets the flags determining which styles are being specified. The following
581 flags can be passed in a bitlist:
585 // Standard wxTextAttr constants
587 #define wxTEXT_ATTR_TEXT_COLOUR
0x0001
588 #define wxTEXT_ATTR_BACKGROUND_COLOUR
0x0002
589 #define wxTEXT_ATTR_FONT_FACE
0x0004
590 #define wxTEXT_ATTR_FONT_SIZE
0x0008
591 #define wxTEXT_ATTR_FONT_WEIGHT
0x0010
592 #define wxTEXT_ATTR_FONT_ITALIC
0x0020
593 #define wxTEXT_ATTR_FONT_UNDERLINE
0x0040
594 #define wxTEXT_ATTR_FONT \
595 wxTEXT_ATTR_FONT_FACE | wxTEXT_ATTR_FONT_SIZE | wxTEXT_ATTR_FONT_WEIGHT \
596 | wxTEXT_ATTR_FONT_ITALIC | wxTEXT_ATTR_FONT_UNDERLINE
597 #define wxTEXT_ATTR_ALIGNMENT
0x0080
598 #define wxTEXT_ATTR_LEFT_INDENT
0x0100
599 #define wxTEXT_ATTR_RIGHT_INDENT
0x0200
600 #define wxTEXT_ATTR_TABS
0x0400
602 // Extra formatting flags not in wxTextAttr
604 #define wxTEXT_ATTR_PARA_SPACING_AFTER
0x00000800
605 #define wxTEXT_ATTR_PARA_SPACING_BEFORE
0x00001000
606 #define wxTEXT_ATTR_LINE_SPACING
0x00002000
607 #define wxTEXT_ATTR_CHARACTER_STYLE_NAME
0x00004000
608 #define wxTEXT_ATTR_PARAGRAPH_STYLE_NAME
0x00008000
609 #define wxTEXT_ATTR_LIST_STYLE_NAME
0x00010000
610 #define wxTEXT_ATTR_BULLET_STYLE
0x00020000
611 #define wxTEXT_ATTR_BULLET_NUMBER
0x00040000
612 #define wxTEXT_ATTR_BULLET_TEXT
0x00080000
613 #define wxTEXT_ATTR_BULLET_NAME
0x00100000
614 #define wxTEXT_ATTR_URL
0x00200000
618 \membersection{wxRichTextAttr::SetFontFaceName
}\label{wxrichtextattrsetfontfacename
}
620 \func{void
}{SetFontFaceName
}{\param{const wxString\&
}{faceName
}}
622 Sets the paragraph alignment.
624 \membersection{wxRichTextAttr::SetFontSize
}\label{wxrichtextattrsetfontsize
}
626 \func{void
}{SetFontSize
}{\param{int
}{pointSize
}}
628 Sets the font size in points.
630 \membersection{wxRichTextAttr::SetFontStyle
}\label{wxrichtextattrsetfontstyle
}
632 \func{void
}{SetFontStyle
}{\param{int
}{fontStyle
}}
634 Sets the font style (normal, italic or slanted).
636 \membersection{wxRichTextAttr::SetFontUnderlined
}\label{wxrichtextattrsetfontunderlined
}
638 \func{void
}{SetFontUnderlined
}{\param{bool
}{underlined
}}
640 Sets the font underlining.
642 \membersection{wxRichTextAttr::SetFontWeight
}\label{wxrichtextattrsetfontweight
}
644 \func{void
}{SetFontWeight
}{\param{int
}{fontWeight
}}
646 Sets the font weight.
648 \membersection{wxRichTextAttr::SetLeftIndent
}\label{wxrichtextattrsetleftindent
}
650 \func{void
}{SetLeftIndent
}{\param{int
}{indent
},
\param{int
}{subIndent =
0}}
652 Sets the left indent and left subindent in tenths of a millimetre.
654 The sub-indent is an offset from the left of the paragraph, and is used for all but the
655 first line in a paragraph. A positive value will cause the first line to appear to the left
656 of the subsequent lines, and a negative value will cause the first line to be indented
657 relative to the subsequent lines.
659 wxRichTextBuffer uses indentation to render a bulleted item. The left indent is the distance between
660 the margin and the bullet. The content of the paragraph, including the first line, starts
661 at leftMargin + leftSubIndent. So the distance between the left edge of the bullet and the
662 left of the actual paragraph is leftSubIndent.
664 \membersection{wxRichTextAttr::SetLineSpacing
}\label{wxrichtextattrsetlinespacing
}
666 \func{void
}{SetLineSpacing
}{\param{int
}{spacing
}}
668 Sets the line spacing.
{\it spacing
} is a multiple, where
10 means single-spacing,
669 15 means
1.5 spacing, and
20 means double spacing. The following constants are
670 defined for convenience:
674 #define wxTEXT_ATTR_LINE_SPACING_NORMAL
10
675 #define wxTEXT_ATTR_LINE_SPACING_HALF
15
676 #define wxTEXT_ATTR_LINE_SPACING_TWICE
20
680 \membersection{wxRichTextAttr::SetListStyleName
}\label{wxrichtextattrsetliststylename
}
682 \func{void
}{SetListStyleName
}{\param{const wxString\&
}{name
}}
684 Sets the list style name.
686 \membersection{wxRichTextAttr::SetPageBreak
}\label{wxrichtextattrsetpagebreak
}
688 \func{void
}{SetPageBreak
}{\param{bool
}{ pageBreak = true
}}
690 Specifies a page break before this paragraph.
692 \membersection{wxRichTextAttr::SetParagraphSpacingAfter
}\label{wxrichtextattrsetparagraphspacingafter
}
694 \func{void
}{SetParagraphSpacingAfter
}{\param{int
}{spacing
}}
696 Sets the spacing after a paragraph, in tenths of a millimetre.
698 \membersection{wxRichTextAttr::SetParagraphSpacingBefore
}\label{wxrichtextattrsetparagraphspacingbefore
}
700 \func{void
}{SetParagraphSpacingBefore
}{\param{int
}{spacing
}}
702 Sets the spacing before a paragraph, in tenths of a millimetre.
704 \membersection{wxRichTextAttr::SetParagraphStyleName
}\label{wxrichtextattrsetparagraphstylename
}
706 \func{void
}{SetParagraphStyleName
}{\param{const wxString\&
}{name
}}
708 Sets the name of the paragraph style.
710 \membersection{wxRichTextAttr::SetRightIndent
}\label{wxrichtextattrsetrightindent
}
712 \func{void
}{SetRightIndent
}{\param{int
}{indent
}}
714 Sets the right indent in tenths of a millimetre.
716 \membersection{wxRichTextAttr::SetTabs
}\label{wxrichtextattrsettabs
}
718 \func{void
}{SetTabs
}{\param{const wxArrayInt\&
}{tabs
}}
720 Sets the tab stops, expressed in tenths of a millimetre.
721 Each stop is measured from the left margin and therefore each value must be larger than the last.
723 \membersection{wxRichTextAttr::SetTextColour
}\label{wxrichtextattrsettextcolour
}
725 \func{void
}{SetTextColour
}{\param{const wxColour\&
}{colText
}}
727 Sets the text foreground colout.
729 \membersection{wxRichTextAttr::SetURL
}\label{wxrichtextattrseturl
}
731 \func{void
}{SetURL
}{\param{const wxString\&
}{url
}}
733 Sets the URL for the content. Sets the wxTEXT
\_ATTR\_URL style; content with this style
734 causes wxRichTextCtrl to show a hand cursor over it, and wxRichTextCtrl generates
735 a wxTextUrlEvent when the content is clicked.
737 \membersection{wxRichTextAttr::operator=
}\label{wxrichtextattroperatorassign
}
739 \func{void operator
}{operator=
}{\param{const wxTextAttrEx\&
}{attr
}}
741 Assignment from a
\helpref{wxTextAttrEx
}{wxtextattr
} object.
743 \func{void operator
}{operator=
}{\param{const wxRichTextAttr\&
}{attr
}}
745 Assignment from a
\helpref{wxRichTextAttr
}{wxrichtextattr
} object.
747 \membersection{wxRichTextAttr::wxTextAttrEx
}\label{wxrichtextattrwxtextattrex
}
749 \constfunc{operator
}{wxTextAttrEx
}{\void}
751 Makes a
\helpref{wxTextAttrEx
}{wxtextattrex
} object from this object.