1 \section{\class{wxTextAttr
}}\label{wxtextattr
}
3 wxTextAttr represents the character and paragraph attributes, or style,
4 for a range of text in a
\helpref{wxTextCtrl
}{wxtextctrl
} or
\helpref{wxRichTextCtrl
}{wxrichtextctrl
}.
6 When setting up a wxTextAttr object, pass a bitlist mask to
\helpref{SetFlags
}{wxtextattrsetflags
} to
7 indicate which style elements should be changed. As a convenience, when you call a setter such
8 as SetFont, the relevant bit will be set.
10 \wxheading{Derived from
}
14 \wxheading{Include files
}
20 \helpref{wxCore
}{librarieslist
}
24 The following values can be passed to wxTextAttr::SetAlignment to determine
29 enum wxTextAttrAlignment
31 wxTEXT_ALIGNMENT_DEFAULT,
32 wxTEXT_ALIGNMENT_LEFT,
33 wxTEXT_ALIGNMENT_CENTRE,
34 wxTEXT_ALIGNMENT_CENTER = wxTEXT_ALIGNMENT_CENTRE,
35 wxTEXT_ALIGNMENT_RIGHT,
36 wxTEXT_ALIGNMENT_JUSTIFIED
41 Of these, wxTEXT
\_ALIGNMENT\_JUSTIFIED is unimplemented. In future justification may be supported
42 when printing or previewing, only.
44 The following values are passed in a bitlist to wxTextAttr::SetFlags to determine
45 what attributes will be considered when setting the attributes
50 // Standard wxTextAttr constants
52 #define wxTEXT_ATTR_TEXT_COLOUR
0x00000001
53 #define wxTEXT_ATTR_BACKGROUND_COLOUR
0x00000002
54 #define wxTEXT_ATTR_FONT_FACE
0x00000004
55 #define wxTEXT_ATTR_FONT_SIZE
0x00000008
56 #define wxTEXT_ATTR_FONT_WEIGHT
0x00000010
57 #define wxTEXT_ATTR_FONT_ITALIC
0x00000020
58 #define wxTEXT_ATTR_FONT_UNDERLINE
0x00000040
59 #define wxTEXT_ATTR_FONT_ENCODING
0x02000000
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 | wxTEXT_ATTR_FONT_ENCODING
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 wxTextAttr::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 wxTextAttr::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 wxTextAttr::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{wxTextCtrl
}{wxtextctrl
},
\helpref{wxRichTextCtrl
}{wxrichtextctrl
}
146 \latexignore{\rtfignore{\wxheading{Members
}}}
148 \membersection{wxTextAttr::wxTextAttr
}\label{wxtextattrwxtextattr
}
150 \func{}{wxTextAttr
}{\void}
152 \func{}{wxTextAttr
}{\param{const wxColour\&
}{colText
},
\param{const wxColour\&
}{colBack = wxNullColour
},
\param{const wxFont\&
}{font = wxNullFont
},
\param{wxTextAttrAlignment
}{alignment = wxTEXT
\_ALIGNMENT\_DEFAULT}}
154 \func{}{wxTextAttr
}{\param{const wxTextAttr\&
}{attr
}}
158 \membersection{wxTextAttr::Apply
}\label{wxtextattrapply
}
160 \func{bool
}{Apply
}{\param{const wxTextAttr\&
}{style
},
\param{const wxTextAttr*
}{compareWith = NULL
}}
162 Applies the attributes in
{\it style
} to the original object, but not those attributes from
{\it style
} that are the same as those in
{\it compareWith
} (if passed).
164 \membersection{wxTextAttr::CreateFont
}\label{wxtextattrcreatefont
}
166 \constfunc{wxFont
}{CreateFont
}{\void}
168 Creates a font from the font attributes.
170 \membersection{wxTextAttr::GetAlignment
}\label{wxtextattrgetalignment
}
172 \constfunc{wxTextAttrAlignment
}{GetAlignment
}{\void}
174 Returns the alignment flags.
175 See
\helpref{wxTextAttr::SetAlignment
}{wxtextattrsetalignment
} for a list of available styles.
177 \membersection{wxTextAttr::GetBackgroundColour
}\label{wxtextattrgetbackgroundcolour
}
179 \constfunc{const wxColour\&
}{GetBackgroundColour
}{\void}
181 Returns the background colour.
183 \membersection{wxTextAttr::GetBulletFont
}\label{wxtextattrgetbulletfont
}
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{wxTextAttr::GetBulletName
}\label{wxtextattrgetbulletname
}
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 For wxRichTextCtrl users only: if you wish your rich text controls 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{wxTextAttr::GetBulletNumber
}\label{wxtextattrgetbulletnumber
}
210 \constfunc{int
}{GetBulletNumber
}{\void}
212 Returns the bullet number.
214 \membersection{wxTextAttr::GetBulletStyle
}\label{wxtextattrgetbulletstyle
}
216 \constfunc{int
}{GetBulletStyle
}{\void}
218 Returns the bullet style.
219 See
\helpref{wxTextAttr::SetBulletStyle
}{wxtextattrsetbulletstyle
} for a list of available styles.
221 \membersection{wxTextAttr::GetBulletText
}\label{wxtextattrgetbullettext
}
223 \constfunc{const wxString\&
}{GetBulletText
}{\void}
225 Returns the bullet text, which could be a symbol, or (for example) cached outline text.
227 \membersection{wxTextAttr::GetCharacterStyleName
}\label{wxtextattrgetcharacterstylename
}
229 \constfunc{const wxString\&
}{GetCharacterStyleName
}{\void}
231 Returns the name of the character style.
233 \membersection{wxTextAttr::GetFlags
}\label{wxtextattrgetflags
}
235 \constfunc{long
}{GetFlags
}{\void}
237 Returns flags indicating which attributes are applicable.
238 See
\helpref{wxTextAttr::SetFlags
}{wxtextattrsetflags
} for a list of available flags.
240 \membersection{wxTextAttr::GetFont
}\label{wxtextattrgetfont
}
242 \constfunc{wxFont
}{GetFont
}{\void}
244 Creates and returns a font specified by the font attributes in the wxTextAttr object. Note that
245 wxTextAttr does not store a wxFont object, so this is only a temporary font. For greater
246 efficiency, access the font attributes directly.
248 \membersection{wxTextAttr::GetFontAttributes
}\label{wxtextattrgetfontattributes
}
250 \func{bool
}{GetFontAttributes
}{\param{const wxFont\&
}{font
},
\param{int
}{ flags = wxTEXT
\_ATTR\_FONT}}
252 Gets the font attributes from the given font, using only the attributes specified by
{\it flags
}.
254 \membersection{wxTextAttr::GetFontEncoding
}\label{wxtextattrgetfontencoding
}
256 \constfunc{wxFontEncoding
}{GetFontEncoding
}{\void}
258 Returns the font encoding.
260 \membersection{wxTextAttr::GetFontFaceName
}\label{wxtextattrgetfontfacename
}
262 \constfunc{const wxString\&
}{GetFontFaceName
}{\void}
264 Returns the font face name.
266 \membersection{wxTextAttr::GetFontSize
}\label{wxtextattrgetfontsize
}
268 \constfunc{int
}{GetFontSize
}{\void}
270 Returns the font size in points.
272 \membersection{wxTextAttr::GetFontStyle
}\label{wxtextattrgetfontstyle
}
274 \constfunc{int
}{GetFontStyle
}{\void}
276 Returns the font style.
278 \membersection{wxTextAttr::GetFontUnderlined
}\label{wxtextattrgetfontunderlined
}
280 \constfunc{bool
}{GetFontUnderlined
}{\void}
282 Returns
\true if the font is underlined.
284 \membersection{wxTextAttr::GetFontWeight
}\label{wxtextattrgetfontweight
}
286 \constfunc{int
}{GetFontWeight
}{\void}
288 Returns the font weight.
290 \membersection{wxTextAttr::GetLeftIndent
}\label{wxtextattrgetleftindent
}
292 \constfunc{long
}{GetLeftIndent
}{\void}
294 Returns the left indent in tenths of a millimetre.
296 \membersection{wxTextAttr::GetLeftSubIndent
}\label{wxtextattrgetleftsubindent
}
298 \constfunc{long
}{GetLeftSubIndent
}{\void}
300 Returns the left sub-indent in tenths of a millimetre.
302 \membersection{wxTextAttr::GetLineSpacing
}\label{wxtextattrgetlinespacing
}
304 \constfunc{int
}{GetLineSpacing
}{\void}
306 Returns the line spacing value, one of wxTEXT
\_ATTR\_LINE\_SPACING\_NORMAL,
307 wxTEXT
\_ATTR\_LINE\_SPACING\_HALF, and wxTEXT
\_ATTR\_LINE\_SPACING\_TWICE.
309 \membersection{wxTextAttr::GetListStyleName
}\label{wxtextattrgetliststylename
}
311 \constfunc{const wxString\&
}{GetListStyleName
}{\void}
313 Returns the name of the list style.
315 \membersection{wxTextAttr::GetOutlineLevel
}\label{wxtextattrgetoutlinelevel
}
317 \constfunc{bool
}{GetOutlineLevel
}{\void}
319 Returns the outline level.
321 \membersection{wxTextAttr::GetParagraphSpacingAfter
}\label{wxtextattrgetparagraphspacingafter
}
323 \constfunc{int
}{GetParagraphSpacingAfter
}{\void}
325 Returns the space in tenths of a millimeter after the paragraph.
327 \membersection{wxTextAttr::GetParagraphSpacingBefore
}\label{wxtextattrgetparagraphspacingbefore
}
329 \constfunc{int
}{GetParagraphSpacingBefore
}{\void}
331 Returns the space in tenths of a millimeter before the paragraph.
333 \membersection{wxTextAttr::GetParagraphStyleName
}\label{wxtextattrgetparagraphstylename
}
335 \constfunc{const wxString\&
}{GetParagraphStyleName
}{\void}
337 Returns the name of the paragraph style.
339 \membersection{wxTextAttr::GetRightIndent
}\label{wxtextattrgetrightindent
}
341 \constfunc{long
}{GetRightIndent
}{\void}
343 Returns the right indent in tenths of a millimeter.
345 \membersection{wxTextAttr::GetTabs
}\label{wxtextattrgettabs
}
347 \constfunc{const wxArrayInt\&
}{GetTabs
}{\void}
349 Returns an array of tab stops, each expressed in tenths of a millimeter. Each stop
350 is measured from the left margin and therefore each value must be larger than the last.
352 \membersection{wxTextAttr::GetTextColour
}\label{wxtextattrgettextcolour
}
354 \constfunc{const wxColour\&
}{GetTextColour
}{\void}
356 Returns the text foreground colour.
358 \membersection{wxTextAttr::GetTextEffectFlags
}\label{wxtextattrgettexteffectflags
}
360 \constfunc{int
}{GetTextEffectFlags
}{\void}
362 Returns the text effect bits of interest. See
\helpref{wxTextAttr::SetFlags
}{wxtextattrsetflags
} for further information.
364 \membersection{wxTextAttr::GetTextEffects
}\label{wxtextattrgettexteffects
}
366 \constfunc{int
}{GetTextEffects
}{\void}
368 Returns the text effects, a bit list of styles. See
\helpref{wxTextAttr::SetTextEffects
}{wxtextattrsettexteffects
} for
371 \membersection{wxTextAttr::GetURL
}\label{wxtextattrgeturl
}
373 \constfunc{const wxString\&
}{GetURL
}{\void}
375 Returns the URL for the content. Content with wxTEXT
\_ATTR\_URL style
376 causes wxRichTextCtrl to show a hand cursor over it, and wxRichTextCtrl generates
377 a wxTextUrlEvent when the content is clicked.
379 \membersection{wxTextAttr::HasAlignment
}\label{wxtextattrhasalignment
}
381 \constfunc{bool
}{HasAlignment
}{\void}
383 Returns
\true if the attribute object specifies alignment.
385 \membersection{wxTextAttr::HasBackgroundColour
}\label{wxtextattrhasbackgroundcolour
}
387 \constfunc{bool
}{HasBackgroundColour
}{\void}
389 Returns
\true if the attribute object specifies a background colour.
391 \membersection{wxTextAttr::HasBulletName
}\label{wxtextattrhasbulletname
}
393 \constfunc{bool
}{HasBulletName
}{\void}
395 Returns
\true if the attribute object specifies a standard bullet name.
397 \membersection{wxTextAttr::HasBulletNumber
}\label{wxtextattrhasbulletnumber
}
399 \constfunc{bool
}{HasBulletNumber
}{\void}
401 Returns
\true if the attribute object specifies a bullet number.
403 \membersection{wxTextAttr::HasBulletStyle
}\label{wxtextattrhasbulletstyle
}
405 \constfunc{bool
}{HasBulletStyle
}{\void}
407 Returns
\true if the attribute object specifies a bullet style.
409 \membersection{wxTextAttr::HasBulletText
}\label{wxtextattrhasbullettext
}
411 \constfunc{bool
}{HasBulletText
}{\void}
413 Returns
\true if the attribute object specifies bullet text (usually specifying a symbol).
415 \membersection{wxTextAttr::HasCharacterStyleName
}\label{wxtextattrhascharacterstylename
}
417 \constfunc{bool
}{HasCharacterStyleName
}{\void}
419 Returns
\true if the attribute object specifies a character style name.
421 \membersection{wxTextAttr::HasFontEncoding
}\label{wxtextattrhasfontencoding
}
423 \constfunc{bool
}{HasFontEncoding
}{\void}
425 Returns
\true if the attribute object specifies an encoding.
427 \membersection{wxTextAttr::HasFontFaceName
}\label{wxtextattrhasfontfacename
}
429 \constfunc{bool
}{HasFontFaceName
}{\void}
431 Returns
\true if the attribute object specifies a font face name.
433 \membersection{wxTextAttr::HasFlag
}\label{wxtextattrhasflag
}
435 \constfunc{bool
}{HasFlag
}{\param{long
}{flag
}}
437 Returns
\true if the
{\it flag
} is present in the attribute object's flag bitlist.
439 \membersection{wxTextAttr::HasFont
}\label{wxtextattrhasfont
}
441 \constfunc{bool
}{HasFont
}{\void}
443 Returns
\true if the attribute object specifies any font attributes.
445 \membersection{wxTextAttr::HasFontItalic
}\label{wxtextattrhasfontitalic
}
447 \constfunc{bool
}{HasFontItalic
}{\void}
449 Returns
\true if the attribute object specifies italic style.
451 \membersection{wxTextAttr::HasFontUnderlined
}\label{wxtextattrhasfontunderlined
}
453 \constfunc{bool
}{HasFontUnderlined
}{\void}
455 Returns
\true if the attribute object specifies either underlining or no underlining.
457 \membersection{wxTextAttr::HasURL
}\label{wxtextattrhasurl
}
459 \constfunc{bool
}{HasURL
}{\void}
461 Returns
\true if the attribute object specifies a URL.
463 \membersection{wxTextAttr::HasFontWeight
}\label{wxtextattrhasfontweight
}
465 \constfunc{bool
}{HasFontWeight
}{\void}
467 Returns
\true if the attribute object specifies font weight (bold, light or normal).
469 \membersection{wxTextAttr::HasLeftIndent
}\label{wxtextattrhasleftindent
}
471 \constfunc{bool
}{HasLeftIndent
}{\void}
473 Returns
\true if the attribute object specifies a left indent.
475 \membersection{wxTextAttr::HasLineSpacing
}\label{wxtextattrhaslinespacing
}
477 \constfunc{bool
}{HasLineSpacing
}{\void}
479 Returns
\true if the attribute object specifies line spacing.
481 \membersection{wxTextAttr::HasListStyleName
}\label{wxtextattrhasliststylename
}
483 \constfunc{bool
}{HasListStyleName
}{\void}
485 Returns
\true if the attribute object specifies a list style name.
487 \membersection{wxTextAttr::HasOutlineLevel
}\label{wxtextattrhasoutlinelevel
}
489 \constfunc{bool
}{HasOutlineLevel
}{\void}
491 Returns
\true if the attribute object specifies an outline level.
493 \membersection{wxTextAttr::HasPageBreak
}\label{wxtextattrhaspagebreak
}
495 \constfunc{bool
}{HasPageBreak
}{\void}
497 Returns
\true if the attribute object specifies a page break before this paragraph.
499 \membersection{wxTextAttr::HasParagraphSpacingAfter
}\label{wxtextattrhasparagraphspacingafter
}
501 \constfunc{bool
}{HasParagraphSpacingAfter
}{\void}
503 Returns
\true if the attribute object specifies spacing after a paragraph.
505 \membersection{wxTextAttr::HasParagraphSpacingBefore
}\label{wxtextattrhasparagraphspacingbefore
}
507 \constfunc{bool
}{HasParagraphSpacingBefore
}{\void}
509 Returns
\true if the attribute object specifies spacing before a paragraph.
511 \membersection{wxTextAttr::HasParagraphStyleName
}\label{wxtextattrhasparagraphstylename
}
513 \constfunc{bool
}{HasParagraphStyleName
}{\void}
515 Returns
\true if the attribute object specifies a paragraph style name.
517 \membersection{wxTextAttr::HasRightIndent
}\label{wxtextattrhasrightindent
}
519 \constfunc{bool
}{HasRightIndent
}{\void}
521 Returns
\true if the attribute object specifies a right indent.
523 \membersection{wxTextAttr::HasFontSize
}\label{wxtextattrhasfontsize
}
525 \constfunc{bool
}{HasFontSize
}{\void}
527 Returns
\true if the attribute object specifies a font point size.
529 \membersection{wxTextAttr::HasTabs
}\label{wxtextattrhastabs
}
531 \constfunc{bool
}{HasTabs
}{\void}
533 Returns
\true if the attribute object specifies tab stops.
535 \membersection{wxTextAttr::HasTextColour
}\label{wxtextattrhastextcolour
}
537 \constfunc{bool
}{HasTextColour
}{\void}
539 Returns
\true if the attribute object specifies a text foreground colour.
541 \membersection{wxTextAttr::HasTextEffects
}\label{wxtextattrhastexteffects
}
543 \constfunc{bool
}{HasTextEffects
}{\void}
545 Returns
\true if the attribute object specifies text effects.
547 \membersection{wxTextAttr::IsCharacterStyle
}\label{wxtextattrischaracterstyle
}
549 \constfunc{bool
}{IsCharacterStyle
}{\void}
551 Returns
\true if the object represents a character style, that is,
552 the flags specify a font or a text background or foreground colour.
554 \membersection{wxTextAttr::IsDefault
}\label{wxtextattrisdefault
}
556 \constfunc{bool
}{IsDefault
}{\void}
558 Returns
\false if we have any attributes set,
\true otherwise.
560 \membersection{wxTextAttr::IsParagraphStyle
}\label{wxtextattrisparagraphstyle
}
562 \constfunc{bool
}{IsParagraphStyle
}{\void}
564 Returns
\true if the object represents a paragraph style, that is,
565 the flags specify alignment, indentation, tabs, paragraph spacing, or
568 \membersection{wxTextAttr::Merge
}\label{wxtextattrmerge
}
570 \func{void
}{Merge
}{\param{const wxTextAttr\&
}{ overlay
}}
572 Copies all defined/valid properties from
\arg{overlay
} to current object.
574 \func{static wxTextAttr
}{Merge
}{\param{const wxTextAttr\&
}{ base
},
\param{const wxTextAttr\&
}{ overlay
}}
576 Creates a new
{\tt wxTextAttr
} which is a merge of
\arg{base
} and
577 \arg{overlay
}. Properties defined in
\arg{overlay
} take precedence over those
578 in
\arg{base
}. Properties undefined/invalid in both are undefined in the
582 \membersection{wxTextAttr::SetAlignment
}\label{wxtextattrsetalignment
}
584 \func{void
}{SetAlignment
}{\param{wxTextAttrAlignment
}{alignment
}}
586 Sets the paragraph alignment. These are the possible values for
{\it alignment
}:
590 enum wxTextAttrAlignment
592 wxTEXT_ALIGNMENT_DEFAULT,
593 wxTEXT_ALIGNMENT_LEFT,
594 wxTEXT_ALIGNMENT_CENTRE,
595 wxTEXT_ALIGNMENT_CENTER = wxTEXT_ALIGNMENT_CENTRE,
596 wxTEXT_ALIGNMENT_RIGHT,
597 wxTEXT_ALIGNMENT_JUSTIFIED
602 Of these, wxTEXT
\_ALIGNMENT\_JUSTIFIED is unimplemented. In future justification may be supported
603 when printing or previewing, only.
605 \membersection{wxTextAttr::SetBackgroundColour
}\label{wxtextattrsetbackgroundcolour
}
607 \func{void
}{SetBackgroundColour
}{\param{const wxColour\&
}{colBack
}}
609 Sets the background colour.
611 \membersection{wxTextAttr::SetBulletFont
}\label{wxtextattrsetbulletfont
}
613 \func{void
}{SetBulletFont
}{\param{const wxString\&
}{font
}}
615 Sets the name of the font associated with the bullet symbol.
616 Only valid for attributes with wxTEXT
\_ATTR\_BULLET\_SYMBOL.
618 \membersection{wxTextAttr::SetBulletName
}\label{wxtextattrsetbulletname
}
620 \func{void
}{SetBulletName
}{\param{const wxString\&
}{name
}}
622 Sets the standard bullet name, applicable if the bullet style is wxTEXT
\_ATTR\_BULLET\_STYLE\_STANDARD.
623 See
\helpref{wxTextAttr::GetBulletName
}{wxtextattrgetbulletname
} for a list
624 of supported names, and how to expand the range of supported types.
626 \membersection{wxTextAttr::SetBulletNumber
}\label{wxtextattrsetbulletnumber
}
628 \func{void
}{SetBulletNumber
}{\param{int
}{n
}}
630 Sets the bullet number.
632 \membersection{wxTextAttr::SetBulletStyle
}\label{wxtextattrsetbulletstyle
}
634 \func{void
}{SetBulletStyle
}{\param{int
}{style
}}
636 Sets the bullet style. The following styles can be passed:
640 #define wxTEXT_ATTR_BULLET_STYLE_NONE
0x00000000
641 #define wxTEXT_ATTR_BULLET_STYLE_ARABIC
0x00000001
642 #define wxTEXT_ATTR_BULLET_STYLE_LETTERS_UPPER
0x00000002
643 #define wxTEXT_ATTR_BULLET_STYLE_LETTERS_LOWER
0x00000004
644 #define wxTEXT_ATTR_BULLET_STYLE_ROMAN_UPPER
0x00000008
645 #define wxTEXT_ATTR_BULLET_STYLE_ROMAN_LOWER
0x00000010
646 #define wxTEXT_ATTR_BULLET_STYLE_SYMBOL
0x00000020
647 #define wxTEXT_ATTR_BULLET_STYLE_BITMAP
0x00000040
648 #define wxTEXT_ATTR_BULLET_STYLE_PARENTHESES
0x00000080
649 #define wxTEXT_ATTR_BULLET_STYLE_PERIOD
0x00000100
650 #define wxTEXT_ATTR_BULLET_STYLE_STANDARD
0x00000200
651 #define wxTEXT_ATTR_BULLET_STYLE_RIGHT_PARENTHESIS
0x00000400
652 #define wxTEXT_ATTR_BULLET_STYLE_OUTLINE
0x00000800
653 #define wxTEXT_ATTR_BULLET_STYLE_ALIGN_LEFT
0x00000000
654 #define wxTEXT_ATTR_BULLET_STYLE_ALIGN_RIGHT
0x00001000
655 #define wxTEXT_ATTR_BULLET_STYLE_ALIGN_CENTRE
0x00002000
659 Currently wxTEXT
\_ATTR\_BULLET\_STYLE\_BITMAP is not supported.
661 \membersection{wxTextAttr::SetBulletText
}\label{wxtextattrsetbullettext
}
663 \func{void
}{SetBulletText
}{\param{const wxString&
}{text
}}
665 Sets the bullet text, which could be a symbol, or (for example) cached outline text.
667 \membersection{wxTextAttr::SetCharacterStyleName
}\label{wxtextattrsetcharacterstylename
}
669 \func{void
}{SetCharacterStyleName
}{\param{const wxString\&
}{name
}}
671 Sets the character style name.
673 \membersection{wxTextAttr::SetFlags
}\label{wxtextattrsetflags
}
675 \func{void
}{SetFlags
}{\param{long
}{flags
}}
677 Sets the flags determining which styles are being specified. The following
678 flags can be passed in a bitlist:
682 // Standard wxTextAttr constants
684 #define wxTEXT_ATTR_TEXT_COLOUR
0x00000001
685 #define wxTEXT_ATTR_BACKGROUND_COLOUR
0x00000002
686 #define wxTEXT_ATTR_FONT_FACE
0x00000004
687 #define wxTEXT_ATTR_FONT_SIZE
0x00000008
688 #define wxTEXT_ATTR_FONT_WEIGHT
0x00000010
689 #define wxTEXT_ATTR_FONT_ITALIC
0x00000020
690 #define wxTEXT_ATTR_FONT_UNDERLINE
0x00000040
691 #define wxTEXT_ATTR_FONT \
692 wxTEXT_ATTR_FONT_FACE | wxTEXT_ATTR_FONT_SIZE | wxTEXT_ATTR_FONT_WEIGHT \
693 | wxTEXT_ATTR_FONT_ITALIC | wxTEXT_ATTR_FONT_UNDERLINE
694 #define wxTEXT_ATTR_ALIGNMENT
0x00000080
695 #define wxTEXT_ATTR_LEFT_INDENT
0x00000100
696 #define wxTEXT_ATTR_RIGHT_INDENT
0x00000200
697 #define wxTEXT_ATTR_TABS
0x00000400
699 // Extra formatting flags not in wxTextAttr
701 #define wxTEXT_ATTR_PARA_SPACING_AFTER
0x00000800
702 #define wxTEXT_ATTR_PARA_SPACING_BEFORE
0x00001000
703 #define wxTEXT_ATTR_LINE_SPACING
0x00002000
704 #define wxTEXT_ATTR_CHARACTER_STYLE_NAME
0x00004000
705 #define wxTEXT_ATTR_PARAGRAPH_STYLE_NAME
0x00008000
706 #define wxTEXT_ATTR_LIST_STYLE_NAME
0x00010000
707 #define wxTEXT_ATTR_BULLET_STYLE
0x00020000
708 #define wxTEXT_ATTR_BULLET_NUMBER
0x00040000
709 #define wxTEXT_ATTR_BULLET_TEXT
0x00080000
710 #define wxTEXT_ATTR_BULLET_NAME
0x00100000
711 #define wxTEXT_ATTR_URL
0x00200000
712 #define wxTEXT_ATTR_PAGE_BREAK
0x00400000
713 #define wxTEXT_ATTR_EFFECTS
0x00800000
714 #define wxTEXT_ATTR_OUTLINE_LEVEL
0x01000000
718 \membersection{wxTextAttr::SetFont
}\label{wxtextattrsetfont
}
720 \func{void
}{SetFont
}{\param{const wxFont\&
}{ font
}}
722 Sets the attributes for the given font. Note that wxTextAttr does not store an actual wxFont object.
724 \membersection{wxTextAttr::SetFontEncoding
}\label{wxtextattrsetfontencoding
}
726 \func{void
}{SetFontEncoding
}{\param{wxFontEncoding
}{encoding
}}
728 Sets the font encoding.
730 \membersection{wxTextAttr::SetFontFaceName
}\label{wxtextattrsetfontfacename
}
732 \func{void
}{SetFontFaceName
}{\param{const wxString\&
}{faceName
}}
734 Sets the paragraph alignment.
736 \membersection{wxTextAttr::SetFontSize
}\label{wxtextattrsetfontsize
}
738 \func{void
}{SetFontSize
}{\param{int
}{pointSize
}}
740 Sets the font size in points.
742 \membersection{wxTextAttr::SetFontStyle
}\label{wxtextattrsetfontstyle
}
744 \func{void
}{SetFontStyle
}{\param{int
}{fontStyle
}}
746 Sets the font style (normal, italic or slanted).
748 \membersection{wxTextAttr::SetFontUnderlined
}\label{wxtextattrsetfontunderlined
}
750 \func{void
}{SetFontUnderlined
}{\param{bool
}{underlined
}}
752 Sets the font underlining.
754 \membersection{wxTextAttr::SetFontWeight
}\label{wxtextattrsetfontweight
}
756 \func{void
}{SetFontWeight
}{\param{int
}{fontWeight
}}
758 Sets the font weight.
760 \membersection{wxTextAttr::SetLeftIndent
}\label{wxtextattrsetleftindent
}
762 \func{void
}{SetLeftIndent
}{\param{int
}{indent
},
\param{int
}{subIndent =
0}}
764 Sets the left indent and left subindent in tenths of a millimetre.
766 The sub-indent is an offset from the left of the paragraph, and is used for all but the
767 first line in a paragraph. A positive value will cause the first line to appear to the left
768 of the subsequent lines, and a negative value will cause the first line to be indented
769 relative to the subsequent lines.
771 wxRichTextBuffer uses indentation to render a bulleted item. The left indent is the distance between
772 the margin and the bullet. The content of the paragraph, including the first line, starts
773 at leftMargin + leftSubIndent. So the distance between the left edge of the bullet and the
774 left of the actual paragraph is leftSubIndent.
776 \membersection{wxTextAttr::SetLineSpacing
}\label{wxtextattrsetlinespacing
}
778 \func{void
}{SetLineSpacing
}{\param{int
}{spacing
}}
780 Sets the line spacing.
{\it spacing
} is a multiple, where
10 means single-spacing,
781 15 means
1.5 spacing, and
20 means double spacing. The following constants are
782 defined for convenience:
786 #define wxTEXT_ATTR_LINE_SPACING_NORMAL
10
787 #define wxTEXT_ATTR_LINE_SPACING_HALF
15
788 #define wxTEXT_ATTR_LINE_SPACING_TWICE
20
792 \membersection{wxTextAttr::SetListStyleName
}\label{wxtextattrsetliststylename
}
794 \func{void
}{SetListStyleName
}{\param{const wxString\&
}{name
}}
796 Sets the list style name.
798 \membersection{wxTextAttr::SetOutlineLevel
}\label{wxtextattrsetoutlinelevel
}
800 \func{void
}{SetOutlineLevel
}{\param{int
}{ level
}}
802 Specifies the outline level. Zero represents normal text. At present, the outline level is
803 not used, but may be used in future for determining list levels and for applications
804 that need to store
document structure information.
806 \membersection{wxTextAttr::SetPageBreak
}\label{wxtextattrsetpagebreak
}
808 \func{void
}{SetPageBreak
}{\param{bool
}{ pageBreak = true
}}
810 Specifies a page break before this paragraph.
812 \membersection{wxTextAttr::SetParagraphSpacingAfter
}\label{wxtextattrsetparagraphspacingafter
}
814 \func{void
}{SetParagraphSpacingAfter
}{\param{int
}{spacing
}}
816 Sets the spacing after a paragraph, in tenths of a millimetre.
818 \membersection{wxTextAttr::SetParagraphSpacingBefore
}\label{wxtextattrsetparagraphspacingbefore
}
820 \func{void
}{SetParagraphSpacingBefore
}{\param{int
}{spacing
}}
822 Sets the spacing before a paragraph, in tenths of a millimetre.
824 \membersection{wxTextAttr::SetParagraphStyleName
}\label{wxtextattrsetparagraphstylename
}
826 \func{void
}{SetParagraphStyleName
}{\param{const wxString\&
}{name
}}
828 Sets the name of the paragraph style.
830 \membersection{wxTextAttr::SetRightIndent
}\label{wxtextattrsetrightindent
}
832 \func{void
}{SetRightIndent
}{\param{int
}{indent
}}
834 Sets the right indent in tenths of a millimetre.
836 \membersection{wxTextAttr::SetTabs
}\label{wxtextattrsettabs
}
838 \func{void
}{SetTabs
}{\param{const wxArrayInt\&
}{tabs
}}
840 Sets the tab stops, expressed in tenths of a millimetre.
841 Each stop is measured from the left margin and therefore each value must be larger than the last.
843 \membersection{wxTextAttr::SetTextColour
}\label{wxtextattrsettextcolour
}
845 \func{void
}{SetTextColour
}{\param{const wxColour\&
}{colText
}}
847 Sets the text foreground colout.
849 \membersection{wxTextAttr::SetTextEffectFlags
}\label{wxtextattrsettexteffectflags
}
851 \func{void
}{SetTextEffectFlags
}{\param{int
}{flags
}}
853 Sets the text effect bits of interest. You should also pass wxTEXT
\_ATTR\_EFFECTS to
\helpref{wxTextAttr::SetFlags
}{wxtextattrsetflags
}.
854 See
\helpref{wxTextAttr::SetFlags
}{wxtextattrsetflags
} for further information.
856 \membersection{wxTextAttr::SetTextEffects
}\label{wxtextattrsettexteffects
}
858 \func{void
}{SetTextEffects
}{\param{int
}{effects
}}
860 Sets the text effects, a bit list of styles.
862 The following styles can be passed:
866 #define wxTEXT_ATTR_EFFECT_NONE
0x00000000
867 #define wxTEXT_ATTR_EFFECT_CAPITALS
0x00000001
868 #define wxTEXT_ATTR_EFFECT_SMALL_CAPITALS
0x00000002
869 #define wxTEXT_ATTR_EFFECT_STRIKETHROUGH
0x00000004
870 #define wxTEXT_ATTR_EFFECT_DOUBLE_STRIKETHROUGH
0x00000008
871 #define wxTEXT_ATTR_EFFECT_SHADOW
0x00000010
872 #define wxTEXT_ATTR_EFFECT_EMBOSS
0x00000020
873 #define wxTEXT_ATTR_EFFECT_OUTLINE
0x00000040
874 #define wxTEXT_ATTR_EFFECT_ENGRAVE
0x00000080
875 #define wxTEXT_ATTR_EFFECT_SUPERSCRIPT
0x00000100
876 #define wxTEXT_ATTR_EFFECT_SUBSCRIPT
0x00000200
880 Of these, only wxTEXT
\_ATTR\_EFFECT\_CAPITALS and wxTEXT
\_ATTR\_EFFECT\_STRIKETHROUGH are implemented.
881 wxTEXT
\_ATTR\_EFFECT\_CAPITALS capitalises text when displayed (leaving the case of the actual buffer
882 text unchanged), and wxTEXT
\_ATTR\_EFFECT\_STRIKETHROUGH draws a line through text.
884 To set effects, you should also pass wxTEXT
\_ATTR\_EFFECTS to
\helpref{wxTextAttr::SetFlags
}{wxtextattrsetflags
}, and call
\rtfsp
885 \helpref{wxTextAttr::SetTextEffectFlags
}{wxtextattrsettexteffectflags
} with the styles (taken from the
886 above set) that you are interested in setting.
888 \membersection{wxTextAttr::SetURL
}\label{wxtextattrseturl
}
890 \func{void
}{SetURL
}{\param{const wxString\&
}{url
}}
892 Sets the URL for the content. Sets the wxTEXT
\_ATTR\_URL style; content with this style
893 causes wxRichTextCtrl to show a hand cursor over it, and wxRichTextCtrl generates
894 a wxTextUrlEvent when the content is clicked.
896 \membersection{wxTextAttr::operator=
}\label{wxtextattroperatorassign
}
898 \func{void operator
}{operator=
}{\param{const wxTextAttr\&
}{attr
}}
900 Assignment from a
\helpref{wxTextAttr
}{wxtextattr
} object.