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
84 #define wxTEXT_ATTR_PAGE_BREAK
0x00400000
88 The following styles can be passed to wxRichTextAttr::SetBulletStyle:
92 #define wxTEXT_ATTR_BULLET_STYLE_NONE
0x00000000
93 #define wxTEXT_ATTR_BULLET_STYLE_ARABIC
0x00000001
94 #define wxTEXT_ATTR_BULLET_STYLE_LETTERS_UPPER
0x00000002
95 #define wxTEXT_ATTR_BULLET_STYLE_LETTERS_LOWER
0x00000004
96 #define wxTEXT_ATTR_BULLET_STYLE_ROMAN_UPPER
0x00000008
97 #define wxTEXT_ATTR_BULLET_STYLE_ROMAN_LOWER
0x00000010
98 #define wxTEXT_ATTR_BULLET_STYLE_SYMBOL
0x00000020
99 #define wxTEXT_ATTR_BULLET_STYLE_BITMAP
0x00000040
100 #define wxTEXT_ATTR_BULLET_STYLE_PARENTHESES
0x00000080
101 #define wxTEXT_ATTR_BULLET_STYLE_PERIOD
0x00000100
102 #define wxTEXT_ATTR_BULLET_STYLE_STANDARD
0x00000200
103 #define wxTEXT_ATTR_BULLET_STYLE_RIGHT_PARENTHESIS
0x00000400
104 #define wxTEXT_ATTR_BULLET_STYLE_OUTLINE
0x00000800
105 #define wxTEXT_ATTR_BULLET_STYLE_ALIGN_LEFT
0x00000000
106 #define wxTEXT_ATTR_BULLET_STYLE_ALIGN_RIGHT
0x00001000
107 #define wxTEXT_ATTR_BULLET_STYLE_ALIGN_CENTRE
0x00002000
111 The following constants can be passed to wxRichTextAttr::SetLineSpacing:
115 #define wxTEXT_ATTR_LINE_SPACING_NORMAL
10
116 #define wxTEXT_ATTR_LINE_SPACING_HALF
15
117 #define wxTEXT_ATTR_LINE_SPACING_TWICE
20
123 \helpref{wxTextAttr
}{wxtextattr
},
\helpref{wxRichTextAttr
}{wxrichtextattr
},
\helpref{wxRichTextCtrl
}{wxrichtextctrl
}
125 \latexignore{\rtfignore{\wxheading{Members
}}}
128 \membersection{wxTextAttrEx::wxTextAttrEx
}\label{wxtextattrexwxtextattrex
}
130 \func{}{wxTextAttrEx
}{\void}
133 \func{}{wxTextAttrEx
}{\param{const wxTextAttrEx\&
}{attr
}}
137 \membersection{wxTextAttrEx::GetBulletFont
}\label{wxtextattrexgetbulletfont
}
139 \constfunc{const wxString\&
}{GetBulletFont
}{\void}
141 Returns a string containing the name of the font associated with the bullet symbol.
142 Only valid for attributes with wxTEXT
\_ATTR\_BULLET\_SYMBOL.
144 \membersection{wxTextAttrEx::GetBulletName
}\label{wxtextattrexgetbulletname
}
146 \constfunc{const wxString\&
}{GetBulletName
}{\void}
148 Returns the standard bullet name, applicable if the bullet style is wxTEXT
\_ATTR\_BULLET\_STYLE\_STANDARD.
149 Currently the following standard bullet names are supported:
151 \begin{itemize
}\itemsep=
0pt
152 \item {\tt standard/circle
}
153 \item {\tt standard/square
}
154 \item {\tt standard/diamond
}
155 \item {\tt standard/triangle
}
158 If you wish your application to support further bullet graphics, you can derive a
159 class from wxRichTextRenderer or wxRichTextStdRenderer, override
{\tt DrawStandardBullet
} and
{\tt EnumerateStandardBulletNames
}, and
160 set an instance of the class using
\helpref{wxRichTextBuffer::SetRenderer
}{wxrichtextbuffersetrenderer
}.
162 \membersection{wxTextAttrEx::GetBulletNumber
}\label{wxtextattrexgetbulletnumber
}
164 \constfunc{int
}{GetBulletNumber
}{\void}
166 Returns the bullet number.
168 \membersection{wxTextAttrEx::GetBulletStyle
}\label{wxtextattrexgetbulletstyle
}
170 \constfunc{int
}{GetBulletStyle
}{\void}
172 Returns the bullet style.
173 See
\helpref{wxTextAttrEx::SetBulletStyle
}{wxtextattrexsetbulletstyle
} for a list of available styles.
175 \membersection{wxTextAttrEx::GetBulletText
}\label{wxrichtextattrgetbullettext
}
177 \constfunc{const wxString\&
}{GetBulletText
}{\void}
179 Returns the bullet text, which could be a symbol, or (for example) cached outline text.
181 \membersection{wxTextAttrEx::GetCharacterStyleName
}\label{wxtextattrexgetcharacterstylename
}
183 \constfunc{const wxString\&
}{GetCharacterStyleName
}{\void}
185 Returns the name of the character style.
187 \membersection{wxTextAttrEx::GetLineSpacing
}\label{wxtextattrexgetlinespacing
}
189 \constfunc{int
}{GetLineSpacing
}{\void}
191 Returns the line spacing value, one of wxTEXT
\_ATTR\_LINE\_SPACING\_NORMAL,
192 wxTEXT
\_ATTR\_LINE\_SPACING\_HALF, and wxTEXT
\_ATTR\_LINE\_SPACING\_TWICE.
194 \membersection{wxTextAttrEx::GetListStyleName
}\label{wxtextattrexgetliststylename
}
196 \constfunc{const wxString\&
}{GetListStyleName
}{\void}
198 Returns the name of the list style.
200 \membersection{wxTextAttrEx::GetParagraphSpacingAfter
}\label{wxtextattrexgetparagraphspacingafter
}
202 \constfunc{int
}{GetParagraphSpacingAfter
}{\void}
204 Returns the space in tenths of a millimeter after the paragraph.
206 \membersection{wxTextAttrEx::GetParagraphSpacingBefore
}\label{wxtextattrexgetparagraphspacingbefore
}
208 \constfunc{int
}{GetParagraphSpacingBefore
}{\void}
210 Returns the space in tenths of a millimeter before the paragraph.
212 \membersection{wxTextAttrEx::GetParagraphStyleName
}\label{wxtextattrexgetparagraphstylename
}
214 \constfunc{const wxString\&
}{GetParagraphStyleName
}{\void}
216 Returns the name of the paragraph style.
218 \membersection{wxTextAttrEx::GetURL
}\label{wxtextattrexgeturl
}
220 \constfunc{const wxString\&
}{GetURL
}{\void}
222 Returns the URL for the content. Content with wxTEXT
\_ATTR\_URL style
223 causes wxRichTextCtrl to show a hand cursor over it, and wxRichTextCtrl generates
224 a wxTextUrlEvent when the content is clicked.
226 \membersection{wxTextAttrEx::HasBulletName
}\label{wxtextattrexhasbulletname
}
228 \constfunc{bool
}{HasBulletName
}{\void}
230 Returns
\true if the attribute object specifies a standard bullet name.
232 \membersection{wxTextAttrEx::HasBulletNumber
}\label{wxtextattrexhasbulletnumber
}
234 \constfunc{bool
}{HasBulletNumber
}{\void}
236 Returns
\true if the attribute object specifies a bullet number.
238 \membersection{wxTextAttrEx::HasBulletStyle
}\label{wxtextattrexhasbulletstyle
}
240 \constfunc{bool
}{HasBulletStyle
}{\void}
242 Returns
\true if the attribute object specifies a bullet style.
244 \membersection{wxTextAttrEx::HasBulletText
}\label{wxtextattrexhasbullettext
}
246 \constfunc{bool
}{HasBulletText
}{\void}
248 Returns
\true if the attribute object specifies bullet text (usually containing a symbol).
250 \membersection{wxTextAttrEx::HasCharacterStyleName
}\label{wxtextattrexhascharacterstylename
}
252 \constfunc{bool
}{HasCharacterStyleName
}{\void}
254 Returns
\true if the attribute object specifies a character style name.
256 \membersection{wxTextAttrEx::HasLineSpacing
}\label{wxtextattrexhaslinespacing
}
258 \constfunc{bool
}{HasLineSpacing
}{\void}
260 Returns
\true if the attribute object specifies line spacing.
262 \membersection{wxTextAttrEx::HasListStyleName
}\label{wxtextattrexhasliststylename
}
264 \constfunc{bool
}{HasListStyleName
}{\void}
266 Returns
\true if the attribute object specifies a list style name.
268 \membersection{wxTextAttrEx::HasPageBreak
}\label{wxtextattrexhaspagebreak
}
270 \constfunc{bool
}{HasPageBreak
}{\void}
272 Returns
\true if the attribute object specifies a page break before this paragraph.
274 \membersection{wxTextAttrEx::HasParagraphSpacingAfter
}\label{wxtextattrexhasparagraphspacingafter
}
276 \constfunc{bool
}{HasParagraphSpacingAfter
}{\void}
278 Returns
\true if the attribute object specifies spacing after a paragraph.
280 \membersection{wxTextAttrEx::HasParagraphSpacingBefore
}\label{wxtextattrexhasparagraphspacingbefore
}
282 \constfunc{bool
}{HasParagraphSpacingBefore
}{\void}
284 Returns
\true if the attribute object specifies spacing before a paragraph.
286 \membersection{wxTextAttrEx::HasParagraphStyleName
}\label{wxtextattrexhasparagraphstylename
}
288 \constfunc{bool
}{HasParagraphStyleName
}{\void}
290 Returns
\true if the attribute object specifies a paragraph style name.
292 \membersection{wxTextAttrEx::Init
}\label{wxtextattrexinit
}
294 \func{void
}{Init
}{\void}
296 Initialises this object.
298 \membersection{wxTextAttrEx::IsCharacterStyle
}\label{wxtextattrexischaracterstyle
}
300 \constfunc{bool
}{IsCharacterStyle
}{\void}
302 Returns
\true if the object represents a character style, that is,
303 the flags specify a font or a text background or foreground colour.
305 \membersection{wxTextAttrEx::IsDefault
}\label{wxtextattrexisdefault
}
307 \constfunc{bool
}{IsDefault
}{\void}
309 Returns
\false if we have any attributes set,
\true otherwise.
311 \membersection{wxTextAttrEx::IsParagraphStyle
}\label{wxtextattrexisparagraphstyle
}
313 \constfunc{bool
}{IsParagraphStyle
}{\void}
315 Returns
\true if the object represents a paragraph style, that is,
316 the flags specify alignment, indentation, tabs, paragraph spacing, or
319 \membersection{wxTextAttrEx::SetBulletFont
}\label{wxtextattrexsetbulletfont
}
321 \func{void
}{SetBulletFont
}{\param{const wxString\&
}{font
}}
323 Sets the name of the font associated with the bullet symbol.
324 Only valid for attributes with wxTEXT
\_ATTR\_BULLET\_SYMBOL.
326 \membersection{wxTextAttrEx::SetBulletNumber
}\label{wxtextattrexsetbulletnumber
}
328 \func{void
}{SetBulletNumber
}{\param{int
}{n
}}
330 Sets the bullet number.
332 \membersection{wxTextAttrEx::SetBulletName
}\label{wxtextattrexsetbulletname
}
334 \func{void
}{SetBulletName
}{\param{const wxString\&
}{name
}}
336 Sets the standard bullet name, applicable if the bullet style is wxTEXT
\_ATTR\_BULLET\_STYLE\_STANDARD.
337 See
\helpref{wxTextAttrEx::GetBulletName
}{wxtextattrexgetbulletname
} for a list
338 of supported names, and how to expand the range of supported types.
340 \membersection{wxTextAttrEx::SetBulletStyle
}\label{wxtextattrexsetbulletstyle
}
342 \func{void
}{SetBulletStyle
}{\param{int
}{style
}}
344 Sets the bullet style. The following styles can be passed:
348 #define wxTEXT_ATTR_BULLET_STYLE_NONE
0x00000000
349 #define wxTEXT_ATTR_BULLET_STYLE_ARABIC
0x00000001
350 #define wxTEXT_ATTR_BULLET_STYLE_LETTERS_UPPER
0x00000002
351 #define wxTEXT_ATTR_BULLET_STYLE_LETTERS_LOWER
0x00000004
352 #define wxTEXT_ATTR_BULLET_STYLE_ROMAN_UPPER
0x00000008
353 #define wxTEXT_ATTR_BULLET_STYLE_ROMAN_LOWER
0x00000010
354 #define wxTEXT_ATTR_BULLET_STYLE_SYMBOL
0x00000020
355 #define wxTEXT_ATTR_BULLET_STYLE_BITMAP
0x00000040
356 #define wxTEXT_ATTR_BULLET_STYLE_PARENTHESES
0x00000080
357 #define wxTEXT_ATTR_BULLET_STYLE_PERIOD
0x00000100
358 #define wxTEXT_ATTR_BULLET_STYLE_STANDARD
0x00000200
359 #define wxTEXT_ATTR_BULLET_STYLE_RIGHT_PARENTHESIS
0x00000400
360 #define wxTEXT_ATTR_BULLET_STYLE_OUTLINE
0x00000800
361 #define wxTEXT_ATTR_BULLET_STYLE_ALIGN_LEFT
0x00000000
362 #define wxTEXT_ATTR_BULLET_STYLE_ALIGN_RIGHT
0x00001000
363 #define wxTEXT_ATTR_BULLET_STYLE_ALIGN_CENTRE
0x00002000
367 \membersection{wxTextAttrEx::SetBulletText
}\label{wxtextattrexsetbullettext
}
369 \func{void
}{SetBulletText
}{\param{const wxString\&
}{text
}}
371 Sets the bullet text, which could be a symbol, or (for example) cached outline text.
373 \membersection{wxTextAttrEx::SetCharacterStyleName
}\label{wxtextattrexsetcharacterstylename
}
375 \func{void
}{SetCharacterStyleName
}{\param{const wxString\&
}{name
}}
377 Sets the character style name.
379 \membersection{wxTextAttrEx::SetLineSpacing
}\label{wxtextattrexsetlinespacing
}
381 \func{void
}{SetLineSpacing
}{\param{int
}{spacing
}}
383 Sets the line spacing.
{\it spacing
} is a multiple, where
10 means single-spacing,
384 15 means
1.5 spacing, and
20 means double spacing. The following constants are
385 defined for convenience:
389 #define wxTEXT_ATTR_LINE_SPACING_NORMAL
10
390 #define wxTEXT_ATTR_LINE_SPACING_HALF
15
391 #define wxTEXT_ATTR_LINE_SPACING_TWICE
20
395 \membersection{wxTextAttrEx::SetListStyleName
}\label{wxtextattrexsetliststylename
}
397 \func{void
}{SetListStyleName
}{\param{const wxString\&
}{name
}}
399 Sets the list style name.
401 \membersection{wxTextAttrEx::SetPageBreak
}\label{wxtextattrexsetpagebreak
}
403 \func{void
}{SetPageBreak
}{\param{bool
}{ pageBreak = true
}}
405 Specifies a page break before this paragraph.
407 \membersection{wxTextAttrEx::SetParagraphSpacingAfter
}\label{wxtextattrexsetparagraphspacingafter
}
409 \func{void
}{SetParagraphSpacingAfter
}{\param{int
}{spacing
}}
411 Sets the spacing after a paragraph, in tenths of a millimetre.
413 \membersection{wxTextAttrEx::SetParagraphSpacingBefore
}\label{wxtextattrexsetparagraphspacingbefore
}
415 \func{void
}{SetParagraphSpacingBefore
}{\param{int
}{spacing
}}
417 Sets the spacing before a paragraph, in tenths of a millimetre.
419 \membersection{wxTextAttrEx::SetParagraphStyleName
}\label{wxtextattrexsetparagraphstylename
}
421 \func{void
}{SetParagraphStyleName
}{\param{const wxString\&
}{name
}}
423 Sets the name of the paragraph style.
425 \membersection{wxTextAttrEx::SetURL
}\label{wxtextattrexseturl
}
427 \func{void
}{SetURL
}{\param{const wxString\&
}{url
}}
429 Sets the URL for the content. Sets the wxTEXT
\_ATTR\_URL style; content with this style
430 causes wxRichTextCtrl to show a hand cursor over it, and wxRichTextCtrl generates
431 a wxTextUrlEvent when the content is clicked.
433 \membersection{wxTextAttrEx::operator=
}\label{wxtextattrexoperatorassign
}
435 \func{void operator
}{operator=
}{\param{const wxTextAttr\&
}{attr
}}
437 Assignment from a wxTextAttr object.
439 \func{void operator
}{operator=
}{\param{const wxTextAttrEx\&
}{attr
}}
441 Assignment from a wxTextAttrEx object.