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
83 #define wxTEXT_ATTR_OUTLINE_LEVEL
0x01000000
87 The following styles can be passed to wxRichTextAttr::SetBulletStyle:
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
110 Of these, wxTEXT
\_ATTR\_BULLET\_STYLE\_BITMAP is unimplemented.
112 The following constants can be passed to wxRichTextAttr::SetLineSpacing:
116 #define wxTEXT_ATTR_LINE_SPACING_NORMAL
10
117 #define wxTEXT_ATTR_LINE_SPACING_HALF
15
118 #define wxTEXT_ATTR_LINE_SPACING_TWICE
20
122 The following styles can be passed to wxTextAttrEx::SetTextEffects:
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
140 Of these, only wxTEXT
\_ATTR\_EFFECT\_CAPITALS and wxTEXT
\_ATTR\_EFFECT\_STRIKETHROUGH are implemented.
144 \helpref{wxTextAttr
}{wxtextattr
},
\helpref{wxTextAttrEx
}{wxtextattrex
},
\helpref{wxRichTextCtrl
}{wxrichtextctrl
}
146 \latexignore{\rtfignore{\wxheading{Members
}}}
148 \membersection{wxRichTextAttr::wxRichTextAttr
}\label{wxrichtextattrwxrichtextattr
}
150 \func{}{wxRichTextAttr
}{\void}
152 \func{}{wxRichTextAttr
}{\param{const wxColour\&
}{colText
},
\param{const wxColour\&
}{colBack = wxNullColour
},
\param{wxTextAttrAlignment
}{alignment = wxTEXT
\_ALIGNMENT\_DEFAULT}}
154 \func{}{wxRichTextAttr
}{\param{const wxTextAttrEx\&
}{attr
}}
158 \membersection{wxRichTextAttr::CopyTo
}\label{wxrichtextattrcopyto
}
160 \constfunc{void
}{CopyTo
}{\param{wxTextAttrEx\&
}{attr
}}
162 Copies the wxRichTextAttr attributes to a
\helpref{wxTextAttrEx
}{wxtextattrex
} object.
164 \membersection{wxRichTextAttr::CreateFont
}\label{wxrichtextattrcreatefont
}
166 \constfunc{wxFont
}{CreateFont
}{\void}
168 Creates a font from the font attributes.
170 \membersection{wxRichTextAttr::GetAlignment
}\label{wxrichtextattrgetalignment
}
172 \constfunc{wxTextAttrAlignment
}{GetAlignment
}{\void}
174 Returns the alignment flags.
175 See
\helpref{wxRichTextAttr::SetAlignment
}{wxrichtextattrsetalignment
} for a list of available styles.
177 \membersection{wxRichTextAttr::GetBackgroundColour
}\label{wxrichtextattrgetbackgroundcolour
}
179 \constfunc{const wxColour\&
}{GetBackgroundColour
}{\void}
181 Returns the background colour.
183 \membersection{wxRichTextAttr::GetBulletFont
}\label{wxrichtextattrgetbulletfont
}
185 \constfunc{const wxString\&
}{GetBulletFont
}{\void}
187 Returns a string containing the name of the font associated with the bullet symbol.
188 Only valid for attributes with wxTEXT
\_ATTR\_BULLET\_SYMBOL.
190 \membersection{wxRichTextAttr::GetBulletName
}\label{wxrichtextattrgetbulletname
}
192 \constfunc{const wxString\&
}{GetBulletName
}{\void}
194 Returns the standard bullet name, applicable if the bullet style is wxTEXT
\_ATTR\_BULLET\_STYLE\_STANDARD.
195 Currently the following standard bullet names are supported:
197 \begin{itemize
}\itemsep=
0pt
198 \item {\tt standard/circle
}
199 \item {\tt standard/square
}
200 \item {\tt standard/diamond
}
201 \item {\tt standard/triangle
}
204 If you wish your application to support further bullet graphics, you can derive a
205 class from wxRichTextRenderer or wxRichTextStdRenderer, override
{\tt DrawStandardBullet
} and
{\tt EnumerateStandardBulletNames
}, and
206 set an instance of the class using
\helpref{wxRichTextBuffer::SetRenderer
}{wxrichtextbuffersetrenderer
}.
208 \membersection{wxRichTextAttr::GetBulletNumber
}\label{wxrichtextattrgetbulletnumber
}
210 \constfunc{int
}{GetBulletNumber
}{\void}
212 Returns the bullet number.
214 \membersection{wxRichTextAttr::GetBulletStyle
}\label{wxrichtextattrgetbulletstyle
}
216 \constfunc{int
}{GetBulletStyle
}{\void}
218 Returns the bullet style.
219 See
\helpref{wxRichTextAttr::SetBulletStyle
}{wxrichtextattrsetbulletstyle
} for a list of available styles.
221 \membersection{wxRichTextAttr::GetBulletText
}\label{wxrichtextattrgetbullettext
}
223 \constfunc{const wxString\&
}{GetBulletText
}{\void}
225 Returns the bullet text, which could be a symbol, or (for example) cached outline text.
227 \membersection{wxRichTextAttr::GetCharacterStyleName
}\label{wxrichtextattrgetcharacterstylename
}
229 \constfunc{const wxString\&
}{GetCharacterStyleName
}{\void}
231 Returns the name of the character style.
233 \membersection{wxRichTextAttr::GetFlags
}\label{wxrichtextattrgetflags
}
235 \constfunc{long
}{GetFlags
}{\void}
237 Returns flags indicating which attributes are applicable.
238 See
\helpref{wxRichTextAttr::SetFlags
}{wxrichtextattrsetflags
} for a list of available flags.
240 \membersection{wxRichTextAttr::GetFontAttributes
}\label{wxrichtextattrgetfontattributes
}
242 \func{bool
}{GetFontAttributes
}{\param{const wxFont\&
}{font
}}
244 Sets the font attributes from the given font.
246 \membersection{wxRichTextAttr::GetFontFaceName
}\label{wxrichtextattrgetfontfacename
}
248 \constfunc{const wxString\&
}{GetFontFaceName
}{\void}
250 Returns the font face name.
252 \membersection{wxRichTextAttr::GetFontSize
}\label{wxrichtextattrgetfontsize
}
254 \constfunc{int
}{GetFontSize
}{\void}
256 Returns the font size in points.
258 \membersection{wxRichTextAttr::GetFontStyle
}\label{wxrichtextattrgetfontstyle
}
260 \constfunc{int
}{GetFontStyle
}{\void}
262 Returns the font style.
264 \membersection{wxRichTextAttr::GetFontUnderlined
}\label{wxrichtextattrgetfontunderlined
}
266 \constfunc{bool
}{GetFontUnderlined
}{\void}
268 Returns
\true if the font is underlined.
270 \membersection{wxRichTextAttr::GetFontWeight
}\label{wxrichtextattrgetfontweight
}
272 \constfunc{int
}{GetFontWeight
}{\void}
274 Returns the font weight.
276 \membersection{wxRichTextAttr::GetLeftIndent
}\label{wxrichtextattrgetleftindent
}
278 \constfunc{long
}{GetLeftIndent
}{\void}
280 Returns the left indent in tenths of a millimetre.
282 \membersection{wxRichTextAttr::GetLeftSubIndent
}\label{wxrichtextattrgetleftsubindent
}
284 \constfunc{long
}{GetLeftSubIndent
}{\void}
286 Returns the left sub-indent in tenths of a millimetre.
288 \membersection{wxRichTextAttr::GetLineSpacing
}\label{wxrichtextattrgetlinespacing
}
290 \constfunc{int
}{GetLineSpacing
}{\void}
292 Returns the line spacing value, one of wxTEXT
\_ATTR\_LINE\_SPACING\_NORMAL,
293 wxTEXT
\_ATTR\_LINE\_SPACING\_HALF, and wxTEXT
\_ATTR\_LINE\_SPACING\_TWICE.
295 \membersection{wxRichTextAttr::GetListStyleName
}\label{wxrichtextattrgetliststylename
}
297 \constfunc{const wxString\&
}{GetListStyleName
}{\void}
299 Returns the name of the list style.
301 \membersection{wxRichTextAttr::GetOutlineLevel
}\label{wxrichtextattrgetoutlinelevel
}
303 \constfunc{bool
}{GetOutlineLevel
}{\void}
305 Returns the outline level.
307 \membersection{wxRichTextAttr::GetParagraphSpacingAfter
}\label{wxrichtextattrgetparagraphspacingafter
}
309 \constfunc{int
}{GetParagraphSpacingAfter
}{\void}
311 Returns the space in tenths of a millimeter after the paragraph.
313 \membersection{wxRichTextAttr::GetParagraphSpacingBefore
}\label{wxrichtextattrgetparagraphspacingbefore
}
315 \constfunc{int
}{GetParagraphSpacingBefore
}{\void}
317 Returns the space in tenths of a millimeter before the paragraph.
319 \membersection{wxRichTextAttr::GetParagraphStyleName
}\label{wxrichtextattrgetparagraphstylename
}
321 \constfunc{const wxString\&
}{GetParagraphStyleName
}{\void}
323 Returns the name of the paragraph style.
325 \membersection{wxRichTextAttr::GetRightIndent
}\label{wxrichtextattrgetrightindent
}
327 \constfunc{long
}{GetRightIndent
}{\void}
329 Returns the right indent in tenths of a millimeter.
331 \membersection{wxRichTextAttr::GetTabs
}\label{wxrichtextattrgettabs
}
333 \constfunc{const wxArrayInt\&
}{GetTabs
}{\void}
335 Returns an array of tab stops, each expressed in tenths of a millimeter. Each stop
336 is measured from the left margin and therefore each value must be larger than the last.
338 \membersection{wxRichTextAttr::GetTextColour
}\label{wxrichtextattrgettextcolour
}
340 \constfunc{const wxColour\&
}{GetTextColour
}{\void}
342 Returns the text foreground colour.
344 \membersection{wxRichTextAttr::GetTextEffectFlags
}\label{wxrichtextattrgettexteffectflags
}
346 \constfunc{int
}{GetTextEffectFlags
}{\void}
348 Returns the text effect bits of interest. See
\helpref{wxRichTextAttr::SetFlags
}{wxrichtextattrsetflags
} for further information.
350 \membersection{wxRichTextAttr::GetTextEffects
}\label{wxrichtextattrgettexteffects
}
352 \constfunc{int
}{GetTextEffects
}{\void}
354 Returns the text effects, a bit list of styles. See
\helpref{wxRichTextAttr::SetTextEffects
}{wxrichtextattrsettexteffects
} for
357 \membersection{wxRichTextAttr::GetURL
}\label{wxrichtextattrgeturl
}
359 \constfunc{const wxString\&
}{GetURL
}{\void}
361 Returns the URL for the content. Content with wxTEXT
\_ATTR\_URL style
362 causes wxRichTextCtrl to show a hand cursor over it, and wxRichTextCtrl generates
363 a wxTextUrlEvent when the content is clicked.
365 \membersection{wxRichTextAttr::HasAlignment
}\label{wxrichtextattrhasalignment
}
367 \constfunc{bool
}{HasAlignment
}{\void}
369 Returns
\true if the attribute object specifies alignment.
371 \membersection{wxRichTextAttr::HasBackgroundColour
}\label{wxrichtextattrhasbackgroundcolour
}
373 \constfunc{bool
}{HasBackgroundColour
}{\void}
375 Returns
\true if the attribute object specifies a background colour.
377 \membersection{wxRichTextAttr::HasBulletName
}\label{wxrichtextattrhasbulletname
}
379 \constfunc{bool
}{HasBulletName
}{\void}
381 Returns
\true if the attribute object specifies a standard bullet name.
383 \membersection{wxRichTextAttr::HasBulletNumber
}\label{wxrichtextattrhasbulletnumber
}
385 \constfunc{bool
}{HasBulletNumber
}{\void}
387 Returns
\true if the attribute object specifies a bullet number.
389 \membersection{wxRichTextAttr::HasBulletStyle
}\label{wxrichtextattrhasbulletstyle
}
391 \constfunc{bool
}{HasBulletStyle
}{\void}
393 Returns
\true if the attribute object specifies a bullet style.
395 \membersection{wxRichTextAttr::HasBulletText
}\label{wxrichtextattrhasbullettext
}
397 \constfunc{bool
}{HasBulletText
}{\void}
399 Returns
\true if the attribute object specifies bullet text (usually specifying a symbol).
401 \membersection{wxRichTextAttr::HasCharacterStyleName
}\label{wxrichtextattrhascharacterstylename
}
403 \constfunc{bool
}{HasCharacterStyleName
}{\void}
405 Returns
\true if the attribute object specifies a character style name.
407 \membersection{wxRichTextAttr::HasFaceName
}\label{wxrichtextattrhasfacename
}
409 \constfunc{bool
}{HasFaceName
}{\void}
411 Returns
\true if the attribute object specifies a font face name.
413 \membersection{wxRichTextAttr::HasFlag
}\label{wxrichtextattrhasflag
}
415 \constfunc{bool
}{HasFlag
}{\param{long
}{flag
}}
417 Returns
\true if the
{\it flag
} is present in the attribute object's flag bitlist.
419 \membersection{wxRichTextAttr::HasFont
}\label{wxrichtextattrhasfont
}
421 \constfunc{bool
}{HasFont
}{\void}
423 Returns
\true if the attribute object specifies any font attributes.
425 \membersection{wxRichTextAttr::HasItalic
}\label{wxrichtextattrhasitalic
}
427 \constfunc{bool
}{HasItalic
}{\void}
429 Returns
\true if the attribute object specifies italic style.
431 \membersection{wxRichTextAttr::HasLeftIndent
}\label{wxrichtextattrhasleftindent
}
433 \constfunc{bool
}{HasLeftIndent
}{\void}
435 Returns
\true if the attribute object specifies a left indent.
437 \membersection{wxRichTextAttr::HasLineSpacing
}\label{wxrichtextattrhaslinespacing
}
439 \constfunc{bool
}{HasLineSpacing
}{\void}
441 Returns
\true if the attribute object specifies line spacing.
443 \membersection{wxRichTextAttr::HasListStyleName
}\label{wxrichtextattrhasliststylename
}
445 \constfunc{bool
}{HasListStyleName
}{\void}
447 Returns
\true if the attribute object specifies a list style name.
449 \membersection{wxRichTextAttr::HasOutlineLevel
}\label{wxrichtextattrhasoutlinelevel
}
451 \constfunc{bool
}{HasOutlineLevel
}{\void}
453 Returns
\true if the attribute object specifies an outline level.
455 \membersection{wxRichTextAttr::HasPageBreak
}\label{wxrichtextattrhaspagebreak
}
457 \constfunc{bool
}{HasPageBreak
}{\void}
459 Returns
\true if the attribute object specifies a page break before this paragraph.
461 \membersection{wxRichTextAttr::HasParagraphSpacingAfter
}\label{wxrichtextattrhasparagraphspacingafter
}
463 \constfunc{bool
}{HasParagraphSpacingAfter
}{\void}
465 Returns
\true if the attribute object specifies spacing after a paragraph.
467 \membersection{wxRichTextAttr::HasParagraphSpacingBefore
}\label{wxrichtextattrhasparagraphspacingbefore
}
469 \constfunc{bool
}{HasParagraphSpacingBefore
}{\void}
471 Returns
\true if the attribute object specifies spacing before a paragraph.
473 \membersection{wxRichTextAttr::HasParagraphStyleName
}\label{wxrichtextattrhasparagraphstylename
}
475 \constfunc{bool
}{HasParagraphStyleName
}{\void}
477 Returns
\true if the attribute object specifies a paragraph style name.
479 \membersection{wxRichTextAttr::HasRightIndent
}\label{wxrichtextattrhasrightindent
}
481 \constfunc{bool
}{HasRightIndent
}{\void}
483 Returns
\true if the attribute object specifies a right indent.
485 \membersection{wxRichTextAttr::HasSize
}\label{wxrichtextattrhassize
}
487 \constfunc{bool
}{HasSize
}{\void}
489 Returns
\true if the attribute object specifies a font point size.
491 \membersection{wxRichTextAttr::HasTabs
}\label{wxrichtextattrhastabs
}
493 \constfunc{bool
}{HasTabs
}{\void}
495 Returns
\true if the attribute object specifies tab stops.
497 \membersection{wxRichTextAttr::HasTextColour
}\label{wxrichtextattrhastextcolour
}
499 \constfunc{bool
}{HasTextColour
}{\void}
501 Returns
\true if the attribute object specifies a text foreground colour.
503 \membersection{wxRichTextAttr::HasTextEffects
}\label{wxrichtextattrhastexteffects
}
505 \constfunc{bool
}{HasTextEffects
}{\void}
507 Returns
\true if the attribute object specifies text effects.
509 \membersection{wxRichTextAttr::HasUnderlined
}\label{wxrichtextattrhasunderlined
}
511 \constfunc{bool
}{HasUnderlined
}{\void}
513 Returns
\true if the attribute object specifies either underlining or no underlining.
515 \membersection{wxRichTextAttr::HasURL
}\label{wxrichtextattrhasurl
}
517 \constfunc{bool
}{HasURL
}{\void}
519 Returns
\true if the attribute object specifies a URL.
521 \membersection{wxRichTextAttr::HasWeight
}\label{wxrichtextattrhasweight
}
523 \constfunc{bool
}{HasWeight
}{\void}
525 Returns
\true if the attribute object specifies font weight (bold, light or normal).
527 \membersection{wxRichTextAttr::Init
}\label{wxrichtextattrinit
}
529 \func{void
}{Init
}{\void}
531 Initialise the object.
533 \membersection{wxRichTextAttr::IsCharacterStyle
}\label{wxrichtextattrischaracterstyle
}
535 \constfunc{bool
}{IsCharacterStyle
}{\void}
537 Returns
\true if the object represents a character style, that is,
538 the flags specify a font or a text background or foreground colour.
540 \membersection{wxRichTextAttr::IsDefault
}\label{wxrichtextattrisdefault
}
542 \constfunc{bool
}{IsDefault
}{\void}
544 Returns
\false if we have any attributes set,
\true otherwise.
546 \membersection{wxRichTextAttr::IsParagraphStyle
}\label{wxrichtextattrisparagraphstyle
}
548 \constfunc{bool
}{IsParagraphStyle
}{\void}
550 Returns
\true if the object represents a paragraph style, that is,
551 the flags specify alignment, indentation, tabs, paragraph spacing, or
554 \membersection{wxRichTextAttr::SetAlignment
}\label{wxrichtextattrsetalignment
}
556 \func{void
}{SetAlignment
}{\param{wxTextAttrAlignment
}{alignment
}}
558 Sets the paragraph alignment. These are the possible values for
{\it alignment
}:
562 enum wxTextAttrAlignment
564 wxTEXT_ALIGNMENT_DEFAULT,
565 wxTEXT_ALIGNMENT_LEFT,
566 wxTEXT_ALIGNMENT_CENTRE,
567 wxTEXT_ALIGNMENT_CENTER = wxTEXT_ALIGNMENT_CENTRE,
568 wxTEXT_ALIGNMENT_RIGHT,
569 wxTEXT_ALIGNMENT_JUSTIFIED
574 Of these, wxTEXT
\_ALIGNMENT\_JUSTIFIED is unimplemented. In future justification may be supported
575 when printing or previewing, only.
577 \membersection{wxRichTextAttr::SetBackgroundColour
}\label{wxrichtextattrsetbackgroundcolour
}
579 \func{void
}{SetBackgroundColour
}{\param{const wxColour\&
}{colBack
}}
581 Sets the background colour.
583 \membersection{wxRichTextAttr::SetBulletFont
}\label{wxrichtextattrsetbulletfont
}
585 \func{void
}{SetBulletFont
}{\param{const wxString\&
}{font
}}
587 Sets the name of the font associated with the bullet symbol.
588 Only valid for attributes with wxTEXT
\_ATTR\_BULLET\_SYMBOL.
590 \membersection{wxRichTextAttr::SetBulletName
}\label{wxrichtextattrsetbulletname
}
592 \func{void
}{SetBulletName
}{\param{const wxString\&
}{name
}}
594 Sets the standard bullet name, applicable if the bullet style is wxTEXT
\_ATTR\_BULLET\_STYLE\_STANDARD.
595 See
\helpref{wxRichTextAttr::GetBulletName
}{wxrichtextattrgetbulletname
} for a list
596 of supported names, and how to expand the range of supported types.
598 \membersection{wxRichTextAttr::SetBulletNumber
}\label{wxrichtextattrsetbulletnumber
}
600 \func{void
}{SetBulletNumber
}{\param{int
}{n
}}
602 Sets the bullet number.
604 \membersection{wxRichTextAttr::SetBulletStyle
}\label{wxrichtextattrsetbulletstyle
}
606 \func{void
}{SetBulletStyle
}{\param{int
}{style
}}
608 Sets the bullet style. The following styles can be passed:
612 #define wxTEXT_ATTR_BULLET_STYLE_NONE
0x00000000
613 #define wxTEXT_ATTR_BULLET_STYLE_ARABIC
0x00000001
614 #define wxTEXT_ATTR_BULLET_STYLE_LETTERS_UPPER
0x00000002
615 #define wxTEXT_ATTR_BULLET_STYLE_LETTERS_LOWER
0x00000004
616 #define wxTEXT_ATTR_BULLET_STYLE_ROMAN_UPPER
0x00000008
617 #define wxTEXT_ATTR_BULLET_STYLE_ROMAN_LOWER
0x00000010
618 #define wxTEXT_ATTR_BULLET_STYLE_SYMBOL
0x00000020
619 #define wxTEXT_ATTR_BULLET_STYLE_BITMAP
0x00000040
620 #define wxTEXT_ATTR_BULLET_STYLE_PARENTHESES
0x00000080
621 #define wxTEXT_ATTR_BULLET_STYLE_PERIOD
0x00000100
622 #define wxTEXT_ATTR_BULLET_STYLE_STANDARD
0x00000200
623 #define wxTEXT_ATTR_BULLET_STYLE_RIGHT_PARENTHESIS
0x00000400
624 #define wxTEXT_ATTR_BULLET_STYLE_OUTLINE
0x00000800
625 #define wxTEXT_ATTR_BULLET_STYLE_ALIGN_LEFT
0x00000000
626 #define wxTEXT_ATTR_BULLET_STYLE_ALIGN_RIGHT
0x00001000
627 #define wxTEXT_ATTR_BULLET_STYLE_ALIGN_CENTRE
0x00002000
631 Currently wxTEXT
\_ATTR\_BULLET\_STYLE\_BITMAP is not supported.
633 \membersection{wxRichTextAttr::SetBulletText
}\label{wxrichtextattrsetbullettext
}
635 \func{void
}{SetBulletText
}{\param{const wxString&
}{text
}}
637 Sets the bullet text, which could be a symbol, or (for example) cached outline text.
639 \membersection{wxRichTextAttr::SetCharacterStyleName
}\label{wxrichtextattrsetcharacterstylename
}
641 \func{void
}{SetCharacterStyleName
}{\param{const wxString\&
}{name
}}
643 Sets the character style name.
645 \membersection{wxRichTextAttr::SetFlags
}\label{wxrichtextattrsetflags
}
647 \func{void
}{SetFlags
}{\param{long
}{flags
}}
649 Sets the flags determining which styles are being specified. The following
650 flags can be passed in a bitlist:
654 // Standard wxTextAttr constants
656 #define wxTEXT_ATTR_TEXT_COLOUR
0x00000001
657 #define wxTEXT_ATTR_BACKGROUND_COLOUR
0x00000002
658 #define wxTEXT_ATTR_FONT_FACE
0x00000004
659 #define wxTEXT_ATTR_FONT_SIZE
0x00000008
660 #define wxTEXT_ATTR_FONT_WEIGHT
0x00000010
661 #define wxTEXT_ATTR_FONT_ITALIC
0x00000020
662 #define wxTEXT_ATTR_FONT_UNDERLINE
0x00000040
663 #define wxTEXT_ATTR_FONT \
664 wxTEXT_ATTR_FONT_FACE | wxTEXT_ATTR_FONT_SIZE | wxTEXT_ATTR_FONT_WEIGHT \
665 | wxTEXT_ATTR_FONT_ITALIC | wxTEXT_ATTR_FONT_UNDERLINE
666 #define wxTEXT_ATTR_ALIGNMENT
0x00000080
667 #define wxTEXT_ATTR_LEFT_INDENT
0x00000100
668 #define wxTEXT_ATTR_RIGHT_INDENT
0x00000200
669 #define wxTEXT_ATTR_TABS
0x00000400
671 // Extra formatting flags not in wxTextAttr
673 #define wxTEXT_ATTR_PARA_SPACING_AFTER
0x00000800
674 #define wxTEXT_ATTR_PARA_SPACING_BEFORE
0x00001000
675 #define wxTEXT_ATTR_LINE_SPACING
0x00002000
676 #define wxTEXT_ATTR_CHARACTER_STYLE_NAME
0x00004000
677 #define wxTEXT_ATTR_PARAGRAPH_STYLE_NAME
0x00008000
678 #define wxTEXT_ATTR_LIST_STYLE_NAME
0x00010000
679 #define wxTEXT_ATTR_BULLET_STYLE
0x00020000
680 #define wxTEXT_ATTR_BULLET_NUMBER
0x00040000
681 #define wxTEXT_ATTR_BULLET_TEXT
0x00080000
682 #define wxTEXT_ATTR_BULLET_NAME
0x00100000
683 #define wxTEXT_ATTR_URL
0x00200000
684 #define wxTEXT_ATTR_PAGE_BREAK
0x00400000
685 #define wxTEXT_ATTR_EFFECTS
0x00800000
686 #define wxTEXT_ATTR_OUTLINE_LEVEL
0x01000000
690 \membersection{wxRichTextAttr::SetFontFaceName
}\label{wxrichtextattrsetfontfacename
}
692 \func{void
}{SetFontFaceName
}{\param{const wxString\&
}{faceName
}}
694 Sets the paragraph alignment.
696 \membersection{wxRichTextAttr::SetFontSize
}\label{wxrichtextattrsetfontsize
}
698 \func{void
}{SetFontSize
}{\param{int
}{pointSize
}}
700 Sets the font size in points.
702 \membersection{wxRichTextAttr::SetFontStyle
}\label{wxrichtextattrsetfontstyle
}
704 \func{void
}{SetFontStyle
}{\param{int
}{fontStyle
}}
706 Sets the font style (normal, italic or slanted).
708 \membersection{wxRichTextAttr::SetFontUnderlined
}\label{wxrichtextattrsetfontunderlined
}
710 \func{void
}{SetFontUnderlined
}{\param{bool
}{underlined
}}
712 Sets the font underlining.
714 \membersection{wxRichTextAttr::SetFontWeight
}\label{wxrichtextattrsetfontweight
}
716 \func{void
}{SetFontWeight
}{\param{int
}{fontWeight
}}
718 Sets the font weight.
720 \membersection{wxRichTextAttr::SetLeftIndent
}\label{wxrichtextattrsetleftindent
}
722 \func{void
}{SetLeftIndent
}{\param{int
}{indent
},
\param{int
}{subIndent =
0}}
724 Sets the left indent and left subindent in tenths of a millimetre.
726 The sub-indent is an offset from the left of the paragraph, and is used for all but the
727 first line in a paragraph. A positive value will cause the first line to appear to the left
728 of the subsequent lines, and a negative value will cause the first line to be indented
729 relative to the subsequent lines.
731 wxRichTextBuffer uses indentation to render a bulleted item. The left indent is the distance between
732 the margin and the bullet. The content of the paragraph, including the first line, starts
733 at leftMargin + leftSubIndent. So the distance between the left edge of the bullet and the
734 left of the actual paragraph is leftSubIndent.
736 \membersection{wxRichTextAttr::SetLineSpacing
}\label{wxrichtextattrsetlinespacing
}
738 \func{void
}{SetLineSpacing
}{\param{int
}{spacing
}}
740 Sets the line spacing.
{\it spacing
} is a multiple, where
10 means single-spacing,
741 15 means
1.5 spacing, and
20 means double spacing. The following constants are
742 defined for convenience:
746 #define wxTEXT_ATTR_LINE_SPACING_NORMAL
10
747 #define wxTEXT_ATTR_LINE_SPACING_HALF
15
748 #define wxTEXT_ATTR_LINE_SPACING_TWICE
20
752 \membersection{wxRichTextAttr::SetListStyleName
}\label{wxrichtextattrsetliststylename
}
754 \func{void
}{SetListStyleName
}{\param{const wxString\&
}{name
}}
756 Sets the list style name.
758 \membersection{wxRichTextAttr::SetOutlineLevel
}\label{wxrichtextattrsetoutlinelevel
}
760 \func{void
}{SetOutlineLevel
}{\param{int
}{ level
}}
762 Specifies the outline level. Zero represents normal text. At present, the outline level is
763 not used, but may be used in future for determining list levels and for applications
764 that need to store
document structure information.
766 \membersection{wxRichTextAttr::SetPageBreak
}\label{wxrichtextattrsetpagebreak
}
768 \func{void
}{SetPageBreak
}{\param{bool
}{ pageBreak = true
}}
770 Specifies a page break before this paragraph.
772 \membersection{wxRichTextAttr::SetParagraphSpacingAfter
}\label{wxrichtextattrsetparagraphspacingafter
}
774 \func{void
}{SetParagraphSpacingAfter
}{\param{int
}{spacing
}}
776 Sets the spacing after a paragraph, in tenths of a millimetre.
778 \membersection{wxRichTextAttr::SetParagraphSpacingBefore
}\label{wxrichtextattrsetparagraphspacingbefore
}
780 \func{void
}{SetParagraphSpacingBefore
}{\param{int
}{spacing
}}
782 Sets the spacing before a paragraph, in tenths of a millimetre.
784 \membersection{wxRichTextAttr::SetParagraphStyleName
}\label{wxrichtextattrsetparagraphstylename
}
786 \func{void
}{SetParagraphStyleName
}{\param{const wxString\&
}{name
}}
788 Sets the name of the paragraph style.
790 \membersection{wxRichTextAttr::SetRightIndent
}\label{wxrichtextattrsetrightindent
}
792 \func{void
}{SetRightIndent
}{\param{int
}{indent
}}
794 Sets the right indent in tenths of a millimetre.
796 \membersection{wxRichTextAttr::SetTabs
}\label{wxrichtextattrsettabs
}
798 \func{void
}{SetTabs
}{\param{const wxArrayInt\&
}{tabs
}}
800 Sets the tab stops, expressed in tenths of a millimetre.
801 Each stop is measured from the left margin and therefore each value must be larger than the last.
803 \membersection{wxRichTextAttr::SetTextColour
}\label{wxrichtextattrsettextcolour
}
805 \func{void
}{SetTextColour
}{\param{const wxColour\&
}{colText
}}
807 Sets the text foreground colout.
809 \membersection{wxRichTextAttr::SetTextEffectFlags
}\label{wxrichtextattrsettexteffectflags
}
811 \func{void
}{SetTextEffectFlags
}{\param{int
}{flags
}}
813 Sets the text effect bits of interest. You should also pass wxTEXT
\_ATTR\_EFFECTS to
\helpref{wxRichTextAttr::SetFlags
}{wxrichtextattrsetflags
}.
814 See
\helpref{wxRichTextAttr::SetFlags
}{wxrichtextattrsetflags
} for further information.
816 \membersection{wxRichTextAttr::SetTextEffects
}\label{wxrichtextattrsettexteffects
}
818 \func{void
}{SetTextEffects
}{\param{int
}{effects
}}
820 Sets the text effects, a bit list of styles.
822 The following styles can be passed:
826 #define wxTEXT_ATTR_EFFECT_NONE
0x00000000
827 #define wxTEXT_ATTR_EFFECT_CAPITALS
0x00000001
828 #define wxTEXT_ATTR_EFFECT_SMALL_CAPITALS
0x00000002
829 #define wxTEXT_ATTR_EFFECT_STRIKETHROUGH
0x00000004
830 #define wxTEXT_ATTR_EFFECT_DOUBLE_STRIKETHROUGH
0x00000008
831 #define wxTEXT_ATTR_EFFECT_SHADOW
0x00000010
832 #define wxTEXT_ATTR_EFFECT_EMBOSS
0x00000020
833 #define wxTEXT_ATTR_EFFECT_OUTLINE
0x00000040
834 #define wxTEXT_ATTR_EFFECT_ENGRAVE
0x00000080
835 #define wxTEXT_ATTR_EFFECT_SUPERSCRIPT
0x00000100
836 #define wxTEXT_ATTR_EFFECT_SUBSCRIPT
0x00000200
840 Of these, only wxTEXT
\_ATTR\_EFFECT\_CAPITALS and wxTEXT
\_ATTR\_EFFECT\_STRIKETHROUGH are implemented.
841 wxTEXT
\_ATTR\_EFFECT\_CAPITALS capitalises text when displayed (leaving the case of the actual buffer
842 text unchanged), and wxTEXT
\_ATTR\_EFFECT\_STRIKETHROUGH draws a line through text.
844 To set effects, you should also pass wxTEXT
\_ATTR\_EFFECTS to
\helpref{wxRichTextAttr::SetFlags
}{wxrichtextattrsetflags
}, and call
\rtfsp
845 \helpref{wxRichTextAttr::SetTextEffectFlags
}{wxrichtextattrsettexteffectflags
} with the styles (taken from the
846 above set) that you are interested in setting.
848 \membersection{wxRichTextAttr::SetURL
}\label{wxrichtextattrseturl
}
850 \func{void
}{SetURL
}{\param{const wxString\&
}{url
}}
852 Sets the URL for the content. Sets the wxTEXT
\_ATTR\_URL style; content with this style
853 causes wxRichTextCtrl to show a hand cursor over it, and wxRichTextCtrl generates
854 a wxTextUrlEvent when the content is clicked.
856 \membersection{wxRichTextAttr::operator=
}\label{wxrichtextattroperatorassign
}
858 \func{void operator
}{operator=
}{\param{const wxTextAttrEx\&
}{attr
}}
860 Assignment from a
\helpref{wxTextAttrEx
}{wxtextattr
} object.
862 \func{void operator
}{operator=
}{\param{const wxRichTextAttr\&
}{attr
}}
864 Assignment from a
\helpref{wxRichTextAttr
}{wxrichtextattr
} object.
866 \membersection{wxRichTextAttr::wxTextAttrEx
}\label{wxrichtextattrwxtextattrex
}
868 \constfunc{operator
}{wxTextAttrEx
}{\void}
870 Makes a
\helpref{wxTextAttrEx
}{wxtextattrex
} object from this object.