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::Apply
}\label{wxrichtextattrapply
}
160 \func{bool
}{Combine
}{\param{const wxRichTextAttrEx\&
}{style
},
\param{const wxRichTextAttrEx*
}{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 See also
\helpref{wxRichTextAttr::Combine
}{wxrichtextattrcombine
} for a function that does almost the same but returns a new object instead of modifying the original object.
166 \membersection{wxRichTextAttr::Combine
}\label{wxrichtextattrcombine
}
168 \constfunc{wxRichTextAttr
}{Combine
}{\param{const wxRichTextAttrEx\&
}{style
},
\param{const wxRichTextAttrEx*
}{compareWith = NULL
}}
170 Combines 'this' with
{\it style
}, but not applying attributes from
{\it style
} that are the same as those in
{\it compareWith
} (if passed).
171 A wxRichTextAttr object is returned and the original object is not changed.
173 See also
\helpref{wxRichTextAttr::Apply
}{wxrichtextattrapply
} for a function that does almost the same but modifies the original object instead of returning a new one.
175 \membersection{wxRichTextAttr::CreateFont
}\label{wxrichtextattrcreatefont
}
177 \constfunc{wxFont
}{CreateFont
}{\void}
179 Creates a font from the font attributes.
181 \membersection{wxRichTextAttr::GetAlignment
}\label{wxrichtextattrgetalignment
}
183 \constfunc{wxTextAttrAlignment
}{GetAlignment
}{\void}
185 Returns the alignment flags.
186 See
\helpref{wxRichTextAttr::SetAlignment
}{wxrichtextattrsetalignment
} for a list of available styles.
188 \membersection{wxRichTextAttr::GetBackgroundColour
}\label{wxrichtextattrgetbackgroundcolour
}
190 \constfunc{const wxColour\&
}{GetBackgroundColour
}{\void}
192 Returns the background colour.
194 \membersection{wxRichTextAttr::GetBulletFont
}\label{wxrichtextattrgetbulletfont
}
196 \constfunc{const wxString\&
}{GetBulletFont
}{\void}
198 Returns a string containing the name of the font associated with the bullet symbol.
199 Only valid for attributes with wxTEXT
\_ATTR\_BULLET\_SYMBOL.
201 \membersection{wxRichTextAttr::GetBulletName
}\label{wxrichtextattrgetbulletname
}
203 \constfunc{const wxString\&
}{GetBulletName
}{\void}
205 Returns the standard bullet name, applicable if the bullet style is wxTEXT
\_ATTR\_BULLET\_STYLE\_STANDARD.
206 Currently the following standard bullet names are supported:
208 \begin{itemize
}\itemsep=
0pt
209 \item {\tt standard/circle
}
210 \item {\tt standard/square
}
211 \item {\tt standard/diamond
}
212 \item {\tt standard/triangle
}
215 If you wish your application to support further bullet graphics, you can derive a
216 class from wxRichTextRenderer or wxRichTextStdRenderer, override
{\tt DrawStandardBullet
} and
{\tt EnumerateStandardBulletNames
}, and
217 set an instance of the class using
\helpref{wxRichTextBuffer::SetRenderer
}{wxrichtextbuffersetrenderer
}.
219 \membersection{wxRichTextAttr::GetBulletNumber
}\label{wxrichtextattrgetbulletnumber
}
221 \constfunc{int
}{GetBulletNumber
}{\void}
223 Returns the bullet number.
225 \membersection{wxRichTextAttr::GetBulletStyle
}\label{wxrichtextattrgetbulletstyle
}
227 \constfunc{int
}{GetBulletStyle
}{\void}
229 Returns the bullet style.
230 See
\helpref{wxRichTextAttr::SetBulletStyle
}{wxrichtextattrsetbulletstyle
} for a list of available styles.
232 \membersection{wxRichTextAttr::GetBulletText
}\label{wxrichtextattrgetbullettext
}
234 \constfunc{const wxString\&
}{GetBulletText
}{\void}
236 Returns the bullet text, which could be a symbol, or (for example) cached outline text.
238 \membersection{wxRichTextAttr::GetCharacterStyleName
}\label{wxrichtextattrgetcharacterstylename
}
240 \constfunc{const wxString\&
}{GetCharacterStyleName
}{\void}
242 Returns the name of the character style.
244 \membersection{wxRichTextAttr::GetFlags
}\label{wxrichtextattrgetflags
}
246 \constfunc{long
}{GetFlags
}{\void}
248 Returns flags indicating which attributes are applicable.
249 See
\helpref{wxRichTextAttr::SetFlags
}{wxrichtextattrsetflags
} for a list of available flags.
251 \membersection{wxRichTextAttr::GetFontAttributes
}\label{wxrichtextattrgetfontattributes
}
253 \func{bool
}{GetFontAttributes
}{\param{const wxFont\&
}{font
}}
255 Sets the font attributes from the given font.
257 \membersection{wxRichTextAttr::GetFontFaceName
}\label{wxrichtextattrgetfontfacename
}
259 \constfunc{const wxString\&
}{GetFontFaceName
}{\void}
261 Returns the font face name.
263 \membersection{wxRichTextAttr::GetFontSize
}\label{wxrichtextattrgetfontsize
}
265 \constfunc{int
}{GetFontSize
}{\void}
267 Returns the font size in points.
269 \membersection{wxRichTextAttr::GetFontStyle
}\label{wxrichtextattrgetfontstyle
}
271 \constfunc{int
}{GetFontStyle
}{\void}
273 Returns the font style.
275 \membersection{wxRichTextAttr::GetFontUnderlined
}\label{wxrichtextattrgetfontunderlined
}
277 \constfunc{bool
}{GetFontUnderlined
}{\void}
279 Returns
\true if the font is underlined.
281 \membersection{wxRichTextAttr::GetFontWeight
}\label{wxrichtextattrgetfontweight
}
283 \constfunc{int
}{GetFontWeight
}{\void}
285 Returns the font weight.
287 \membersection{wxRichTextAttr::GetLeftIndent
}\label{wxrichtextattrgetleftindent
}
289 \constfunc{long
}{GetLeftIndent
}{\void}
291 Returns the left indent in tenths of a millimetre.
293 \membersection{wxRichTextAttr::GetLeftSubIndent
}\label{wxrichtextattrgetleftsubindent
}
295 \constfunc{long
}{GetLeftSubIndent
}{\void}
297 Returns the left sub-indent in tenths of a millimetre.
299 \membersection{wxRichTextAttr::GetLineSpacing
}\label{wxrichtextattrgetlinespacing
}
301 \constfunc{int
}{GetLineSpacing
}{\void}
303 Returns the line spacing value, one of wxTEXT
\_ATTR\_LINE\_SPACING\_NORMAL,
304 wxTEXT
\_ATTR\_LINE\_SPACING\_HALF, and wxTEXT
\_ATTR\_LINE\_SPACING\_TWICE.
306 \membersection{wxRichTextAttr::GetListStyleName
}\label{wxrichtextattrgetliststylename
}
308 \constfunc{const wxString\&
}{GetListStyleName
}{\void}
310 Returns the name of the list style.
312 \membersection{wxRichTextAttr::GetOutlineLevel
}\label{wxrichtextattrgetoutlinelevel
}
314 \constfunc{bool
}{GetOutlineLevel
}{\void}
316 Returns the outline level.
318 \membersection{wxRichTextAttr::GetParagraphSpacingAfter
}\label{wxrichtextattrgetparagraphspacingafter
}
320 \constfunc{int
}{GetParagraphSpacingAfter
}{\void}
322 Returns the space in tenths of a millimeter after the paragraph.
324 \membersection{wxRichTextAttr::GetParagraphSpacingBefore
}\label{wxrichtextattrgetparagraphspacingbefore
}
326 \constfunc{int
}{GetParagraphSpacingBefore
}{\void}
328 Returns the space in tenths of a millimeter before the paragraph.
330 \membersection{wxRichTextAttr::GetParagraphStyleName
}\label{wxrichtextattrgetparagraphstylename
}
332 \constfunc{const wxString\&
}{GetParagraphStyleName
}{\void}
334 Returns the name of the paragraph style.
336 \membersection{wxRichTextAttr::GetRightIndent
}\label{wxrichtextattrgetrightindent
}
338 \constfunc{long
}{GetRightIndent
}{\void}
340 Returns the right indent in tenths of a millimeter.
342 \membersection{wxRichTextAttr::GetTabs
}\label{wxrichtextattrgettabs
}
344 \constfunc{const wxArrayInt\&
}{GetTabs
}{\void}
346 Returns an array of tab stops, each expressed in tenths of a millimeter. Each stop
347 is measured from the left margin and therefore each value must be larger than the last.
349 \membersection{wxRichTextAttr::GetTextColour
}\label{wxrichtextattrgettextcolour
}
351 \constfunc{const wxColour\&
}{GetTextColour
}{\void}
353 Returns the text foreground colour.
355 \membersection{wxRichTextAttr::GetTextEffectFlags
}\label{wxrichtextattrgettexteffectflags
}
357 \constfunc{int
}{GetTextEffectFlags
}{\void}
359 Returns the text effect bits of interest. See
\helpref{wxRichTextAttr::SetFlags
}{wxrichtextattrsetflags
} for further information.
361 \membersection{wxRichTextAttr::GetTextEffects
}\label{wxrichtextattrgettexteffects
}
363 \constfunc{int
}{GetTextEffects
}{\void}
365 Returns the text effects, a bit list of styles. See
\helpref{wxRichTextAttr::SetTextEffects
}{wxrichtextattrsettexteffects
} for
368 \membersection{wxRichTextAttr::GetURL
}\label{wxrichtextattrgeturl
}
370 \constfunc{const wxString\&
}{GetURL
}{\void}
372 Returns the URL for the content. Content with wxTEXT
\_ATTR\_URL style
373 causes wxRichTextCtrl to show a hand cursor over it, and wxRichTextCtrl generates
374 a wxTextUrlEvent when the content is clicked.
376 \membersection{wxRichTextAttr::HasAlignment
}\label{wxrichtextattrhasalignment
}
378 \constfunc{bool
}{HasAlignment
}{\void}
380 Returns
\true if the attribute object specifies alignment.
382 \membersection{wxRichTextAttr::HasBackgroundColour
}\label{wxrichtextattrhasbackgroundcolour
}
384 \constfunc{bool
}{HasBackgroundColour
}{\void}
386 Returns
\true if the attribute object specifies a background colour.
388 \membersection{wxRichTextAttr::HasBulletName
}\label{wxrichtextattrhasbulletname
}
390 \constfunc{bool
}{HasBulletName
}{\void}
392 Returns
\true if the attribute object specifies a standard bullet name.
394 \membersection{wxRichTextAttr::HasBulletNumber
}\label{wxrichtextattrhasbulletnumber
}
396 \constfunc{bool
}{HasBulletNumber
}{\void}
398 Returns
\true if the attribute object specifies a bullet number.
400 \membersection{wxRichTextAttr::HasBulletStyle
}\label{wxrichtextattrhasbulletstyle
}
402 \constfunc{bool
}{HasBulletStyle
}{\void}
404 Returns
\true if the attribute object specifies a bullet style.
406 \membersection{wxRichTextAttr::HasBulletText
}\label{wxrichtextattrhasbullettext
}
408 \constfunc{bool
}{HasBulletText
}{\void}
410 Returns
\true if the attribute object specifies bullet text (usually specifying a symbol).
412 \membersection{wxRichTextAttr::HasCharacterStyleName
}\label{wxrichtextattrhascharacterstylename
}
414 \constfunc{bool
}{HasCharacterStyleName
}{\void}
416 Returns
\true if the attribute object specifies a character style name.
418 \membersection{wxRichTextAttr::HasFontFaceName
}\label{wxrichtextattrhasfontfacename
}
420 \constfunc{bool
}{HasFontFaceName
}{\void}
422 Returns
\true if the attribute object specifies a font face name.
424 \membersection{wxRichTextAttr::HasFlag
}\label{wxrichtextattrhasflag
}
426 \constfunc{bool
}{HasFlag
}{\param{long
}{flag
}}
428 Returns
\true if the
{\it flag
} is present in the attribute object's flag bitlist.
430 \membersection{wxRichTextAttr::HasFont
}\label{wxrichtextattrhasfont
}
432 \constfunc{bool
}{HasFont
}{\void}
434 Returns
\true if the attribute object specifies any font attributes.
436 \membersection{wxRichTextAttr::HasFontItalic
}\label{wxrichtextattrhasfontitalic
}
438 \constfunc{bool
}{HasFontItalic
}{\void}
440 Returns
\true if the attribute object specifies italic style.
442 \membersection{wxRichTextAttr::HasLeftIndent
}\label{wxrichtextattrhasleftindent
}
444 \constfunc{bool
}{HasLeftIndent
}{\void}
446 Returns
\true if the attribute object specifies a left indent.
448 \membersection{wxRichTextAttr::HasLineSpacing
}\label{wxrichtextattrhaslinespacing
}
450 \constfunc{bool
}{HasLineSpacing
}{\void}
452 Returns
\true if the attribute object specifies line spacing.
454 \membersection{wxRichTextAttr::HasListStyleName
}\label{wxrichtextattrhasliststylename
}
456 \constfunc{bool
}{HasListStyleName
}{\void}
458 Returns
\true if the attribute object specifies a list style name.
460 \membersection{wxRichTextAttr::HasOutlineLevel
}\label{wxrichtextattrhasoutlinelevel
}
462 \constfunc{bool
}{HasOutlineLevel
}{\void}
464 Returns
\true if the attribute object specifies an outline level.
466 \membersection{wxRichTextAttr::HasPageBreak
}\label{wxrichtextattrhaspagebreak
}
468 \constfunc{bool
}{HasPageBreak
}{\void}
470 Returns
\true if the attribute object specifies a page break before this paragraph.
472 \membersection{wxRichTextAttr::HasParagraphSpacingAfter
}\label{wxrichtextattrhasparagraphspacingafter
}
474 \constfunc{bool
}{HasParagraphSpacingAfter
}{\void}
476 Returns
\true if the attribute object specifies spacing after a paragraph.
478 \membersection{wxRichTextAttr::HasParagraphSpacingBefore
}\label{wxrichtextattrhasparagraphspacingbefore
}
480 \constfunc{bool
}{HasParagraphSpacingBefore
}{\void}
482 Returns
\true if the attribute object specifies spacing before a paragraph.
484 \membersection{wxRichTextAttr::HasParagraphStyleName
}\label{wxrichtextattrhasparagraphstylename
}
486 \constfunc{bool
}{HasParagraphStyleName
}{\void}
488 Returns
\true if the attribute object specifies a paragraph style name.
490 \membersection{wxRichTextAttr::HasRightIndent
}\label{wxrichtextattrhasrightindent
}
492 \constfunc{bool
}{HasRightIndent
}{\void}
494 Returns
\true if the attribute object specifies a right indent.
496 \membersection{wxRichTextAttr::HasFontSize
}\label{wxrichtextattrhasfontsize
}
498 \constfunc{bool
}{HasFontSize
}{\void}
500 Returns
\true if the attribute object specifies a font point size.
502 \membersection{wxRichTextAttr::HasTabs
}\label{wxrichtextattrhastabs
}
504 \constfunc{bool
}{HasTabs
}{\void}
506 Returns
\true if the attribute object specifies tab stops.
508 \membersection{wxRichTextAttr::HasTextColour
}\label{wxrichtextattrhastextcolour
}
510 \constfunc{bool
}{HasTextColour
}{\void}
512 Returns
\true if the attribute object specifies a text foreground colour.
514 \membersection{wxRichTextAttr::HasTextEffects
}\label{wxrichtextattrhastexteffects
}
516 \constfunc{bool
}{HasTextEffects
}{\void}
518 Returns
\true if the attribute object specifies text effects.
520 \membersection{wxRichTextAttr::HasFontUnderlined
}\label{wxrichtextattrhasfontunderlined
}
522 \constfunc{bool
}{HasFontUnderlined
}{\void}
524 Returns
\true if the attribute object specifies either underlining or no underlining.
526 \membersection{wxRichTextAttr::HasURL
}\label{wxrichtextattrhasurl
}
528 \constfunc{bool
}{HasURL
}{\void}
530 Returns
\true if the attribute object specifies a URL.
532 \membersection{wxRichTextAttr::HasFontWeight
}\label{wxrichtextattrhasfontweight
}
534 \constfunc{bool
}{HasFontWeight
}{\void}
536 Returns
\true if the attribute object specifies font weight (bold, light or normal).
538 \membersection{wxRichTextAttr::IsCharacterStyle
}\label{wxrichtextattrischaracterstyle
}
540 \constfunc{bool
}{IsCharacterStyle
}{\void}
542 Returns
\true if the object represents a character style, that is,
543 the flags specify a font or a text background or foreground colour.
545 \membersection{wxRichTextAttr::IsDefault
}\label{wxrichtextattrisdefault
}
547 \constfunc{bool
}{IsDefault
}{\void}
549 Returns
\false if we have any attributes set,
\true otherwise.
551 \membersection{wxRichTextAttr::IsParagraphStyle
}\label{wxrichtextattrisparagraphstyle
}
553 \constfunc{bool
}{IsParagraphStyle
}{\void}
555 Returns
\true if the object represents a paragraph style, that is,
556 the flags specify alignment, indentation, tabs, paragraph spacing, or
559 \membersection{wxRichTextAttr::SetAlignment
}\label{wxrichtextattrsetalignment
}
561 \func{void
}{SetAlignment
}{\param{wxTextAttrAlignment
}{alignment
}}
563 Sets the paragraph alignment. These are the possible values for
{\it alignment
}:
567 enum wxTextAttrAlignment
569 wxTEXT_ALIGNMENT_DEFAULT,
570 wxTEXT_ALIGNMENT_LEFT,
571 wxTEXT_ALIGNMENT_CENTRE,
572 wxTEXT_ALIGNMENT_CENTER = wxTEXT_ALIGNMENT_CENTRE,
573 wxTEXT_ALIGNMENT_RIGHT,
574 wxTEXT_ALIGNMENT_JUSTIFIED
579 Of these, wxTEXT
\_ALIGNMENT\_JUSTIFIED is unimplemented. In future justification may be supported
580 when printing or previewing, only.
582 \membersection{wxRichTextAttr::SetBackgroundColour
}\label{wxrichtextattrsetbackgroundcolour
}
584 \func{void
}{SetBackgroundColour
}{\param{const wxColour\&
}{colBack
}}
586 Sets the background colour.
588 \membersection{wxRichTextAttr::SetBulletFont
}\label{wxrichtextattrsetbulletfont
}
590 \func{void
}{SetBulletFont
}{\param{const wxString\&
}{font
}}
592 Sets the name of the font associated with the bullet symbol.
593 Only valid for attributes with wxTEXT
\_ATTR\_BULLET\_SYMBOL.
595 \membersection{wxRichTextAttr::SetBulletName
}\label{wxrichtextattrsetbulletname
}
597 \func{void
}{SetBulletName
}{\param{const wxString\&
}{name
}}
599 Sets the standard bullet name, applicable if the bullet style is wxTEXT
\_ATTR\_BULLET\_STYLE\_STANDARD.
600 See
\helpref{wxRichTextAttr::GetBulletName
}{wxrichtextattrgetbulletname
} for a list
601 of supported names, and how to expand the range of supported types.
603 \membersection{wxRichTextAttr::SetBulletNumber
}\label{wxrichtextattrsetbulletnumber
}
605 \func{void
}{SetBulletNumber
}{\param{int
}{n
}}
607 Sets the bullet number.
609 \membersection{wxRichTextAttr::SetBulletStyle
}\label{wxrichtextattrsetbulletstyle
}
611 \func{void
}{SetBulletStyle
}{\param{int
}{style
}}
613 Sets the bullet style. The following styles can be passed:
617 #define wxTEXT_ATTR_BULLET_STYLE_NONE
0x00000000
618 #define wxTEXT_ATTR_BULLET_STYLE_ARABIC
0x00000001
619 #define wxTEXT_ATTR_BULLET_STYLE_LETTERS_UPPER
0x00000002
620 #define wxTEXT_ATTR_BULLET_STYLE_LETTERS_LOWER
0x00000004
621 #define wxTEXT_ATTR_BULLET_STYLE_ROMAN_UPPER
0x00000008
622 #define wxTEXT_ATTR_BULLET_STYLE_ROMAN_LOWER
0x00000010
623 #define wxTEXT_ATTR_BULLET_STYLE_SYMBOL
0x00000020
624 #define wxTEXT_ATTR_BULLET_STYLE_BITMAP
0x00000040
625 #define wxTEXT_ATTR_BULLET_STYLE_PARENTHESES
0x00000080
626 #define wxTEXT_ATTR_BULLET_STYLE_PERIOD
0x00000100
627 #define wxTEXT_ATTR_BULLET_STYLE_STANDARD
0x00000200
628 #define wxTEXT_ATTR_BULLET_STYLE_RIGHT_PARENTHESIS
0x00000400
629 #define wxTEXT_ATTR_BULLET_STYLE_OUTLINE
0x00000800
630 #define wxTEXT_ATTR_BULLET_STYLE_ALIGN_LEFT
0x00000000
631 #define wxTEXT_ATTR_BULLET_STYLE_ALIGN_RIGHT
0x00001000
632 #define wxTEXT_ATTR_BULLET_STYLE_ALIGN_CENTRE
0x00002000
636 Currently wxTEXT
\_ATTR\_BULLET\_STYLE\_BITMAP is not supported.
638 \membersection{wxRichTextAttr::SetBulletText
}\label{wxrichtextattrsetbullettext
}
640 \func{void
}{SetBulletText
}{\param{const wxString&
}{text
}}
642 Sets the bullet text, which could be a symbol, or (for example) cached outline text.
644 \membersection{wxRichTextAttr::SetCharacterStyleName
}\label{wxrichtextattrsetcharacterstylename
}
646 \func{void
}{SetCharacterStyleName
}{\param{const wxString\&
}{name
}}
648 Sets the character style name.
650 \membersection{wxRichTextAttr::SetFlags
}\label{wxrichtextattrsetflags
}
652 \func{void
}{SetFlags
}{\param{long
}{flags
}}
654 Sets the flags determining which styles are being specified. The following
655 flags can be passed in a bitlist:
659 // Standard wxTextAttr constants
661 #define wxTEXT_ATTR_TEXT_COLOUR
0x00000001
662 #define wxTEXT_ATTR_BACKGROUND_COLOUR
0x00000002
663 #define wxTEXT_ATTR_FONT_FACE
0x00000004
664 #define wxTEXT_ATTR_FONT_SIZE
0x00000008
665 #define wxTEXT_ATTR_FONT_WEIGHT
0x00000010
666 #define wxTEXT_ATTR_FONT_ITALIC
0x00000020
667 #define wxTEXT_ATTR_FONT_UNDERLINE
0x00000040
668 #define wxTEXT_ATTR_FONT \
669 wxTEXT_ATTR_FONT_FACE | wxTEXT_ATTR_FONT_SIZE | wxTEXT_ATTR_FONT_WEIGHT \
670 | wxTEXT_ATTR_FONT_ITALIC | wxTEXT_ATTR_FONT_UNDERLINE
671 #define wxTEXT_ATTR_ALIGNMENT
0x00000080
672 #define wxTEXT_ATTR_LEFT_INDENT
0x00000100
673 #define wxTEXT_ATTR_RIGHT_INDENT
0x00000200
674 #define wxTEXT_ATTR_TABS
0x00000400
676 // Extra formatting flags not in wxTextAttr
678 #define wxTEXT_ATTR_PARA_SPACING_AFTER
0x00000800
679 #define wxTEXT_ATTR_PARA_SPACING_BEFORE
0x00001000
680 #define wxTEXT_ATTR_LINE_SPACING
0x00002000
681 #define wxTEXT_ATTR_CHARACTER_STYLE_NAME
0x00004000
682 #define wxTEXT_ATTR_PARAGRAPH_STYLE_NAME
0x00008000
683 #define wxTEXT_ATTR_LIST_STYLE_NAME
0x00010000
684 #define wxTEXT_ATTR_BULLET_STYLE
0x00020000
685 #define wxTEXT_ATTR_BULLET_NUMBER
0x00040000
686 #define wxTEXT_ATTR_BULLET_TEXT
0x00080000
687 #define wxTEXT_ATTR_BULLET_NAME
0x00100000
688 #define wxTEXT_ATTR_URL
0x00200000
689 #define wxTEXT_ATTR_PAGE_BREAK
0x00400000
690 #define wxTEXT_ATTR_EFFECTS
0x00800000
691 #define wxTEXT_ATTR_OUTLINE_LEVEL
0x01000000
695 \membersection{wxRichTextAttr::SetFontFaceName
}\label{wxrichtextattrsetfontfacename
}
697 \func{void
}{SetFontFaceName
}{\param{const wxString\&
}{faceName
}}
699 Sets the paragraph alignment.
701 \membersection{wxRichTextAttr::SetFontSize
}\label{wxrichtextattrsetfontsize
}
703 \func{void
}{SetFontSize
}{\param{int
}{pointSize
}}
705 Sets the font size in points.
707 \membersection{wxRichTextAttr::SetFontStyle
}\label{wxrichtextattrsetfontstyle
}
709 \func{void
}{SetFontStyle
}{\param{int
}{fontStyle
}}
711 Sets the font style (normal, italic or slanted).
713 \membersection{wxRichTextAttr::SetFontUnderlined
}\label{wxrichtextattrsetfontunderlined
}
715 \func{void
}{SetFontUnderlined
}{\param{bool
}{underlined
}}
717 Sets the font underlining.
719 \membersection{wxRichTextAttr::SetFontWeight
}\label{wxrichtextattrsetfontweight
}
721 \func{void
}{SetFontWeight
}{\param{int
}{fontWeight
}}
723 Sets the font weight.
725 \membersection{wxRichTextAttr::SetLeftIndent
}\label{wxrichtextattrsetleftindent
}
727 \func{void
}{SetLeftIndent
}{\param{int
}{indent
},
\param{int
}{subIndent =
0}}
729 Sets the left indent and left subindent in tenths of a millimetre.
731 The sub-indent is an offset from the left of the paragraph, and is used for all but the
732 first line in a paragraph. A positive value will cause the first line to appear to the left
733 of the subsequent lines, and a negative value will cause the first line to be indented
734 relative to the subsequent lines.
736 wxRichTextBuffer uses indentation to render a bulleted item. The left indent is the distance between
737 the margin and the bullet. The content of the paragraph, including the first line, starts
738 at leftMargin + leftSubIndent. So the distance between the left edge of the bullet and the
739 left of the actual paragraph is leftSubIndent.
741 \membersection{wxRichTextAttr::SetLineSpacing
}\label{wxrichtextattrsetlinespacing
}
743 \func{void
}{SetLineSpacing
}{\param{int
}{spacing
}}
745 Sets the line spacing.
{\it spacing
} is a multiple, where
10 means single-spacing,
746 15 means
1.5 spacing, and
20 means double spacing. The following constants are
747 defined for convenience:
751 #define wxTEXT_ATTR_LINE_SPACING_NORMAL
10
752 #define wxTEXT_ATTR_LINE_SPACING_HALF
15
753 #define wxTEXT_ATTR_LINE_SPACING_TWICE
20
757 \membersection{wxRichTextAttr::SetListStyleName
}\label{wxrichtextattrsetliststylename
}
759 \func{void
}{SetListStyleName
}{\param{const wxString\&
}{name
}}
761 Sets the list style name.
763 \membersection{wxRichTextAttr::SetOutlineLevel
}\label{wxrichtextattrsetoutlinelevel
}
765 \func{void
}{SetOutlineLevel
}{\param{int
}{ level
}}
767 Specifies the outline level. Zero represents normal text. At present, the outline level is
768 not used, but may be used in future for determining list levels and for applications
769 that need to store
document structure information.
771 \membersection{wxRichTextAttr::SetPageBreak
}\label{wxrichtextattrsetpagebreak
}
773 \func{void
}{SetPageBreak
}{\param{bool
}{ pageBreak = true
}}
775 Specifies a page break before this paragraph.
777 \membersection{wxRichTextAttr::SetParagraphSpacingAfter
}\label{wxrichtextattrsetparagraphspacingafter
}
779 \func{void
}{SetParagraphSpacingAfter
}{\param{int
}{spacing
}}
781 Sets the spacing after a paragraph, in tenths of a millimetre.
783 \membersection{wxRichTextAttr::SetParagraphSpacingBefore
}\label{wxrichtextattrsetparagraphspacingbefore
}
785 \func{void
}{SetParagraphSpacingBefore
}{\param{int
}{spacing
}}
787 Sets the spacing before a paragraph, in tenths of a millimetre.
789 \membersection{wxRichTextAttr::SetParagraphStyleName
}\label{wxrichtextattrsetparagraphstylename
}
791 \func{void
}{SetParagraphStyleName
}{\param{const wxString\&
}{name
}}
793 Sets the name of the paragraph style.
795 \membersection{wxRichTextAttr::SetRightIndent
}\label{wxrichtextattrsetrightindent
}
797 \func{void
}{SetRightIndent
}{\param{int
}{indent
}}
799 Sets the right indent in tenths of a millimetre.
801 \membersection{wxRichTextAttr::SetTabs
}\label{wxrichtextattrsettabs
}
803 \func{void
}{SetTabs
}{\param{const wxArrayInt\&
}{tabs
}}
805 Sets the tab stops, expressed in tenths of a millimetre.
806 Each stop is measured from the left margin and therefore each value must be larger than the last.
808 \membersection{wxRichTextAttr::SetTextColour
}\label{wxrichtextattrsettextcolour
}
810 \func{void
}{SetTextColour
}{\param{const wxColour\&
}{colText
}}
812 Sets the text foreground colout.
814 \membersection{wxRichTextAttr::SetTextEffectFlags
}\label{wxrichtextattrsettexteffectflags
}
816 \func{void
}{SetTextEffectFlags
}{\param{int
}{flags
}}
818 Sets the text effect bits of interest. You should also pass wxTEXT
\_ATTR\_EFFECTS to
\helpref{wxRichTextAttr::SetFlags
}{wxrichtextattrsetflags
}.
819 See
\helpref{wxRichTextAttr::SetFlags
}{wxrichtextattrsetflags
} for further information.
821 \membersection{wxRichTextAttr::SetTextEffects
}\label{wxrichtextattrsettexteffects
}
823 \func{void
}{SetTextEffects
}{\param{int
}{effects
}}
825 Sets the text effects, a bit list of styles.
827 The following styles can be passed:
831 #define wxTEXT_ATTR_EFFECT_NONE
0x00000000
832 #define wxTEXT_ATTR_EFFECT_CAPITALS
0x00000001
833 #define wxTEXT_ATTR_EFFECT_SMALL_CAPITALS
0x00000002
834 #define wxTEXT_ATTR_EFFECT_STRIKETHROUGH
0x00000004
835 #define wxTEXT_ATTR_EFFECT_DOUBLE_STRIKETHROUGH
0x00000008
836 #define wxTEXT_ATTR_EFFECT_SHADOW
0x00000010
837 #define wxTEXT_ATTR_EFFECT_EMBOSS
0x00000020
838 #define wxTEXT_ATTR_EFFECT_OUTLINE
0x00000040
839 #define wxTEXT_ATTR_EFFECT_ENGRAVE
0x00000080
840 #define wxTEXT_ATTR_EFFECT_SUPERSCRIPT
0x00000100
841 #define wxTEXT_ATTR_EFFECT_SUBSCRIPT
0x00000200
845 Of these, only wxTEXT
\_ATTR\_EFFECT\_CAPITALS and wxTEXT
\_ATTR\_EFFECT\_STRIKETHROUGH are implemented.
846 wxTEXT
\_ATTR\_EFFECT\_CAPITALS capitalises text when displayed (leaving the case of the actual buffer
847 text unchanged), and wxTEXT
\_ATTR\_EFFECT\_STRIKETHROUGH draws a line through text.
849 To set effects, you should also pass wxTEXT
\_ATTR\_EFFECTS to
\helpref{wxRichTextAttr::SetFlags
}{wxrichtextattrsetflags
}, and call
\rtfsp
850 \helpref{wxRichTextAttr::SetTextEffectFlags
}{wxrichtextattrsettexteffectflags
} with the styles (taken from the
851 above set) that you are interested in setting.
853 \membersection{wxRichTextAttr::SetURL
}\label{wxrichtextattrseturl
}
855 \func{void
}{SetURL
}{\param{const wxString\&
}{url
}}
857 Sets the URL for the content. Sets the wxTEXT
\_ATTR\_URL style; content with this style
858 causes wxRichTextCtrl to show a hand cursor over it, and wxRichTextCtrl generates
859 a wxTextUrlEvent when the content is clicked.
861 \membersection{wxRichTextAttr::operator=
}\label{wxrichtextattroperatorassign
}
863 \func{void operator
}{operator=
}{\param{const wxTextAttrEx\&
}{attr
}}
865 Assignment from a
\helpref{wxTextAttrEx
}{wxtextattr
} object.
867 \func{void operator
}{operator=
}{\param{const wxRichTextAttr\&
}{attr
}}
869 Assignment from a
\helpref{wxRichTextAttr
}{wxrichtextattr
} object.
871 \membersection{wxRichTextAttr::wxTextAttrEx
}\label{wxrichtextattrwxtextattrex
}
873 \constfunc{operator
}{wxTextAttrEx
}{\void}
875 Makes a
\helpref{wxTextAttrEx
}{wxtextattrex
} object from this object.