Added some missing newlines to ends of files (necessary for linear RTF)
[wxWidgets.git] / docs / latex / wx / textattrex.tex
1 \section{\class{wxTextAttrEx}}\label{wxtextattrex}
2
3 wxTextAttrEx is an extended version of wxTextAttr with more paragraph attributes.
4 Currently it is only used with \helpref{wxRichTextCtrl}{wxrichtextctrl}.
5
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.
12
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.
17
18 This section only documents the additional members; see \helpref{wxTextAttr}{wxtextattr} for
19 the remaining functions.
20
21 \wxheading{Derived from}
22
23 \helpref{wxTextAttr}{wxtextattr}
24
25 \wxheading{Include files}
26
27 <wx/richtext/richtextbuffer.h>
28
29 \wxheading{Constants}
30
31 The following values can be passed to SetAlignment to determine
32 paragraph alignment.
33
34 {\small
35 \begin{verbatim}
36 enum wxTextAttrAlignment
37 {
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
44 };
45 \end{verbatim}
46 }
47
48 These values are passed in a bitlist to SetFlags to determine
49 what attributes will be considered when setting the attributes
50 for a text control.
51
52 {\small
53 \begin{verbatim}
54 // Standard wxTextAttr constants
55
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
70
71 // Extra formatting flags not in wxTextAttr
72
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
81 \end{verbatim}
82 }
83
84 The following styles can be passed to wxRichTextAttr::SetBulletStyle:
85
86 {\small
87 \begin{verbatim}
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
98 \end{verbatim}
99 }
100
101 The following constants can be passed to wxRichTextAttr::SetLineSpacing:
102
103 {\small
104 \begin{verbatim}
105 #define wxTEXT_ATTR_LINE_SPACING_NORMAL 10
106 #define wxTEXT_ATTR_LINE_SPACING_HALF 15
107 #define wxTEXT_ATTR_LINE_SPACING_TWICE 20
108 \end{verbatim}
109 }
110
111 \wxheading{See also}
112
113 \helpref{wxTextAttr}{wxtextattr}, \helpref{wxRichTextAttr}{wxrichtextattr}, \helpref{wxRichTextCtrl}{wxrichtextctrl}
114
115 \latexignore{\rtfignore{\wxheading{Members}}}
116
117
118 \membersection{wxTextAttrEx::wxTextAttrEx}\label{wxtextattrexwxtextattrex}
119
120 \func{}{wxTextAttrEx}{\void}
121
122
123 \func{}{wxTextAttrEx}{\param{const wxTextAttrEx\& }{attr}}
124
125 Constructors.
126
127 \membersection{wxTextAttrEx::GetBulletFont}\label{wxtextattrexgetbulletfont}
128
129 \constfunc{const wxString\&}{GetBulletFont}{\void}
130
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.
133
134 \membersection{wxTextAttrEx::GetBulletNumber}\label{wxtextattrexgetbulletnumber}
135
136 \constfunc{int}{GetBulletNumber}{\void}
137
138 Returns the bullet number.
139
140 \membersection{wxTextAttrEx::GetBulletStyle}\label{wxtextattrexgetbulletstyle}
141
142 \constfunc{int}{GetBulletStyle}{\void}
143
144 Returns the bullet style.
145 See \helpref{wxTextAttrEx::SetBulletStyle}{wxtextattrexsetbulletstyle} for a list of available styles.
146
147 \membersection{wxTextAttrEx::GetBulletSymbol}\label{wxtextattrexgetbulletsymbol}
148
149 \constfunc{wxChar}{GetBulletSymbol}{\void}
150
151 Returns the bullet symbol, a character.
152
153 \membersection{wxTextAttrEx::GetCharacterStyleName}\label{wxtextattrexgetcharacterstylename}
154
155 \constfunc{const wxString\&}{GetCharacterStyleName}{\void}
156
157 Returns the name of the character style.
158
159 \membersection{wxTextAttrEx::GetLineSpacing}\label{wxtextattrexgetlinespacing}
160
161 \constfunc{int}{GetLineSpacing}{\void}
162
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.
165
166 \membersection{wxTextAttrEx::GetParagraphSpacingAfter}\label{wxtextattrexgetparagraphspacingafter}
167
168 \constfunc{int}{GetParagraphSpacingAfter}{\void}
169
170 Returns the space in tenths of a millimeter after the paragraph.
171
172 \membersection{wxTextAttrEx::GetParagraphSpacingBefore}\label{wxtextattrexgetparagraphspacingbefore}
173
174 \constfunc{int}{GetParagraphSpacingBefore}{\void}
175
176 Returns the space in tenths of a millimeter before the paragraph.
177
178 \membersection{wxTextAttrEx::GetParagraphStyleName}\label{wxtextattrexgetparagraphstylename}
179
180 \constfunc{const wxString\&}{GetParagraphStyleName}{\void}
181
182 Returns the name of the paragraph style.
183
184 \membersection{wxTextAttrEx::HasBulletNumber}\label{wxtextattrexhasbulletnumber}
185
186 \constfunc{bool}{HasBulletNumber}{\void}
187
188 Returns \true if the attribute object specifies a bullet number.
189
190 \membersection{wxTextAttrEx::HasBulletStyle}\label{wxtextattrexhasbulletstyle}
191
192 \constfunc{bool}{HasBulletStyle}{\void}
193
194 Returns \true if the attribute object specifies a bullet style.
195
196 \membersection{wxTextAttrEx::HasBulletSymbol}\label{wxtextattrexhasbulletsymbol}
197
198 \constfunc{bool}{HasBulletSymbol}{\void}
199
200 Returns \true if the attribute object specifies a bullet symbol.
201
202 \membersection{wxTextAttrEx::HasCharacterStyleName}\label{wxtextattrexhascharacterstylename}
203
204 \constfunc{bool}{HasCharacterStyleName}{\void}
205
206 Returns \true if the attribute object specifies a character style name.
207
208 \membersection{wxTextAttrEx::HasLineSpacing}\label{wxtextattrexhaslinespacing}
209
210 \constfunc{bool}{HasLineSpacing}{\void}
211
212 Returns \true if the attribute object specifies line spacing.
213
214 \membersection{wxTextAttrEx::HasParagraphSpacingAfter}\label{wxtextattrexhasparagraphspacingafter}
215
216 \constfunc{bool}{HasParagraphSpacingAfter}{\void}
217
218 Returns \true if the attribute object specifies spacing after a paragraph.
219
220 \membersection{wxTextAttrEx::HasParagraphSpacingBefore}\label{wxtextattrexhasparagraphspacingbefore}
221
222 \constfunc{bool}{HasParagraphSpacingBefore}{\void}
223
224 Returns \true if the attribute object specifies spacing before a paragraph.
225
226 \membersection{wxTextAttrEx::HasParagraphStyleName}\label{wxtextattrexhasparagraphstylename}
227
228 \constfunc{bool}{HasParagraphStyleName}{\void}
229
230 Returns \true if the attribute object specifies a paragraph style name.
231
232 \membersection{wxTextAttrEx::Init}\label{wxtextattrexinit}
233
234 \func{void}{Init}{\void}
235
236 Initialises this object.
237
238 \membersection{wxTextAttrEx::IsCharacterStyle}\label{wxtextattrexischaracterstyle}
239
240 \constfunc{bool}{IsCharacterStyle}{\void}
241
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.
244
245 \membersection{wxTextAttrEx::IsDefault}\label{wxtextattrexisdefault}
246
247 \constfunc{bool}{IsDefault}{\void}
248
249 Returns \false if we have any attributes set, \true otherwise.
250
251 \membersection{wxTextAttrEx::IsParagraphStyle}\label{wxtextattrexisparagraphstyle}
252
253 \constfunc{bool}{IsParagraphStyle}{\void}
254
255 Returns \true if the object represents a paragraph style, that is,
256 the flags specify alignment, indentation, tabs, paragraph spacing, or
257 bullet style.
258
259 \membersection{wxTextAttrEx::SetBulletFont}\label{wxtextattrexsetbulletfont}
260
261 \func{void}{SetBulletFont}{\param{const wxString\& }{font}}
262
263 Sets the name of the font associated with the bullet symbol.
264 Only valid for attributes with wxTEXT\_ATTR\_BULLET\_SYMBOL.
265
266 \membersection{wxTextAttrEx::SetBulletNumber}\label{wxtextattrexsetbulletnumber}
267
268 \func{void}{SetBulletNumber}{\param{int }{n}}
269
270 Sets the bullet number.
271
272 \membersection{wxTextAttrEx::SetBulletStyle}\label{wxtextattrexsetbulletstyle}
273
274 \func{void}{SetBulletStyle}{\param{int }{style}}
275
276 Sets the bullet style. The following styles can be passed:
277
278 {\small
279 \begin{verbatim}
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
290 \end{verbatim}
291 }
292
293 \membersection{wxTextAttrEx::SetBulletSymbol}\label{wxtextattrexsetbulletsymbol}
294
295 \func{void}{SetBulletSymbol}{\param{wxChar }{symbol}}
296
297 Sets the paragraph symbol.
298
299 \membersection{wxTextAttrEx::SetCharacterStyleName}\label{wxtextattrexsetcharacterstylename}
300
301 \func{void}{SetCharacterStyleName}{\param{const wxString\& }{name}}
302
303 Sets the character style name.
304
305 \membersection{wxTextAttrEx::SetLineSpacing}\label{wxtextattrexsetlinespacing}
306
307 \func{void}{SetLineSpacing}{\param{int }{spacing}}
308
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:
312
313 {\small
314 \begin{verbatim}
315 #define wxTEXT_ATTR_LINE_SPACING_NORMAL 10
316 #define wxTEXT_ATTR_LINE_SPACING_HALF 15
317 #define wxTEXT_ATTR_LINE_SPACING_TWICE 20
318 \end{verbatim}
319 }
320
321 \membersection{wxTextAttrEx::SetParagraphSpacingAfter}\label{wxtextattrexsetparagraphspacingafter}
322
323 \func{void}{SetParagraphSpacingAfter}{\param{int }{spacing}}
324
325 Sets the spacing after a paragraph, in tenths of a millimetre.
326
327 \membersection{wxTextAttrEx::SetParagraphSpacingBefore}\label{wxtextattrexsetparagraphspacingbefore}
328
329 \func{void}{SetParagraphSpacingBefore}{\param{int }{spacing}}
330
331 Sets the spacing before a paragraph, in tenths of a millimetre.
332
333 \membersection{wxTextAttrEx::SetParagraphStyleName}\label{wxtextattrexsetparagraphstylename}
334
335 \func{void}{SetParagraphStyleName}{\param{const wxString\& }{name}}
336
337 Sets the name of the paragraph style.
338
339 \membersection{wxTextAttrEx::operator=}\label{wxtextattrexoperatorassign}
340
341 \func{void operator}{operator=}{\param{const wxTextAttr\& }{attr}}
342
343 Assignment from a wxTextAttr object.
344
345 \func{void operator}{operator=}{\param{const wxTextAttrEx\& }{attr}}
346
347 Assignment from a wxTextAttrEx object.
348