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
81 The following styles can be passed to wxRichTextAttr::SetBulletStyle:
85 #define wxTEXT_ATTR_BULLET_STYLE_NONE
0x00000000
86 #define wxTEXT_ATTR_BULLET_STYLE_ARABIC
0x00000001
87 #define wxTEXT_ATTR_BULLET_STYLE_LETTERS_UPPER
0x00000002
88 #define wxTEXT_ATTR_BULLET_STYLE_LETTERS_LOWER
0x00000004
89 #define wxTEXT_ATTR_BULLET_STYLE_ROMAN_UPPER
0x00000008
90 #define wxTEXT_ATTR_BULLET_STYLE_ROMAN_LOWER
0x00000010
91 #define wxTEXT_ATTR_BULLET_STYLE_SYMBOL
0x00000020
92 #define wxTEXT_ATTR_BULLET_STYLE_BITMAP
0x00000040
93 #define wxTEXT_ATTR_BULLET_STYLE_PARENTHESES
0x00000080
94 #define wxTEXT_ATTR_BULLET_STYLE_PERIOD
0x00000100
95 #define wxTEXT_ATTR_BULLET_STYLE_STANDARD
0x00000200
96 #define wxTEXT_ATTR_BULLET_STYLE_RIGHT_PARENTHESIS
0x00000400
97 #define wxTEXT_ATTR_BULLET_STYLE_OUTLINE
0x00000800
98 #define wxTEXT_ATTR_BULLET_STYLE_ALIGN_LEFT
0x00000000
99 #define wxTEXT_ATTR_BULLET_STYLE_ALIGN_RIGHT
0x00001000
100 #define wxTEXT_ATTR_BULLET_STYLE_ALIGN_CENTRE
0x00002000
104 The following constants can be passed to wxRichTextAttr::SetLineSpacing:
108 #define wxTEXT_ATTR_LINE_SPACING_NORMAL
10
109 #define wxTEXT_ATTR_LINE_SPACING_HALF
15
110 #define wxTEXT_ATTR_LINE_SPACING_TWICE
20
116 \helpref{wxTextAttr
}{wxtextattr
},
\helpref{wxTextAttrEx
}{wxtextattrex
},
\helpref{wxRichTextCtrl
}{wxrichtextctrl
}
118 \latexignore{\rtfignore{\wxheading{Members
}}}
120 \membersection{wxRichTextAttr::wxRichTextAttr
}\label{wxrichtextattrwxrichtextattr
}
122 \func{}{wxRichTextAttr
}{\void}
124 \func{}{wxRichTextAttr
}{\param{const wxColour\&
}{colText
},
\param{const wxColour\&
}{colBack = wxNullColour
},
\param{wxTextAttrAlignment
}{alignment = wxTEXT
\_ALIGNMENT\_DEFAULT}}
126 \func{}{wxRichTextAttr
}{\param{const wxTextAttrEx\&
}{attr
}}
130 \membersection{wxRichTextAttr::CopyTo
}\label{wxrichtextattrcopyto
}
132 \constfunc{void
}{CopyTo
}{\param{wxTextAttrEx\&
}{attr
}}
134 Copies the wxRichTextAttr attributes to a
\helpref{wxTextAttrEx
}{wxtextattrex
} object.
136 \membersection{wxRichTextAttr::CreateFont
}\label{wxrichtextattrcreatefont
}
138 \constfunc{wxFont
}{CreateFont
}{\void}
140 Creates a font from the font attributes.
142 \membersection{wxRichTextAttr::GetAlignment
}\label{wxrichtextattrgetalignment
}
144 \constfunc{wxTextAttrAlignment
}{GetAlignment
}{\void}
146 Returns the alignment flags.
147 See
\helpref{wxRichTextAttr::SetAlignment
}{wxrichtextattrsetalignment
} for a list of available styles.
149 \membersection{wxRichTextAttr::GetBackgroundColour
}\label{wxrichtextattrgetbackgroundcolour
}
151 \constfunc{const wxColour\&
}{GetBackgroundColour
}{\void}
153 Returns the background colour.
155 \membersection{wxRichTextAttr::GetBulletFont
}\label{wxrichtextattrgetbulletfont
}
157 \constfunc{const wxString\&
}{GetBulletFont
}{\void}
159 Returns a string containing the name of the font associated with the bullet symbol.
160 Only valid for attributes with wxTEXT
\_ATTR\_BULLET\_SYMBOL.
162 \membersection{wxRichTextAttr::GetBulletName
}\label{wxrichtextattrgetbulletname
}
164 \constfunc{const wxString\&
}{GetBulletName
}{\void}
166 Returns the standard bullet name, applicable if the bullet style is wxTEXT
\_ATTR\_BULLET\_STYLE\_STANDARD.
167 Currently the following standard bullet names are supported:
169 \begin{itemize
}\itemsep=
0pt
170 \item {\tt standard/circle
}
171 \item {\tt standard/square
}
172 \item {\tt standard/diamond
}
173 \item {\tt standard/triangle
}
176 If you wish your application to support further bullet graphics, you can derive a
177 class from wxRichTextRenderer or wxRichTextStdRenderer, override
{\tt DrawStandardBullet
} and
{\tt EnumerateStandardBulletNames
}, and
178 set an instance of the class using
\helpref{wxRichTextBuffer::SetRenderer
}{wxrichtextbuffersetrenderer
}.
180 \membersection{wxRichTextAttr::GetBulletNumber
}\label{wxrichtextattrgetbulletnumber
}
182 \constfunc{int
}{GetBulletNumber
}{\void}
184 Returns the bullet number.
186 \membersection{wxRichTextAttr::GetBulletStyle
}\label{wxrichtextattrgetbulletstyle
}
188 \constfunc{int
}{GetBulletStyle
}{\void}
190 Returns the bullet style.
191 See
\helpref{wxRichTextAttr::SetBulletStyle
}{wxrichtextattrsetbulletstyle
} for a list of available styles.
193 \membersection{wxRichTextAttr::GetBulletText
}\label{wxrichtextattrgetbullettext
}
195 \constfunc{const wxString\&
}{GetBulletText
}{\void}
197 Returns the bullet text, which could be a symbol, or (for example) cached outline text.
199 \membersection{wxRichTextAttr::GetCharacterStyleName
}\label{wxrichtextattrgetcharacterstylename
}
201 \constfunc{const wxString\&
}{GetCharacterStyleName
}{\void}
203 Returns the name of the character style.
205 \membersection{wxRichTextAttr::GetFlags
}\label{wxrichtextattrgetflags
}
207 \constfunc{long
}{GetFlags
}{\void}
209 Returns flags indicating which attributes are applicable.
210 See
\helpref{wxRichTextAttr::SetFlags
}{wxrichtextattrsetflags
} for a list of available flags.
212 \membersection{wxRichTextAttr::GetFontAttributes
}\label{wxrichtextattrgetfontattributes
}
214 \func{bool
}{GetFontAttributes
}{\param{const wxFont\&
}{font
}}
216 Sets the font attributes from the given font.
218 \membersection{wxRichTextAttr::GetFontFaceName
}\label{wxrichtextattrgetfontfacename
}
220 \constfunc{const wxString\&
}{GetFontFaceName
}{\void}
222 Returns the font face name.
224 \membersection{wxRichTextAttr::GetFontSize
}\label{wxrichtextattrgetfontsize
}
226 \constfunc{int
}{GetFontSize
}{\void}
228 Returns the font size in points.
230 \membersection{wxRichTextAttr::GetFontStyle
}\label{wxrichtextattrgetfontstyle
}
232 \constfunc{int
}{GetFontStyle
}{\void}
234 Returns the font style.
236 \membersection{wxRichTextAttr::GetFontUnderlined
}\label{wxrichtextattrgetfontunderlined
}
238 \constfunc{bool
}{GetFontUnderlined
}{\void}
240 Returns
\true if the font is underlined.
242 \membersection{wxRichTextAttr::GetFontWeight
}\label{wxrichtextattrgetfontweight
}
244 \constfunc{int
}{GetFontWeight
}{\void}
246 Returns the font weight.
248 \membersection{wxRichTextAttr::GetLeftIndent
}\label{wxrichtextattrgetleftindent
}
250 \constfunc{long
}{GetLeftIndent
}{\void}
252 Returns the left indent in tenths of a millimetre.
254 \membersection{wxRichTextAttr::GetLeftSubIndent
}\label{wxrichtextattrgetleftsubindent
}
256 \constfunc{long
}{GetLeftSubIndent
}{\void}
258 Returns the left sub-indent in tenths of a millimetre.
260 \membersection{wxRichTextAttr::GetLineSpacing
}\label{wxrichtextattrgetlinespacing
}
262 \constfunc{int
}{GetLineSpacing
}{\void}
264 Returns the line spacing value, one of wxTEXT
\_ATTR\_LINE\_SPACING\_NORMAL,
265 wxTEXT
\_ATTR\_LINE\_SPACING\_HALF, and wxTEXT
\_ATTR\_LINE\_SPACING\_TWICE.
267 \membersection{wxRichTextAttr::GetListStyleName
}\label{wxrichtextattrgetliststylename
}
269 \constfunc{const wxString\&
}{GetListStyleName
}{\void}
271 Returns the name of the list style.
273 \membersection{wxRichTextAttr::GetParagraphSpacingAfter
}\label{wxrichtextattrgetparagraphspacingafter
}
275 \constfunc{int
}{GetParagraphSpacingAfter
}{\void}
277 Returns the space in tenths of a millimeter after the paragraph.
279 \membersection{wxRichTextAttr::GetParagraphSpacingBefore
}\label{wxrichtextattrgetparagraphspacingbefore
}
281 \constfunc{int
}{GetParagraphSpacingBefore
}{\void}
283 Returns the space in tenths of a millimeter before the paragraph.
285 \membersection{wxRichTextAttr::GetParagraphStyleName
}\label{wxrichtextattrgetparagraphstylename
}
287 \constfunc{const wxString\&
}{GetParagraphStyleName
}{\void}
289 Returns the name of the paragraph style.
291 \membersection{wxRichTextAttr::GetRightIndent
}\label{wxrichtextattrgetrightindent
}
293 \constfunc{long
}{GetRightIndent
}{\void}
295 Returns the right indent in tenths of a millimeter.
297 \membersection{wxRichTextAttr::GetTabs
}\label{wxrichtextattrgettabs
}
299 \constfunc{const wxArrayInt\&
}{GetTabs
}{\void}
301 Returns an array of tab stops, each expressed in tenths of a millimeter. Each stop
302 is measured from the left margin and therefore each value must be larger than the last.
304 \membersection{wxRichTextAttr::GetTextColour
}\label{wxrichtextattrgettextcolour
}
306 \constfunc{const wxColour\&
}{GetTextColour
}{\void}
308 Returns the text foreground colour.
310 \membersection{wxRichTextAttr::GetURL
}\label{wxrichtextattrgeturl
}
312 \constfunc{const wxString\&
}{GetURL
}{\void}
314 Returns the URL for the content. Content with wxTEXT
\_ATTR\_URL style
315 causes wxRichTextCtrl to show a hand cursor over it, and wxRichTextCtrl generates
316 a wxTextUrlEvent when the content is clicked.
318 \membersection{wxRichTextAttr::HasAlignment
}\label{wxrichtextattrhasalignment
}
320 \constfunc{bool
}{HasAlignment
}{\void}
322 Returns
\true if the attribute object specifies alignment.
324 \membersection{wxRichTextAttr::HasBackgroundColour
}\label{wxrichtextattrhasbackgroundcolour
}
326 \constfunc{bool
}{HasBackgroundColour
}{\void}
328 Returns
\true if the attribute object specifies a background colour.
330 \membersection{wxRichTextAttr::HasBulletName
}\label{wxrichtextattrhasbulletname
}
332 \constfunc{bool
}{HasBulletName
}{\void}
334 Returns
\true if the attribute object specifies a standard bullet name.
336 \membersection{wxRichTextAttr::HasBulletNumber
}\label{wxrichtextattrhasbulletnumber
}
338 \constfunc{bool
}{HasBulletNumber
}{\void}
340 Returns
\true if the attribute object specifies a bullet number.
342 \membersection{wxRichTextAttr::HasBulletStyle
}\label{wxrichtextattrhasbulletstyle
}
344 \constfunc{bool
}{HasBulletStyle
}{\void}
346 Returns
\true if the attribute object specifies a bullet style.
348 \membersection{wxRichTextAttr::HasBulletText
}\label{wxrichtextattrhasbullettext
}
350 \constfunc{bool
}{HasBulletText
}{\void}
352 Returns
\true if the attribute object specifies bullet text (usually specifying a symbol).
354 \membersection{wxRichTextAttr::HasCharacterStyleName
}\label{wxrichtextattrhascharacterstylename
}
356 \constfunc{bool
}{HasCharacterStyleName
}{\void}
358 Returns
\true if the attribute object specifies a character style name.
360 \membersection{wxRichTextAttr::HasFaceName
}\label{wxrichtextattrhasfacename
}
362 \constfunc{bool
}{HasFaceName
}{\void}
364 Returns
\true if the attribute object specifies a font face name.
366 \membersection{wxRichTextAttr::HasFlag
}\label{wxrichtextattrhasflag
}
368 \constfunc{bool
}{HasFlag
}{\param{long
}{flag
}}
370 Returns
\true if the
{\it flag
} is present in the attribute object's flag bitlist.
372 \membersection{wxRichTextAttr::HasFont
}\label{wxrichtextattrhasfont
}
374 \constfunc{bool
}{HasFont
}{\void}
376 Returns
\true if the attribute object specifies any font attributes.
378 \membersection{wxRichTextAttr::HasItalic
}\label{wxrichtextattrhasitalic
}
380 \constfunc{bool
}{HasItalic
}{\void}
382 Returns
\true if the attribute object specifies italic style.
384 \membersection{wxRichTextAttr::HasLeftIndent
}\label{wxrichtextattrhasleftindent
}
386 \constfunc{bool
}{HasLeftIndent
}{\void}
388 Returns
\true if the attribute object specifies a left indent.
390 \membersection{wxRichTextAttr::HasLineSpacing
}\label{wxrichtextattrhaslinespacing
}
392 \constfunc{bool
}{HasLineSpacing
}{\void}
394 Returns
\true if the attribute object specifies line spacing.
396 \membersection{wxRichTextAttr::HasListStyleName
}\label{wxrichtextattrhasliststylename
}
398 \constfunc{bool
}{HasListStyleName
}{\void}
400 Returns
\true if the attribute object specifies a list style name.
402 \membersection{wxRichTextAttr::HasParagraphSpacingAfter
}\label{wxrichtextattrhasparagraphspacingafter
}
404 \constfunc{bool
}{HasParagraphSpacingAfter
}{\void}
406 Returns
\true if the attribute object specifies spacing after a paragraph.
408 \membersection{wxRichTextAttr::HasParagraphSpacingBefore
}\label{wxrichtextattrhasparagraphspacingbefore
}
410 \constfunc{bool
}{HasParagraphSpacingBefore
}{\void}
412 Returns
\true if the attribute object specifies spacing before a paragraph.
414 \membersection{wxRichTextAttr::HasParagraphStyleName
}\label{wxrichtextattrhasparagraphstylename
}
416 \constfunc{bool
}{HasParagraphStyleName
}{\void}
418 Returns
\true if the attribute object specifies a paragraph style name.
420 \membersection{wxRichTextAttr::HasRightIndent
}\label{wxrichtextattrhasrightindent
}
422 \constfunc{bool
}{HasRightIndent
}{\void}
424 Returns
\true if the attribute object specifies a right indent.
426 \membersection{wxRichTextAttr::HasSize
}\label{wxrichtextattrhassize
}
428 \constfunc{bool
}{HasSize
}{\void}
430 Returns
\true if the attribute object specifies a font point size.
432 \membersection{wxRichTextAttr::HasTabs
}\label{wxrichtextattrhastabs
}
434 \constfunc{bool
}{HasTabs
}{\void}
436 Returns
\true if the attribute object specifies tab stops.
438 \membersection{wxRichTextAttr::HasTextColour
}\label{wxrichtextattrhastextcolour
}
440 \constfunc{bool
}{HasTextColour
}{\void}
442 Returns
\true if the attribute object specifies a text foreground colour.
444 \membersection{wxRichTextAttr::HasUnderlined
}\label{wxrichtextattrhasunderlined
}
446 \constfunc{bool
}{HasUnderlined
}{\void}
448 Returns
\true if the attribute object specifies either underlining or no underlining.
450 \membersection{wxRichTextAttr::HasWeight
}\label{wxrichtextattrhasweight
}
452 \constfunc{bool
}{HasWeight
}{\void}
454 Returns
\true if the attribute object specifies font weight (bold, light or normal).
456 \membersection{wxRichTextAttr::Init
}\label{wxrichtextattrinit
}
458 \func{void
}{Init
}{\void}
460 Initialise the object.
462 \membersection{wxRichTextAttr::IsCharacterStyle
}\label{wxrichtextattrischaracterstyle
}
464 \constfunc{bool
}{IsCharacterStyle
}{\void}
466 Returns
\true if the object represents a character style, that is,
467 the flags specify a font or a text background or foreground colour.
469 \membersection{wxRichTextAttr::IsDefault
}\label{wxrichtextattrisdefault
}
471 \constfunc{bool
}{IsDefault
}{\void}
473 Returns
\false if we have any attributes set,
\true otherwise.
475 \membersection{wxRichTextAttr::IsParagraphStyle
}\label{wxrichtextattrisparagraphstyle
}
477 \constfunc{bool
}{IsParagraphStyle
}{\void}
479 Returns
\true if the object represents a paragraph style, that is,
480 the flags specify alignment, indentation, tabs, paragraph spacing, or
483 \membersection{wxRichTextAttr::SetAlignment
}\label{wxrichtextattrsetalignment
}
485 \func{void
}{SetAlignment
}{\param{wxTextAttrAlignment
}{alignment
}}
487 Sets the paragraph alignment. These are the possible values for
{\it alignment
}:
491 enum wxTextAttrAlignment
493 wxTEXT_ALIGNMENT_DEFAULT,
494 wxTEXT_ALIGNMENT_LEFT,
495 wxTEXT_ALIGNMENT_CENTRE,
496 wxTEXT_ALIGNMENT_CENTER = wxTEXT_ALIGNMENT_CENTRE,
497 wxTEXT_ALIGNMENT_RIGHT,
498 wxTEXT_ALIGNMENT_JUSTIFIED
503 \membersection{wxRichTextAttr::SetBackgroundColour
}\label{wxrichtextattrsetbackgroundcolour
}
505 \func{void
}{SetBackgroundColour
}{\param{const wxColour\&
}{colBack
}}
507 Sets the background colour.
509 \membersection{wxRichTextAttr::SetBulletFont
}\label{wxrichtextattrsetbulletfont
}
511 \func{void
}{SetBulletFont
}{\param{const wxString\&
}{font
}}
513 Sets the name of the font associated with the bullet symbol.
514 Only valid for attributes with wxTEXT
\_ATTR\_BULLET\_SYMBOL.
516 \membersection{wxRichTextAttr::SetBulletName
}\label{wxrichtextattrsetbulletname
}
518 \func{void
}{SetBulletName
}{\param{const wxString\&
}{name
}}
520 Sets the standard bullet name, applicable if the bullet style is wxTEXT
\_ATTR\_BULLET\_STYLE\_STANDARD.
521 See
\helpref{wxRichTextAttr::GetBulletName
}{wxrichtextattrgetbulletname
} for a list
522 of supported names, and how to expand the range of supported types.
524 \membersection{wxRichTextAttr::SetBulletNumber
}\label{wxrichtextattrsetbulletnumber
}
526 \func{void
}{SetBulletNumber
}{\param{int
}{n
}}
528 Sets the bullet number.
530 \membersection{wxRichTextAttr::SetBulletStyle
}\label{wxrichtextattrsetbulletstyle
}
532 \func{void
}{SetBulletStyle
}{\param{int
}{style
}}
534 Sets the bullet style. The following styles can be passed:
538 #define wxTEXT_ATTR_BULLET_STYLE_NONE
0x00000000
539 #define wxTEXT_ATTR_BULLET_STYLE_ARABIC
0x00000001
540 #define wxTEXT_ATTR_BULLET_STYLE_LETTERS_UPPER
0x00000002
541 #define wxTEXT_ATTR_BULLET_STYLE_LETTERS_LOWER
0x00000004
542 #define wxTEXT_ATTR_BULLET_STYLE_ROMAN_UPPER
0x00000008
543 #define wxTEXT_ATTR_BULLET_STYLE_ROMAN_LOWER
0x00000010
544 #define wxTEXT_ATTR_BULLET_STYLE_SYMBOL
0x00000020
545 #define wxTEXT_ATTR_BULLET_STYLE_BITMAP
0x00000040
546 #define wxTEXT_ATTR_BULLET_STYLE_PARENTHESES
0x00000080
547 #define wxTEXT_ATTR_BULLET_STYLE_PERIOD
0x00000100
548 #define wxTEXT_ATTR_BULLET_STYLE_STANDARD
0x00000200
549 #define wxTEXT_ATTR_BULLET_STYLE_RIGHT_PARENTHESIS
0x00000400
550 #define wxTEXT_ATTR_BULLET_STYLE_OUTLINE
0x00000800
551 #define wxTEXT_ATTR_BULLET_STYLE_ALIGN_LEFT
0x00000000
552 #define wxTEXT_ATTR_BULLET_STYLE_ALIGN_RIGHT
0x00001000
553 #define wxTEXT_ATTR_BULLET_STYLE_ALIGN_CENTRE
0x00002000
557 \membersection{wxRichTextAttr::SetBulletText
}\label{wxrichtextattrsetbullettext
}
559 \func{void
}{SetBulletText
}{\param{const wxString&
}{text
}}
561 Sets the bullet text, which could be a symbol, or (for example) cached outline text.
563 \membersection{wxRichTextAttr::SetCharacterStyleName
}\label{wxrichtextattrsetcharacterstylename
}
565 \func{void
}{SetCharacterStyleName
}{\param{const wxString\&
}{name
}}
567 Sets the character style name.
569 \membersection{wxRichTextAttr::SetFlags
}\label{wxrichtextattrsetflags
}
571 \func{void
}{SetFlags
}{\param{long
}{flags
}}
573 Sets the flags determining which styles are being specified. The following
574 flags can be passed in a bitlist:
578 // Standard wxTextAttr constants
580 #define wxTEXT_ATTR_TEXT_COLOUR
0x0001
581 #define wxTEXT_ATTR_BACKGROUND_COLOUR
0x0002
582 #define wxTEXT_ATTR_FONT_FACE
0x0004
583 #define wxTEXT_ATTR_FONT_SIZE
0x0008
584 #define wxTEXT_ATTR_FONT_WEIGHT
0x0010
585 #define wxTEXT_ATTR_FONT_ITALIC
0x0020
586 #define wxTEXT_ATTR_FONT_UNDERLINE
0x0040
587 #define wxTEXT_ATTR_FONT \
588 wxTEXT_ATTR_FONT_FACE | wxTEXT_ATTR_FONT_SIZE | wxTEXT_ATTR_FONT_WEIGHT \
589 | wxTEXT_ATTR_FONT_ITALIC | wxTEXT_ATTR_FONT_UNDERLINE
590 #define wxTEXT_ATTR_ALIGNMENT
0x0080
591 #define wxTEXT_ATTR_LEFT_INDENT
0x0100
592 #define wxTEXT_ATTR_RIGHT_INDENT
0x0200
593 #define wxTEXT_ATTR_TABS
0x0400
595 // Extra formatting flags not in wxTextAttr
597 #define wxTEXT_ATTR_PARA_SPACING_AFTER
0x00000800
598 #define wxTEXT_ATTR_PARA_SPACING_BEFORE
0x00001000
599 #define wxTEXT_ATTR_LINE_SPACING
0x00002000
600 #define wxTEXT_ATTR_CHARACTER_STYLE_NAME
0x00004000
601 #define wxTEXT_ATTR_PARAGRAPH_STYLE_NAME
0x00008000
602 #define wxTEXT_ATTR_LIST_STYLE_NAME
0x00010000
603 #define wxTEXT_ATTR_BULLET_STYLE
0x00020000
604 #define wxTEXT_ATTR_BULLET_NUMBER
0x00040000
605 #define wxTEXT_ATTR_BULLET_TEXT
0x00080000
606 #define wxTEXT_ATTR_BULLET_NAME
0x00100000
607 #define wxTEXT_ATTR_URL
0x00200000
611 \membersection{wxRichTextAttr::SetFontFaceName
}\label{wxrichtextattrsetfontfacename
}
613 \func{void
}{SetFontFaceName
}{\param{const wxString\&
}{faceName
}}
615 Sets the paragraph alignment.
617 \membersection{wxRichTextAttr::SetFontSize
}\label{wxrichtextattrsetfontsize
}
619 \func{void
}{SetFontSize
}{\param{int
}{pointSize
}}
621 Sets the font size in points.
623 \membersection{wxRichTextAttr::SetFontStyle
}\label{wxrichtextattrsetfontstyle
}
625 \func{void
}{SetFontStyle
}{\param{int
}{fontStyle
}}
627 Sets the font style (normal, italic or slanted).
629 \membersection{wxRichTextAttr::SetFontUnderlined
}\label{wxrichtextattrsetfontunderlined
}
631 \func{void
}{SetFontUnderlined
}{\param{bool
}{underlined
}}
633 Sets the font underlining.
635 \membersection{wxRichTextAttr::SetFontWeight
}\label{wxrichtextattrsetfontweight
}
637 \func{void
}{SetFontWeight
}{\param{int
}{fontWeight
}}
639 Sets the font weight.
641 \membersection{wxRichTextAttr::SetLeftIndent
}\label{wxrichtextattrsetleftindent
}
643 \func{void
}{SetLeftIndent
}{\param{int
}{indent
},
\param{int
}{subIndent =
0}}
645 Sets the left indent and left subindent in tenths of a millimetre.
647 The sub-indent is an offset from the left of the paragraph, and is used for all but the
648 first line in a paragraph. A positive value will cause the first line to appear to the left
649 of the subsequent lines, and a negative value will cause the first line to be indented
650 relative to the subsequent lines.
652 wxRichTextBuffer uses indentation to render a bulleted item. The left indent is the distance between
653 the margin and the bullet. The content of the paragraph, including the first line, starts
654 at leftMargin + leftSubIndent. So the distance between the left edge of the bullet and the
655 left of the actual paragraph is leftSubIndent.
657 \membersection{wxRichTextAttr::SetLineSpacing
}\label{wxrichtextattrsetlinespacing
}
659 \func{void
}{SetLineSpacing
}{\param{int
}{spacing
}}
661 Sets the line spacing.
{\it spacing
} is a multiple, where
10 means single-spacing,
662 15 means
1.5 spacing, and
20 means double spacing. The following constants are
663 defined for convenience:
667 #define wxTEXT_ATTR_LINE_SPACING_NORMAL
10
668 #define wxTEXT_ATTR_LINE_SPACING_HALF
15
669 #define wxTEXT_ATTR_LINE_SPACING_TWICE
20
673 \membersection{wxRichTextAttr::SetListStyleName
}\label{wxrichtextattrsetliststylename
}
675 \func{void
}{SetListStyleName
}{\param{const wxString\&
}{name
}}
677 Sets the list style name.
679 \membersection{wxRichTextAttr::SetParagraphSpacingAfter
}\label{wxrichtextattrsetparagraphspacingafter
}
681 \func{void
}{SetParagraphSpacingAfter
}{\param{int
}{spacing
}}
683 Sets the spacing after a paragraph, in tenths of a millimetre.
685 \membersection{wxRichTextAttr::SetParagraphSpacingBefore
}\label{wxrichtextattrsetparagraphspacingbefore
}
687 \func{void
}{SetParagraphSpacingBefore
}{\param{int
}{spacing
}}
689 Sets the spacing before a paragraph, in tenths of a millimetre.
691 \membersection{wxRichTextAttr::SetParagraphStyleName
}\label{wxrichtextattrsetparagraphstylename
}
693 \func{void
}{SetParagraphStyleName
}{\param{const wxString\&
}{name
}}
695 Sets the name of the paragraph style.
697 \membersection{wxRichTextAttr::SetRightIndent
}\label{wxrichtextattrsetrightindent
}
699 \func{void
}{SetRightIndent
}{\param{int
}{indent
}}
701 Sets the right indent in tenths of a millimetre.
703 \membersection{wxRichTextAttr::SetTabs
}\label{wxrichtextattrsettabs
}
705 \func{void
}{SetTabs
}{\param{const wxArrayInt\&
}{tabs
}}
707 Sets the tab stops, expressed in tenths of a millimetre.
708 Each stop is measured from the left margin and therefore each value must be larger than the last.
710 \membersection{wxRichTextAttr::SetTextColour
}\label{wxrichtextattrsettextcolour
}
712 \func{void
}{SetTextColour
}{\param{const wxColour\&
}{colText
}}
714 Sets the text foreground colout.
716 \membersection{wxRichTextAttr::SetURL
}\label{wxrichtextattrseturl
}
718 \func{void
}{SetURL
}{\param{const wxString\&
}{url
}}
720 Sets the URL for the content. Sets the wxTEXT
\_ATTR\_URL style; content with this style
721 causes wxRichTextCtrl to show a hand cursor over it, and wxRichTextCtrl generates
722 a wxTextUrlEvent when the content is clicked.
724 \membersection{wxRichTextAttr::operator=
}\label{wxrichtextattroperatorassign
}
726 \func{void operator
}{operator=
}{\param{const wxTextAttrEx\&
}{attr
}}
728 Assignment from a
\helpref{wxTextAttrEx
}{wxtextattr
} object.
730 \func{void operator
}{operator=
}{\param{const wxRichTextAttr\&
}{attr
}}
732 Assignment from a
\helpref{wxRichTextAttr
}{wxrichtextattr
} object.
734 \membersection{wxRichTextAttr::wxTextAttrEx
}\label{wxrichtextattrwxtextattrex
}
736 \constfunc{operator
}{wxTextAttrEx
}{\void}
738 Makes a
\helpref{wxTextAttrEx
}{wxtextattrex
} object from this object.