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