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::GetBulletNumber
}\label{wxtextattrexgetbulletnumber
}
129 \constfunc{int
}{GetBulletNumber
}{\void}
131 Returns the bullet number.
133 \membersection{wxTextAttrEx::GetBulletStyle
}\label{wxtextattrexgetbulletstyle
}
135 \constfunc{int
}{GetBulletStyle
}{\void}
137 Returns the bullet style.
138 See
\helpref{wxTextAttrEx::SetBulletStyle
}{wxtextattrexsetbulletstyle
} for a list of available styles.
140 \membersection{wxTextAttrEx::GetBulletSymbol
}\label{wxtextattrexgetbulletsymbol
}
142 \constfunc{wxChar
}{GetBulletSymbol
}{\void}
144 Returns the bullet symbol, a character.
146 \membersection{wxTextAttrEx::GetCharacterStyleName
}\label{wxtextattrexgetcharacterstylename
}
148 \constfunc{const wxString\&
}{GetCharacterStyleName
}{\void}
150 Returns the name of the character style.
152 \membersection{wxTextAttrEx::GetLineSpacing
}\label{wxtextattrexgetlinespacing
}
154 \constfunc{int
}{GetLineSpacing
}{\void}
156 Returns the line spacing value, one of wxTEXT
\_ATTR\_LINE\_SPACING\_NORMAL,
157 wxTEXT
\_ATTR\_LINE\_SPACING\_HALF, and wxTEXT
\_ATTR\_LINE\_SPACING\_TWICE.
159 \membersection{wxTextAttrEx::GetParagraphSpacingAfter
}\label{wxtextattrexgetparagraphspacingafter
}
161 \constfunc{int
}{GetParagraphSpacingAfter
}{\void}
163 Returns the space in tenths of a millimeter after the paragraph.
165 \membersection{wxTextAttrEx::GetParagraphSpacingBefore
}\label{wxtextattrexgetparagraphspacingbefore
}
167 \constfunc{int
}{GetParagraphSpacingBefore
}{\void}
169 Returns the space in tenths of a millimeter before the paragraph.
171 \membersection{wxTextAttrEx::GetParagraphStyleName
}\label{wxtextattrexgetparagraphstylename
}
173 \constfunc{const wxString\&
}{GetParagraphStyleName
}{\void}
175 Returns the name of the paragraph style.
177 \membersection{wxTextAttrEx::HasBulletNumber
}\label{wxtextattrexhasbulletnumber
}
179 \constfunc{bool
}{HasBulletNumber
}{\void}
181 Returns
\true if the attribute object specifies a bullet number.
183 \membersection{wxTextAttrEx::HasBulletStyle
}\label{wxtextattrexhasbulletstyle
}
185 \constfunc{bool
}{HasBulletStyle
}{\void}
187 Returns
\true if the attribute object specifies a bullet style.
189 \membersection{wxTextAttrEx::HasBulletSymbol
}\label{wxtextattrexhasbulletsymbol
}
191 \constfunc{bool
}{HasBulletSymbol
}{\void}
193 Returns
\true if the attribute object specifies a bullet symbol.
195 \membersection{wxTextAttrEx::HasCharacterStyleName
}\label{wxtextattrexhascharacterstylename
}
197 \constfunc{bool
}{HasCharacterStyleName
}{\void}
199 Returns
\true if the attribute object specifies a character style name.
201 \membersection{wxTextAttrEx::HasLineSpacing
}\label{wxtextattrexhaslinespacing
}
203 \constfunc{bool
}{HasLineSpacing
}{\void}
205 Returns
\true if the attribute object specifies line spacing.
207 \membersection{wxTextAttrEx::HasParagraphSpacingAfter
}\label{wxtextattrexhasparagraphspacingafter
}
209 \constfunc{bool
}{HasParagraphSpacingAfter
}{\void}
211 Returns
\true if the attribute object specifies spacing after a paragraph.
213 \membersection{wxTextAttrEx::HasParagraphSpacingBefore
}\label{wxtextattrexhasparagraphspacingbefore
}
215 \constfunc{bool
}{HasParagraphSpacingBefore
}{\void}
217 Returns
\true if the attribute object specifies spacing before a paragraph.
219 \membersection{wxTextAttrEx::HasParagraphStyleName
}\label{wxtextattrexhasparagraphstylename
}
221 \constfunc{bool
}{HasParagraphStyleName
}{\void}
223 Returns
\true if the attribute object specifies a paragraph style name.
225 \membersection{wxTextAttrEx::Init
}\label{wxtextattrexinit
}
227 \func{void
}{Init
}{\void}
229 Initialises this object.
231 \membersection{wxTextAttrEx::IsCharacterStyle
}\label{wxtextattrexischaracterstyle
}
233 \constfunc{bool
}{IsCharacterStyle
}{\void}
235 Returns
\true if the object represents a character style, that is,
236 the flags specify a font or a text background or foreground colour.
238 \membersection{wxTextAttrEx::IsDefault
}\label{wxtextattrexisdefault
}
240 \constfunc{bool
}{IsDefault
}{\void}
242 Returns
\false if we have any attributes set,
\true otherwise.
244 \membersection{wxTextAttrEx::IsParagraphStyle
}\label{wxtextattrexisparagraphstyle
}
246 \constfunc{bool
}{IsParagraphStyle
}{\void}
248 Returns
\true if the object represents a paragraph style, that is,
249 the flags specify alignment, indentation, tabs, paragraph spacing, or
252 \membersection{wxTextAttrEx::SetBulletNumber
}\label{wxtextattrexsetbulletnumber
}
254 \func{void
}{SetBulletNumber
}{\param{int
}{n
}}
256 Sets the bullet number.
258 \membersection{wxTextAttrEx::SetBulletStyle
}\label{wxtextattrexsetbulletstyle
}
260 \func{void
}{SetBulletStyle
}{\param{int
}{style
}}
262 Sets the bullet style. The following styles can be passed:
266 #define wxTEXT_ATTR_BULLET_STYLE_NONE
0x0000
267 #define wxTEXT_ATTR_BULLET_STYLE_ARABIC
0x0001
268 #define wxTEXT_ATTR_BULLET_STYLE_LETTERS_UPPER
0x0002
269 #define wxTEXT_ATTR_BULLET_STYLE_LETTERS_LOWER
0x0004
270 #define wxTEXT_ATTR_BULLET_STYLE_ROMAN_UPPER
0x0008
271 #define wxTEXT_ATTR_BULLET_STYLE_ROMAN_LOWER
0x0010
272 #define wxTEXT_ATTR_BULLET_STYLE_SYMBOL
0x0020
273 #define wxTEXT_ATTR_BULLET_STYLE_BITMAP
0x0040
274 #define wxTEXT_ATTR_BULLET_STYLE_PARENTHESES
0x0080
275 #define wxTEXT_ATTR_BULLET_STYLE_PERIOD
0x0100
279 \membersection{wxTextAttrEx::SetBulletSymbol
}\label{wxtextattrexsetbulletsymbol
}
281 \func{void
}{SetBulletSymbol
}{\param{wxChar
}{symbol
}}
283 Sets the paragraph symbol.
285 \membersection{wxTextAttrEx::SetCharacterStyleName
}\label{wxtextattrexsetcharacterstylename
}
287 \func{void
}{SetCharacterStyleName
}{\param{const wxString\&
}{name
}}
289 Sets the character style name.
291 \membersection{wxTextAttrEx::SetLineSpacing
}\label{wxtextattrexsetlinespacing
}
293 \func{void
}{SetLineSpacing
}{\param{int
}{spacing
}}
295 Sets the line spacing.
{\it spacing
} is a multiple, where
10 means single-spacing,
296 15 means
1.5 spacing, and
20 means double spacing. The following constants are
297 defined for convenience:
301 #define wxTEXT_ATTR_LINE_SPACING_NORMAL
10
302 #define wxTEXT_ATTR_LINE_SPACING_HALF
15
303 #define wxTEXT_ATTR_LINE_SPACING_TWICE
20
307 \membersection{wxTextAttrEx::SetParagraphSpacingAfter
}\label{wxtextattrexsetparagraphspacingafter
}
309 \func{void
}{SetParagraphSpacingAfter
}{\param{int
}{spacing
}}
311 Sets the spacing after a paragraph, in tenths of a millimetre.
313 \membersection{wxTextAttrEx::SetParagraphSpacingBefore
}\label{wxtextattrexsetparagraphspacingbefore
}
315 \func{void
}{SetParagraphSpacingBefore
}{\param{int
}{spacing
}}
317 Sets the spacing before a paragraph, in tenths of a millimetre.
319 \membersection{wxTextAttrEx::SetParagraphStyleName
}\label{wxtextattrexsetparagraphstylename
}
321 \func{void
}{SetParagraphStyleName
}{\param{const wxString\&
}{name
}}
323 Sets the name of the paragraph style.
325 \membersection{wxTextAttrEx::operator=
}\label{wxtextattrexoperatorassign
}
327 \func{void operator
}{operator=
}{\param{const wxTextAttr\&
}{attr
}}
329 Assignment from a wxTextAttr object.
331 \func{void operator
}{operator=
}{\param{const wxTextAttrEx\&
}{attr
}}
333 Assignment from a wxTextAttrEx object.