1 \section{\class{wxTextAttrEx
}}\label{wxtextattrex
}
3 wxTextAttrEx is an extended version of wxTextAttr with more paragraph attributes.
4 Currently it is only used with
\helpref{wxRichTextCtrl
}{wxrichtextctrl
}.
6 It is intended that eventually, the members of wxTextAttrEx will
7 be folded into wxTextAttr, and wxTextAttr will be the official
8 cross-platform API for text controls that support attributes.
9 However, for now, wxTextAttrEx is provided as a means of enabling
10 extra functionality in wxRichTextCtrl, while retaining some compatibility
11 with the wxTextAttr API.
13 The most efficient method of accessing wxRichTextCtrl functionality
14 is a third attribute class,
\helpref{wxRichTextAttr
}{wxrichtextattr
}, which
15 optimizes its storage to allow it to be used for implementing objects
16 in a buffer, as well as access to that buffer.
18 This section only documents the additional members; see
\helpref{wxTextAttr
}{wxtextattr
} for
19 the remaining functions.
21 \wxheading{Derived from
}
23 \helpref{wxTextAttr
}{wxtextattr
}
25 \wxheading{Include files
}
27 <wx/richtext/richtextbuffer.h>
31 The following values can be passed to SetAlignment to determine
36 enum wxTextAttrAlignment
38 wxTEXT_ALIGNMENT_DEFAULT,
39 wxTEXT_ALIGNMENT_LEFT,
40 wxTEXT_ALIGNMENT_CENTRE,
41 wxTEXT_ALIGNMENT_CENTER = wxTEXT_ALIGNMENT_CENTRE,
42 wxTEXT_ALIGNMENT_RIGHT,
43 wxTEXT_ALIGNMENT_JUSTIFIED
48 These values are passed in a bitlist to SetFlags to determine
49 what attributes will be considered when setting the attributes
54 // Standard wxTextAttr constants
56 #define wxTEXT_ATTR_TEXT_COLOUR
0x0001
57 #define wxTEXT_ATTR_BACKGROUND_COLOUR
0x0002
58 #define wxTEXT_ATTR_FONT_FACE
0x0004
59 #define wxTEXT_ATTR_FONT_SIZE
0x0008
60 #define wxTEXT_ATTR_FONT_WEIGHT
0x0010
61 #define wxTEXT_ATTR_FONT_ITALIC
0x0020
62 #define wxTEXT_ATTR_FONT_UNDERLINE
0x0040
63 #define wxTEXT_ATTR_FONT \
64 wxTEXT_ATTR_FONT_FACE | wxTEXT_ATTR_FONT_SIZE | wxTEXT_ATTR_FONT_WEIGHT \
65 | wxTEXT_ATTR_FONT_ITALIC | wxTEXT_ATTR_FONT_UNDERLINE
66 #define wxTEXT_ATTR_ALIGNMENT
0x0080
67 #define wxTEXT_ATTR_LEFT_INDENT
0x0100
68 #define wxTEXT_ATTR_RIGHT_INDENT
0x0200
69 #define wxTEXT_ATTR_TABS
0x0400
71 // Extra formatting flags not in wxTextAttr
73 #define wxTEXT_ATTR_PARA_SPACING_AFTER
0x00000800
74 #define wxTEXT_ATTR_PARA_SPACING_BEFORE
0x00001000
75 #define wxTEXT_ATTR_LINE_SPACING
0x00002000
76 #define wxTEXT_ATTR_CHARACTER_STYLE_NAME
0x00004000
77 #define wxTEXT_ATTR_PARAGRAPH_STYLE_NAME
0x00008000
78 #define wxTEXT_ATTR_LIST_STYLE_NAME
0x00010000
79 #define wxTEXT_ATTR_BULLET_STYLE
0x00020000
80 #define wxTEXT_ATTR_BULLET_NUMBER
0x00040000
81 #define wxTEXT_ATTR_BULLET_TEXT
0x00080000
82 #define wxTEXT_ATTR_BULLET_NAME
0x00100000
83 #define wxTEXT_ATTR_URL
0x00200000
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 The following constants can be passed to wxRichTextAttr::SetLineSpacing:
114 #define wxTEXT_ATTR_LINE_SPACING_NORMAL
10
115 #define wxTEXT_ATTR_LINE_SPACING_HALF
15
116 #define wxTEXT_ATTR_LINE_SPACING_TWICE
20
122 \helpref{wxTextAttr
}{wxtextattr
},
\helpref{wxRichTextAttr
}{wxrichtextattr
},
\helpref{wxRichTextCtrl
}{wxrichtextctrl
}
124 \latexignore{\rtfignore{\wxheading{Members
}}}
127 \membersection{wxTextAttrEx::wxTextAttrEx
}\label{wxtextattrexwxtextattrex
}
129 \func{}{wxTextAttrEx
}{\void}
132 \func{}{wxTextAttrEx
}{\param{const wxTextAttrEx\&
}{attr
}}
136 \membersection{wxTextAttrEx::GetBulletFont
}\label{wxtextattrexgetbulletfont
}
138 \constfunc{const wxString\&
}{GetBulletFont
}{\void}
140 Returns a string containing the name of the font associated with the bullet symbol.
141 Only valid for attributes with wxTEXT
\_ATTR\_BULLET\_SYMBOL.
143 \membersection{wxTextAttrEx::GetBulletName
}\label{wxtextattrexgetbulletname
}
145 \constfunc{const wxString\&
}{GetBulletName
}{\void}
147 Returns the standard bullet name, applicable if the bullet style is wxTEXT
\_ATTR\_BULLET\_STYLE\_STANDARD.
148 Currently the following standard bullet names are supported:
150 \begin{itemize
}\itemsep=
0pt
151 \item {\tt standard/circle
}
152 \item {\tt standard/square
}
153 \item {\tt standard/diamond
}
154 \item {\tt standard/triangle
}
157 If you wish your application to support further bullet graphics, you can derive a
158 class from wxRichTextRenderer or wxRichTextStdRenderer, override
{\tt DrawStandardBullet
} and
{\tt EnumerateStandardBulletNames
}, and
159 set an instance of the class using
\helpref{wxRichTextBuffer::SetRenderer
}{wxrichtextbuffersetrenderer
}.
161 \membersection{wxTextAttrEx::GetBulletNumber
}\label{wxtextattrexgetbulletnumber
}
163 \constfunc{int
}{GetBulletNumber
}{\void}
165 Returns the bullet number.
167 \membersection{wxTextAttrEx::GetBulletStyle
}\label{wxtextattrexgetbulletstyle
}
169 \constfunc{int
}{GetBulletStyle
}{\void}
171 Returns the bullet style.
172 See
\helpref{wxTextAttrEx::SetBulletStyle
}{wxtextattrexsetbulletstyle
} for a list of available styles.
174 \membersection{wxTextAttrEx::GetBulletText
}\label{wxrichtextattrgetbullettext
}
176 \constfunc{const wxString\&
}{GetBulletText
}{\void}
178 Returns the bullet text, which could be a symbol, or (for example) cached outline text.
180 \membersection{wxTextAttrEx::GetCharacterStyleName
}\label{wxtextattrexgetcharacterstylename
}
182 \constfunc{const wxString\&
}{GetCharacterStyleName
}{\void}
184 Returns the name of the character style.
186 \membersection{wxTextAttrEx::GetLineSpacing
}\label{wxtextattrexgetlinespacing
}
188 \constfunc{int
}{GetLineSpacing
}{\void}
190 Returns the line spacing value, one of wxTEXT
\_ATTR\_LINE\_SPACING\_NORMAL,
191 wxTEXT
\_ATTR\_LINE\_SPACING\_HALF, and wxTEXT
\_ATTR\_LINE\_SPACING\_TWICE.
193 \membersection{wxTextAttrEx::GetListStyleName
}\label{wxtextattrexgetliststylename
}
195 \constfunc{const wxString\&
}{GetListStyleName
}{\void}
197 Returns the name of the list style.
199 \membersection{wxTextAttrEx::GetParagraphSpacingAfter
}\label{wxtextattrexgetparagraphspacingafter
}
201 \constfunc{int
}{GetParagraphSpacingAfter
}{\void}
203 Returns the space in tenths of a millimeter after the paragraph.
205 \membersection{wxTextAttrEx::GetParagraphSpacingBefore
}\label{wxtextattrexgetparagraphspacingbefore
}
207 \constfunc{int
}{GetParagraphSpacingBefore
}{\void}
209 Returns the space in tenths of a millimeter before the paragraph.
211 \membersection{wxTextAttrEx::GetParagraphStyleName
}\label{wxtextattrexgetparagraphstylename
}
213 \constfunc{const wxString\&
}{GetParagraphStyleName
}{\void}
215 Returns the name of the paragraph style.
217 \membersection{wxTextAttrEx::GetURL
}\label{wxtextattrexgeturl
}
219 \constfunc{const wxString\&
}{GetURL
}{\void}
221 Returns the URL for the content. Content with wxTEXT
\_ATTR\_URL style
222 causes wxRichTextCtrl to show a hand cursor over it, and wxRichTextCtrl generates
223 a wxTextUrlEvent when the content is clicked.
225 \membersection{wxTextAttrEx::HasBulletName
}\label{wxtextattrexhasbulletname
}
227 \constfunc{bool
}{HasBulletName
}{\void}
229 Returns
\true if the attribute object specifies a standard bullet name.
231 \membersection{wxTextAttrEx::HasBulletNumber
}\label{wxtextattrexhasbulletnumber
}
233 \constfunc{bool
}{HasBulletNumber
}{\void}
235 Returns
\true if the attribute object specifies a bullet number.
237 \membersection{wxTextAttrEx::HasBulletStyle
}\label{wxtextattrexhasbulletstyle
}
239 \constfunc{bool
}{HasBulletStyle
}{\void}
241 Returns
\true if the attribute object specifies a bullet style.
243 \membersection{wxTextAttrEx::HasBulletText
}\label{wxtextattrexhasbullettext
}
245 \constfunc{bool
}{HasBulletText
}{\void}
247 Returns
\true if the attribute object specifies bullet text (usually containing a symbol).
249 \membersection{wxTextAttrEx::HasCharacterStyleName
}\label{wxtextattrexhascharacterstylename
}
251 \constfunc{bool
}{HasCharacterStyleName
}{\void}
253 Returns
\true if the attribute object specifies a character style name.
255 \membersection{wxTextAttrEx::HasLineSpacing
}\label{wxtextattrexhaslinespacing
}
257 \constfunc{bool
}{HasLineSpacing
}{\void}
259 Returns
\true if the attribute object specifies line spacing.
261 \membersection{wxTextAttrEx::HasListStyleName
}\label{wxtextattrexhasliststylename
}
263 \constfunc{bool
}{HasListStyleName
}{\void}
265 Returns
\true if the attribute object specifies a list style name.
267 \membersection{wxTextAttrEx::HasParagraphSpacingAfter
}\label{wxtextattrexhasparagraphspacingafter
}
269 \constfunc{bool
}{HasParagraphSpacingAfter
}{\void}
271 Returns
\true if the attribute object specifies spacing after a paragraph.
273 \membersection{wxTextAttrEx::HasParagraphSpacingBefore
}\label{wxtextattrexhasparagraphspacingbefore
}
275 \constfunc{bool
}{HasParagraphSpacingBefore
}{\void}
277 Returns
\true if the attribute object specifies spacing before a paragraph.
279 \membersection{wxTextAttrEx::HasParagraphStyleName
}\label{wxtextattrexhasparagraphstylename
}
281 \constfunc{bool
}{HasParagraphStyleName
}{\void}
283 Returns
\true if the attribute object specifies a paragraph style name.
285 \membersection{wxTextAttrEx::Init
}\label{wxtextattrexinit
}
287 \func{void
}{Init
}{\void}
289 Initialises this object.
291 \membersection{wxTextAttrEx::IsCharacterStyle
}\label{wxtextattrexischaracterstyle
}
293 \constfunc{bool
}{IsCharacterStyle
}{\void}
295 Returns
\true if the object represents a character style, that is,
296 the flags specify a font or a text background or foreground colour.
298 \membersection{wxTextAttrEx::IsDefault
}\label{wxtextattrexisdefault
}
300 \constfunc{bool
}{IsDefault
}{\void}
302 Returns
\false if we have any attributes set,
\true otherwise.
304 \membersection{wxTextAttrEx::IsParagraphStyle
}\label{wxtextattrexisparagraphstyle
}
306 \constfunc{bool
}{IsParagraphStyle
}{\void}
308 Returns
\true if the object represents a paragraph style, that is,
309 the flags specify alignment, indentation, tabs, paragraph spacing, or
312 \membersection{wxTextAttrEx::SetBulletFont
}\label{wxtextattrexsetbulletfont
}
314 \func{void
}{SetBulletFont
}{\param{const wxString\&
}{font
}}
316 Sets the name of the font associated with the bullet symbol.
317 Only valid for attributes with wxTEXT
\_ATTR\_BULLET\_SYMBOL.
319 \membersection{wxTextAttrEx::SetBulletNumber
}\label{wxtextattrexsetbulletnumber
}
321 \func{void
}{SetBulletNumber
}{\param{int
}{n
}}
323 Sets the bullet number.
325 \membersection{wxTextAttrEx::SetBulletName
}\label{wxtextattrexsetbulletname
}
327 \func{void
}{SetBulletName
}{\param{const wxString\&
}{name
}}
329 Sets the standard bullet name, applicable if the bullet style is wxTEXT
\_ATTR\_BULLET\_STYLE\_STANDARD.
330 See
\helpref{wxTextAttrEx::GetBulletName
}{wxtextattrexgetbulletname
} for a list
331 of supported names, and how to expand the range of supported types.
333 \membersection{wxTextAttrEx::SetBulletStyle
}\label{wxtextattrexsetbulletstyle
}
335 \func{void
}{SetBulletStyle
}{\param{int
}{style
}}
337 Sets the bullet style. The following styles can be passed:
341 #define wxTEXT_ATTR_BULLET_STYLE_NONE
0x00000000
342 #define wxTEXT_ATTR_BULLET_STYLE_ARABIC
0x00000001
343 #define wxTEXT_ATTR_BULLET_STYLE_LETTERS_UPPER
0x00000002
344 #define wxTEXT_ATTR_BULLET_STYLE_LETTERS_LOWER
0x00000004
345 #define wxTEXT_ATTR_BULLET_STYLE_ROMAN_UPPER
0x00000008
346 #define wxTEXT_ATTR_BULLET_STYLE_ROMAN_LOWER
0x00000010
347 #define wxTEXT_ATTR_BULLET_STYLE_SYMBOL
0x00000020
348 #define wxTEXT_ATTR_BULLET_STYLE_BITMAP
0x00000040
349 #define wxTEXT_ATTR_BULLET_STYLE_PARENTHESES
0x00000080
350 #define wxTEXT_ATTR_BULLET_STYLE_PERIOD
0x00000100
351 #define wxTEXT_ATTR_BULLET_STYLE_STANDARD
0x00000200
352 #define wxTEXT_ATTR_BULLET_STYLE_RIGHT_PARENTHESIS
0x00000400
353 #define wxTEXT_ATTR_BULLET_STYLE_OUTLINE
0x00000800
354 #define wxTEXT_ATTR_BULLET_STYLE_ALIGN_LEFT
0x00000000
355 #define wxTEXT_ATTR_BULLET_STYLE_ALIGN_RIGHT
0x00001000
356 #define wxTEXT_ATTR_BULLET_STYLE_ALIGN_CENTRE
0x00002000
360 \membersection{wxTextAttrEx::SetBulletText
}\label{wxtextattrexsetbullettext
}
362 \func{void
}{SetBulletText
}{\param{const wxString\&
}{text
}}
364 Sets the bullet text, which could be a symbol, or (for example) cached outline text.
366 \membersection{wxTextAttrEx::SetCharacterStyleName
}\label{wxtextattrexsetcharacterstylename
}
368 \func{void
}{SetCharacterStyleName
}{\param{const wxString\&
}{name
}}
370 Sets the character style name.
372 \membersection{wxTextAttrEx::SetLineSpacing
}\label{wxtextattrexsetlinespacing
}
374 \func{void
}{SetLineSpacing
}{\param{int
}{spacing
}}
376 Sets the line spacing.
{\it spacing
} is a multiple, where
10 means single-spacing,
377 15 means
1.5 spacing, and
20 means double spacing. The following constants are
378 defined for convenience:
382 #define wxTEXT_ATTR_LINE_SPACING_NORMAL
10
383 #define wxTEXT_ATTR_LINE_SPACING_HALF
15
384 #define wxTEXT_ATTR_LINE_SPACING_TWICE
20
388 \membersection{wxTextAttrEx::SetListStyleName
}\label{wxtextattrexsetliststylename
}
390 \func{void
}{SetListStyleName
}{\param{const wxString\&
}{name
}}
392 Sets the list style name.
394 \membersection{wxTextAttrEx::SetParagraphSpacingAfter
}\label{wxtextattrexsetparagraphspacingafter
}
396 \func{void
}{SetParagraphSpacingAfter
}{\param{int
}{spacing
}}
398 Sets the spacing after a paragraph, in tenths of a millimetre.
400 \membersection{wxTextAttrEx::SetParagraphSpacingBefore
}\label{wxtextattrexsetparagraphspacingbefore
}
402 \func{void
}{SetParagraphSpacingBefore
}{\param{int
}{spacing
}}
404 Sets the spacing before a paragraph, in tenths of a millimetre.
406 \membersection{wxTextAttrEx::SetParagraphStyleName
}\label{wxtextattrexsetparagraphstylename
}
408 \func{void
}{SetParagraphStyleName
}{\param{const wxString\&
}{name
}}
410 Sets the name of the paragraph style.
412 \membersection{wxTextAttrEx::SetURL
}\label{wxtextattrexseturl
}
414 \func{void
}{SetURL
}{\param{const wxString\&
}{url
}}
416 Sets the URL for the content. Sets the wxTEXT
\_ATTR\_URL style; content with this style
417 causes wxRichTextCtrl to show a hand cursor over it, and wxRichTextCtrl generates
418 a wxTextUrlEvent when the content is clicked.
420 \membersection{wxTextAttrEx::operator=
}\label{wxtextattrexoperatorassign
}
422 \func{void operator
}{operator=
}{\param{const wxTextAttr\&
}{attr
}}
424 Assignment from a wxTextAttr object.
426 \func{void operator
}{operator=
}{\param{const wxTextAttrEx\&
}{attr
}}
428 Assignment from a wxTextAttrEx object.