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_BULLET_STYLE
0x00010000
79 #define wxTEXT_ATTR_BULLET_NUMBER
0x00020000
80 #define wxTEXT_ATTR_BULLET_SYMBOL
0x00040000
84 The following styles can be passed to wxRichTextAttr::SetBulletStyle:
88 #define wxTEXT_ATTR_BULLET_STYLE_NONE
0x0000
89 #define wxTEXT_ATTR_BULLET_STYLE_ARABIC
0x0001
90 #define wxTEXT_ATTR_BULLET_STYLE_LETTERS_UPPER
0x0002
91 #define wxTEXT_ATTR_BULLET_STYLE_LETTERS_LOWER
0x0004
92 #define wxTEXT_ATTR_BULLET_STYLE_ROMAN_UPPER
0x0008
93 #define wxTEXT_ATTR_BULLET_STYLE_ROMAN_LOWER
0x0010
94 #define wxTEXT_ATTR_BULLET_STYLE_SYMBOL
0x0020
95 #define wxTEXT_ATTR_BULLET_STYLE_BITMAP
0x0040
96 #define wxTEXT_ATTR_BULLET_STYLE_PARENTHESES
0x0080
97 #define wxTEXT_ATTR_BULLET_STYLE_PERIOD
0x0100
101 The following constants can be passed to wxRichTextAttr::SetLineSpacing:
105 #define wxTEXT_ATTR_LINE_SPACING_NORMAL
10
106 #define wxTEXT_ATTR_LINE_SPACING_HALF
15
107 #define wxTEXT_ATTR_LINE_SPACING_TWICE
20
113 \helpref{wxTextAttr
}{wxtextattr
},
\helpref{wxRichTextAttr
}{wxrichtextattr
},
\helpref{wxRichTextCtrl
}{wxrichtextctrl
}
115 \latexignore{\rtfignore{\wxheading{Members
}}}
118 \membersection{wxTextAttrEx::wxTextAttrEx
}\label{wxtextattrexwxtextattrex
}
120 \func{}{wxTextAttrEx
}{\void}
123 \func{}{wxTextAttrEx
}{\param{const wxTextAttrEx\&
}{attr
}}
127 \membersection{wxTextAttrEx::GetBulletFont
}\label{wxtextattrexgetbulletfont
}
129 \constfunc{const wxString\&
}{GetBulletFont
}{\void}
131 Returns a string containing the name of the font associated with the bullet symbol.
132 Only valid for attributes with wxTEXT
\_ATTR\_BULLET\_SYMBOL.
134 \membersection{wxTextAttrEx::GetBulletNumber
}\label{wxtextattrexgetbulletnumber
}
136 \constfunc{int
}{GetBulletNumber
}{\void}
138 Returns the bullet number.
140 \membersection{wxTextAttrEx::GetBulletStyle
}\label{wxtextattrexgetbulletstyle
}
142 \constfunc{int
}{GetBulletStyle
}{\void}
144 Returns the bullet style.
145 See
\helpref{wxTextAttrEx::SetBulletStyle
}{wxtextattrexsetbulletstyle
} for a list of available styles.
147 \membersection{wxTextAttrEx::GetBulletSymbol
}\label{wxtextattrexgetbulletsymbol
}
149 \constfunc{wxChar
}{GetBulletSymbol
}{\void}
151 Returns the bullet symbol, a character.
153 \membersection{wxTextAttrEx::GetCharacterStyleName
}\label{wxtextattrexgetcharacterstylename
}
155 \constfunc{const wxString\&
}{GetCharacterStyleName
}{\void}
157 Returns the name of the character style.
159 \membersection{wxTextAttrEx::GetLineSpacing
}\label{wxtextattrexgetlinespacing
}
161 \constfunc{int
}{GetLineSpacing
}{\void}
163 Returns the line spacing value, one of wxTEXT
\_ATTR\_LINE\_SPACING\_NORMAL,
164 wxTEXT
\_ATTR\_LINE\_SPACING\_HALF, and wxTEXT
\_ATTR\_LINE\_SPACING\_TWICE.
166 \membersection{wxTextAttrEx::GetParagraphSpacingAfter
}\label{wxtextattrexgetparagraphspacingafter
}
168 \constfunc{int
}{GetParagraphSpacingAfter
}{\void}
170 Returns the space in tenths of a millimeter after the paragraph.
172 \membersection{wxTextAttrEx::GetParagraphSpacingBefore
}\label{wxtextattrexgetparagraphspacingbefore
}
174 \constfunc{int
}{GetParagraphSpacingBefore
}{\void}
176 Returns the space in tenths of a millimeter before the paragraph.
178 \membersection{wxTextAttrEx::GetParagraphStyleName
}\label{wxtextattrexgetparagraphstylename
}
180 \constfunc{const wxString\&
}{GetParagraphStyleName
}{\void}
182 Returns the name of the paragraph style.
184 \membersection{wxTextAttrEx::HasBulletNumber
}\label{wxtextattrexhasbulletnumber
}
186 \constfunc{bool
}{HasBulletNumber
}{\void}
188 Returns
\true if the attribute object specifies a bullet number.
190 \membersection{wxTextAttrEx::HasBulletStyle
}\label{wxtextattrexhasbulletstyle
}
192 \constfunc{bool
}{HasBulletStyle
}{\void}
194 Returns
\true if the attribute object specifies a bullet style.
196 \membersection{wxTextAttrEx::HasBulletSymbol
}\label{wxtextattrexhasbulletsymbol
}
198 \constfunc{bool
}{HasBulletSymbol
}{\void}
200 Returns
\true if the attribute object specifies a bullet symbol.
202 \membersection{wxTextAttrEx::HasCharacterStyleName
}\label{wxtextattrexhascharacterstylename
}
204 \constfunc{bool
}{HasCharacterStyleName
}{\void}
206 Returns
\true if the attribute object specifies a character style name.
208 \membersection{wxTextAttrEx::HasLineSpacing
}\label{wxtextattrexhaslinespacing
}
210 \constfunc{bool
}{HasLineSpacing
}{\void}
212 Returns
\true if the attribute object specifies line spacing.
214 \membersection{wxTextAttrEx::HasParagraphSpacingAfter
}\label{wxtextattrexhasparagraphspacingafter
}
216 \constfunc{bool
}{HasParagraphSpacingAfter
}{\void}
218 Returns
\true if the attribute object specifies spacing after a paragraph.
220 \membersection{wxTextAttrEx::HasParagraphSpacingBefore
}\label{wxtextattrexhasparagraphspacingbefore
}
222 \constfunc{bool
}{HasParagraphSpacingBefore
}{\void}
224 Returns
\true if the attribute object specifies spacing before a paragraph.
226 \membersection{wxTextAttrEx::HasParagraphStyleName
}\label{wxtextattrexhasparagraphstylename
}
228 \constfunc{bool
}{HasParagraphStyleName
}{\void}
230 Returns
\true if the attribute object specifies a paragraph style name.
232 \membersection{wxTextAttrEx::Init
}\label{wxtextattrexinit
}
234 \func{void
}{Init
}{\void}
236 Initialises this object.
238 \membersection{wxTextAttrEx::IsCharacterStyle
}\label{wxtextattrexischaracterstyle
}
240 \constfunc{bool
}{IsCharacterStyle
}{\void}
242 Returns
\true if the object represents a character style, that is,
243 the flags specify a font or a text background or foreground colour.
245 \membersection{wxTextAttrEx::IsDefault
}\label{wxtextattrexisdefault
}
247 \constfunc{bool
}{IsDefault
}{\void}
249 Returns
\false if we have any attributes set,
\true otherwise.
251 \membersection{wxTextAttrEx::IsParagraphStyle
}\label{wxtextattrexisparagraphstyle
}
253 \constfunc{bool
}{IsParagraphStyle
}{\void}
255 Returns
\true if the object represents a paragraph style, that is,
256 the flags specify alignment, indentation, tabs, paragraph spacing, or
259 \membersection{wxTextAttrEx::SetBulletFont
}\label{wxtextattrexsetbulletfont
}
261 \func{void
}{SetBulletFont
}{\param{const wxString\&
}{font
}}
263 Sets the name of the font associated with the bullet symbol.
264 Only valid for attributes with wxTEXT
\_ATTR\_BULLET\_SYMBOL.
266 \membersection{wxTextAttrEx::SetBulletNumber
}\label{wxtextattrexsetbulletnumber
}
268 \func{void
}{SetBulletNumber
}{\param{int
}{n
}}
270 Sets the bullet number.
272 \membersection{wxTextAttrEx::SetBulletStyle
}\label{wxtextattrexsetbulletstyle
}
274 \func{void
}{SetBulletStyle
}{\param{int
}{style
}}
276 Sets the bullet style. The following styles can be passed:
280 #define wxTEXT_ATTR_BULLET_STYLE_NONE
0x0000
281 #define wxTEXT_ATTR_BULLET_STYLE_ARABIC
0x0001
282 #define wxTEXT_ATTR_BULLET_STYLE_LETTERS_UPPER
0x0002
283 #define wxTEXT_ATTR_BULLET_STYLE_LETTERS_LOWER
0x0004
284 #define wxTEXT_ATTR_BULLET_STYLE_ROMAN_UPPER
0x0008
285 #define wxTEXT_ATTR_BULLET_STYLE_ROMAN_LOWER
0x0010
286 #define wxTEXT_ATTR_BULLET_STYLE_SYMBOL
0x0020
287 #define wxTEXT_ATTR_BULLET_STYLE_BITMAP
0x0040
288 #define wxTEXT_ATTR_BULLET_STYLE_PARENTHESES
0x0080
289 #define wxTEXT_ATTR_BULLET_STYLE_PERIOD
0x0100
293 \membersection{wxTextAttrEx::SetBulletSymbol
}\label{wxtextattrexsetbulletsymbol
}
295 \func{void
}{SetBulletSymbol
}{\param{wxChar
}{symbol
}}
297 Sets the paragraph symbol.
299 \membersection{wxTextAttrEx::SetCharacterStyleName
}\label{wxtextattrexsetcharacterstylename
}
301 \func{void
}{SetCharacterStyleName
}{\param{const wxString\&
}{name
}}
303 Sets the character style name.
305 \membersection{wxTextAttrEx::SetLineSpacing
}\label{wxtextattrexsetlinespacing
}
307 \func{void
}{SetLineSpacing
}{\param{int
}{spacing
}}
309 Sets the line spacing.
{\it spacing
} is a multiple, where
10 means single-spacing,
310 15 means
1.5 spacing, and
20 means double spacing. The following constants are
311 defined for convenience:
315 #define wxTEXT_ATTR_LINE_SPACING_NORMAL
10
316 #define wxTEXT_ATTR_LINE_SPACING_HALF
15
317 #define wxTEXT_ATTR_LINE_SPACING_TWICE
20
321 \membersection{wxTextAttrEx::SetParagraphSpacingAfter
}\label{wxtextattrexsetparagraphspacingafter
}
323 \func{void
}{SetParagraphSpacingAfter
}{\param{int
}{spacing
}}
325 Sets the spacing after a paragraph, in tenths of a millimetre.
327 \membersection{wxTextAttrEx::SetParagraphSpacingBefore
}\label{wxtextattrexsetparagraphspacingbefore
}
329 \func{void
}{SetParagraphSpacingBefore
}{\param{int
}{spacing
}}
331 Sets the spacing before a paragraph, in tenths of a millimetre.
333 \membersection{wxTextAttrEx::SetParagraphStyleName
}\label{wxtextattrexsetparagraphstylename
}
335 \func{void
}{SetParagraphStyleName
}{\param{const wxString\&
}{name
}}
337 Sets the name of the paragraph style.
339 \membersection{wxTextAttrEx::operator=
}\label{wxtextattrexoperatorassign
}
341 \func{void operator
}{operator=
}{\param{const wxTextAttr\&
}{attr
}}
343 Assignment from a wxTextAttr object.
345 \func{void operator
}{operator=
}{\param{const wxTextAttrEx\&
}{attr
}}
347 Assignment from a wxTextAttrEx object.