]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/textattr.tex
documentation for window ids allocation and wxIdManager (patch 1870570)
[wxWidgets.git] / docs / latex / wx / textattr.tex
CommitLineData
5f35b46a
JS
1\section{\class{wxTextAttr}}\label{wxtextattr}
2
44cc96a8
JS
3wxTextAttr represents the character and paragraph attributes, or style,
4for a range of text in a \helpref{wxTextCtrl}{wxtextctrl} or \helpref{wxRichTextCtrl}{wxrichtextctrl}.
5f35b46a 5
44cc96a8
JS
6When setting up a wxTextAttr object, pass a bitlist mask to \helpref{SetFlags}{wxtextattrsetflags} to
7indicate which style elements should be changed. As a convenience, when you call a setter such
8as SetFont, the relevant bit will be set.
5f35b46a
JS
9
10\wxheading{Derived from}
11
12No base class
13
14\wxheading{Include files}
15
16<wx/textctrl.h>
17
a7af285d
VZ
18\wxheading{Library}
19
20\helpref{wxCore}{librarieslist}
21
5f35b46a
JS
22\wxheading{Constants}
23
44cc96a8 24The following values can be passed to wxTextAttr::SetAlignment to determine
5f35b46a
JS
25paragraph alignment.
26
27{\small
28\begin{verbatim}
29enum wxTextAttrAlignment
30{
31 wxTEXT_ALIGNMENT_DEFAULT,
32 wxTEXT_ALIGNMENT_LEFT,
33 wxTEXT_ALIGNMENT_CENTRE,
34 wxTEXT_ALIGNMENT_CENTER = wxTEXT_ALIGNMENT_CENTRE,
35 wxTEXT_ALIGNMENT_RIGHT,
36 wxTEXT_ALIGNMENT_JUSTIFIED
37};
38\end{verbatim}
39}
40
44cc96a8
JS
41Of these, wxTEXT\_ALIGNMENT\_JUSTIFIED is unimplemented. In future justification may be supported
42when printing or previewing, only.
43
44The following values are passed in a bitlist to wxTextAttr::SetFlags to determine
5f35b46a
JS
45what attributes will be considered when setting the attributes
46for a text control.
47
48{\small
49\begin{verbatim}
44cc96a8
JS
50// Standard wxTextAttr constants
51
52#define wxTEXT_ATTR_TEXT_COLOUR 0x00000001
53#define wxTEXT_ATTR_BACKGROUND_COLOUR 0x00000002
54#define wxTEXT_ATTR_FONT_FACE 0x00000004
55#define wxTEXT_ATTR_FONT_SIZE 0x00000008
56#define wxTEXT_ATTR_FONT_WEIGHT 0x00000010
57#define wxTEXT_ATTR_FONT_ITALIC 0x00000020
58#define wxTEXT_ATTR_FONT_UNDERLINE 0x00000040
59#define wxTEXT_ATTR_FONT_ENCODING 0x02000000
5f35b46a
JS
60#define wxTEXT_ATTR_FONT \
61 wxTEXT_ATTR_FONT_FACE | wxTEXT_ATTR_FONT_SIZE | wxTEXT_ATTR_FONT_WEIGHT \
44cc96a8
JS
62| wxTEXT_ATTR_FONT_ITALIC | wxTEXT_ATTR_FONT_UNDERLINE | wxTEXT_ATTR_FONT_ENCODING
63#define wxTEXT_ATTR_ALIGNMENT 0x00000080
64#define wxTEXT_ATTR_LEFT_INDENT 0x00000100
65#define wxTEXT_ATTR_RIGHT_INDENT 0x00000200
66#define wxTEXT_ATTR_TABS 0x00000400
67
68// Extra formatting flags not in wxTextAttr
69
70#define wxTEXT_ATTR_PARA_SPACING_AFTER 0x00000800
71#define wxTEXT_ATTR_PARA_SPACING_BEFORE 0x00001000
72#define wxTEXT_ATTR_LINE_SPACING 0x00002000
73#define wxTEXT_ATTR_CHARACTER_STYLE_NAME 0x00004000
74#define wxTEXT_ATTR_PARAGRAPH_STYLE_NAME 0x00008000
75#define wxTEXT_ATTR_LIST_STYLE_NAME 0x00010000
76#define wxTEXT_ATTR_BULLET_STYLE 0x00020000
77#define wxTEXT_ATTR_BULLET_NUMBER 0x00040000
78#define wxTEXT_ATTR_BULLET_TEXT 0x00080000
79#define wxTEXT_ATTR_BULLET_NAME 0x00100000
80#define wxTEXT_ATTR_URL 0x00200000
81#define wxTEXT_ATTR_PAGE_BREAK 0x00400000
82#define wxTEXT_ATTR_EFFECTS 0x00800000
83#define wxTEXT_ATTR_OUTLINE_LEVEL 0x01000000
5f35b46a
JS
84\end{verbatim}
85}
86
44cc96a8
JS
87The following styles can be passed to wxTextAttr::SetBulletStyle:
88
89{\small
90\begin{verbatim}
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
107\end{verbatim}
108}
109
110Of these, wxTEXT\_ATTR\_BULLET\_STYLE\_BITMAP is unimplemented.
111
112The following constants can be passed to wxTextAttr::SetLineSpacing:
113
114{\small
115\begin{verbatim}
116#define wxTEXT_ATTR_LINE_SPACING_NORMAL 10
117#define wxTEXT_ATTR_LINE_SPACING_HALF 15
118#define wxTEXT_ATTR_LINE_SPACING_TWICE 20
119\end{verbatim}
120}
121
122The following styles can be passed to wxTextAttr::SetTextEffects:
123
124{\small
125\begin{verbatim}
126#define wxTEXT_ATTR_EFFECT_NONE 0x00000000
127#define wxTEXT_ATTR_EFFECT_CAPITALS 0x00000001
128#define wxTEXT_ATTR_EFFECT_SMALL_CAPITALS 0x00000002
129#define wxTEXT_ATTR_EFFECT_STRIKETHROUGH 0x00000004
130#define wxTEXT_ATTR_EFFECT_DOUBLE_STRIKETHROUGH 0x00000008
131#define wxTEXT_ATTR_EFFECT_SHADOW 0x00000010
132#define wxTEXT_ATTR_EFFECT_EMBOSS 0x00000020
133#define wxTEXT_ATTR_EFFECT_OUTLINE 0x00000040
134#define wxTEXT_ATTR_EFFECT_ENGRAVE 0x00000080
135#define wxTEXT_ATTR_EFFECT_SUPERSCRIPT 0x00000100
136#define wxTEXT_ATTR_EFFECT_SUBSCRIPT 0x00000200
137\end{verbatim}
138}
139
140Of these, only wxTEXT\_ATTR\_EFFECT\_CAPITALS and wxTEXT\_ATTR\_EFFECT\_STRIKETHROUGH are implemented.
141
142\wxheading{See also}
5f35b46a 143
44cc96a8 144\helpref{wxTextCtrl}{wxtextctrl}, \helpref{wxRichTextCtrl}{wxrichtextctrl}
5f35b46a 145
44cc96a8
JS
146\latexignore{\rtfignore{\wxheading{Members}}}
147
148\membersection{wxTextAttr::wxTextAttr}\label{wxtextattrwxtextattr}
5f35b46a
JS
149
150\func{}{wxTextAttr}{\void}
151
44cc96a8
JS
152\func{}{wxTextAttr}{\param{const wxColour\& }{colText}, \param{const wxColour\& }{colBack = wxNullColour}, \param{const wxFont\& }{font = wxNullFont}, \param{wxTextAttrAlignment }{alignment = wxTEXT\_ALIGNMENT\_DEFAULT}}
153
154\func{}{wxTextAttr}{\param{const wxTextAttr\& }{attr}}
155
156Constructors.
157
158\membersection{wxTextAttr::Apply}\label{wxtextattrapply}
5f35b46a 159
44cc96a8 160\func{bool}{Apply}{\param{const wxTextAttr\& }{style}, \param{const wxTextAttr* }{compareWith = NULL}}
5f35b46a 161
44cc96a8
JS
162Applies the attributes in {\it style} to the original object, but not those attributes from {\it style} that are the same as those in {\it compareWith} (if passed).
163
164\membersection{wxTextAttr::CreateFont}\label{wxtextattrcreatefont}
165
166\constfunc{wxFont}{CreateFont}{\void}
167
168Creates a font from the font attributes.
5f35b46a
JS
169
170\membersection{wxTextAttr::GetAlignment}\label{wxtextattrgetalignment}
171
172\constfunc{wxTextAttrAlignment}{GetAlignment}{\void}
173
44cc96a8
JS
174Returns the alignment flags.
175See \helpref{wxTextAttr::SetAlignment}{wxtextattrsetalignment} for a list of available styles.
5f35b46a
JS
176
177\membersection{wxTextAttr::GetBackgroundColour}\label{wxtextattrgetbackgroundcolour}
178
179\constfunc{const wxColour\&}{GetBackgroundColour}{\void}
180
44cc96a8 181Returns the background colour.
5f35b46a 182
44cc96a8
JS
183\membersection{wxTextAttr::GetBulletFont}\label{wxtextattrgetbulletfont}
184
185\constfunc{const wxString\&}{GetBulletFont}{\void}
186
187Returns a string containing the name of the font associated with the bullet symbol.
188Only valid for attributes with wxTEXT\_ATTR\_BULLET\_SYMBOL.
189
190\membersection{wxTextAttr::GetBulletName}\label{wxtextattrgetbulletname}
191
192\constfunc{const wxString\&}{GetBulletName}{\void}
193
194Returns the standard bullet name, applicable if the bullet style is wxTEXT\_ATTR\_BULLET\_STYLE\_STANDARD.
195Currently the following standard bullet names are supported:
196
197\begin{itemize}\itemsep=0pt
198\item {\tt standard/circle}
199\item {\tt standard/square}
200\item {\tt standard/diamond}
201\item {\tt standard/triangle}
202\end{itemize}
203
204For wxRichTextCtrl users only: if you wish your rich text controls to support further bullet graphics, you can derive a
205class from wxRichTextRenderer or wxRichTextStdRenderer, override {\tt DrawStandardBullet} and {\tt EnumerateStandardBulletNames}, and
206set an instance of the class using \helpref{wxRichTextBuffer::SetRenderer}{wxrichtextbuffersetrenderer}.
207
208\membersection{wxTextAttr::GetBulletNumber}\label{wxtextattrgetbulletnumber}
209
210\constfunc{int}{GetBulletNumber}{\void}
211
212Returns the bullet number.
213
214\membersection{wxTextAttr::GetBulletStyle}\label{wxtextattrgetbulletstyle}
215
216\constfunc{int}{GetBulletStyle}{\void}
217
218Returns the bullet style.
219See \helpref{wxTextAttr::SetBulletStyle}{wxtextattrsetbulletstyle} for a list of available styles.
220
221\membersection{wxTextAttr::GetBulletText}\label{wxtextattrgetbullettext}
222
223\constfunc{const wxString\&}{GetBulletText}{\void}
224
225Returns the bullet text, which could be a symbol, or (for example) cached outline text.
226
227\membersection{wxTextAttr::GetCharacterStyleName}\label{wxtextattrgetcharacterstylename}
228
229\constfunc{const wxString\&}{GetCharacterStyleName}{\void}
230
231Returns the name of the character style.
232
233\membersection{wxTextAttr::GetFlags}\label{wxtextattrgetflags}
234
235\constfunc{long}{GetFlags}{\void}
236
237Returns flags indicating which attributes are applicable.
238See \helpref{wxTextAttr::SetFlags}{wxtextattrsetflags} for a list of available flags.
5f35b46a
JS
239
240\membersection{wxTextAttr::GetFont}\label{wxtextattrgetfont}
241
44cc96a8
JS
242\constfunc{wxFont}{GetFont}{\void}
243
244Creates and returns a font specified by the font attributes in the wxTextAttr object. Note that
245wxTextAttr does not store a wxFont object, so this is only a temporary font. For greater
246efficiency, access the font attributes directly.
247
248\membersection{wxTextAttr::GetFontAttributes}\label{wxtextattrgetfontattributes}
249
250\func{bool}{GetFontAttributes}{\param{const wxFont\& }{font}, \param{int}{ flags = wxTEXT\_ATTR\_FONT}}
251
252Gets the font attributes from the given font, using only the attributes specified by {\it flags}.
253
254\membersection{wxTextAttr::GetFontEncoding}\label{wxtextattrgetfontencoding}
255
256\constfunc{wxFontEncoding}{GetFontEncoding}{\void}
257
258Returns the font encoding.
259
260\membersection{wxTextAttr::GetFontFaceName}\label{wxtextattrgetfontfacename}
261
262\constfunc{const wxString\&}{GetFontFaceName}{\void}
263
264Returns the font face name.
265
266\membersection{wxTextAttr::GetFontSize}\label{wxtextattrgetfontsize}
267
268\constfunc{int}{GetFontSize}{\void}
5f35b46a 269
44cc96a8 270Returns the font size in points.
5f35b46a 271
44cc96a8
JS
272\membersection{wxTextAttr::GetFontStyle}\label{wxtextattrgetfontstyle}
273
274\constfunc{int}{GetFontStyle}{\void}
275
276Returns the font style.
277
278\membersection{wxTextAttr::GetFontUnderlined}\label{wxtextattrgetfontunderlined}
279
280\constfunc{bool}{GetFontUnderlined}{\void}
281
282Returns \true if the font is underlined.
283
284\membersection{wxTextAttr::GetFontWeight}\label{wxtextattrgetfontweight}
285
286\constfunc{int}{GetFontWeight}{\void}
287
288Returns the font weight.
5f35b46a
JS
289
290\membersection{wxTextAttr::GetLeftIndent}\label{wxtextattrgetleftindent}
291
44cc96a8 292\constfunc{long}{GetLeftIndent}{\void}
5f35b46a
JS
293
294Returns the left indent in tenths of a millimetre.
295
5f35b46a
JS
296\membersection{wxTextAttr::GetLeftSubIndent}\label{wxtextattrgetleftsubindent}
297
44cc96a8 298\constfunc{long}{GetLeftSubIndent}{\void}
5f35b46a 299
44cc96a8 300Returns the left sub-indent in tenths of a millimetre.
5f35b46a 301
44cc96a8 302\membersection{wxTextAttr::GetLineSpacing}\label{wxtextattrgetlinespacing}
5f35b46a 303
44cc96a8
JS
304\constfunc{int}{GetLineSpacing}{\void}
305
306Returns the line spacing value, one of wxTEXT\_ATTR\_LINE\_SPACING\_NORMAL,
307wxTEXT\_ATTR\_LINE\_SPACING\_HALF, and wxTEXT\_ATTR\_LINE\_SPACING\_TWICE.
308
309\membersection{wxTextAttr::GetListStyleName}\label{wxtextattrgetliststylename}
310
311\constfunc{const wxString\&}{GetListStyleName}{\void}
312
313Returns the name of the list style.
314
315\membersection{wxTextAttr::GetOutlineLevel}\label{wxtextattrgetoutlinelevel}
316
317\constfunc{bool}{GetOutlineLevel}{\void}
318
319Returns the outline level.
320
321\membersection{wxTextAttr::GetParagraphSpacingAfter}\label{wxtextattrgetparagraphspacingafter}
5f35b46a 322
44cc96a8 323\constfunc{int}{GetParagraphSpacingAfter}{\void}
5f35b46a 324
44cc96a8 325Returns the space in tenths of a millimeter after the paragraph.
5f35b46a 326
44cc96a8
JS
327\membersection{wxTextAttr::GetParagraphSpacingBefore}\label{wxtextattrgetparagraphspacingbefore}
328
329\constfunc{int}{GetParagraphSpacingBefore}{\void}
330
331Returns the space in tenths of a millimeter before the paragraph.
332
333\membersection{wxTextAttr::GetParagraphStyleName}\label{wxtextattrgetparagraphstylename}
334
335\constfunc{const wxString\&}{GetParagraphStyleName}{\void}
336
337Returns the name of the paragraph style.
338
339\membersection{wxTextAttr::GetRightIndent}\label{wxtextattrgetrightindent}
340
341\constfunc{long}{GetRightIndent}{\void}
342
343Returns the right indent in tenths of a millimeter.
5f35b46a
JS
344
345\membersection{wxTextAttr::GetTabs}\label{wxtextattrgettabs}
346
347\constfunc{const wxArrayInt\&}{GetTabs}{\void}
348
44cc96a8
JS
349Returns an array of tab stops, each expressed in tenths of a millimeter. Each stop
350is measured from the left margin and therefore each value must be larger than the last.
5f35b46a
JS
351
352\membersection{wxTextAttr::GetTextColour}\label{wxtextattrgettextcolour}
353
354\constfunc{const wxColour\&}{GetTextColour}{\void}
355
44cc96a8
JS
356Returns the text foreground colour.
357
358\membersection{wxTextAttr::GetTextEffectFlags}\label{wxtextattrgettexteffectflags}
359
360\constfunc{int}{GetTextEffectFlags}{\void}
361
362Returns the text effect bits of interest. See \helpref{wxTextAttr::SetFlags}{wxtextattrsetflags} for further information.
363
364\membersection{wxTextAttr::GetTextEffects}\label{wxtextattrgettexteffects}
365
366\constfunc{int}{GetTextEffects}{\void}
367
368Returns the text effects, a bit list of styles. See \helpref{wxTextAttr::SetTextEffects}{wxtextattrsettexteffects} for
369details.
370
371\membersection{wxTextAttr::GetURL}\label{wxtextattrgeturl}
5f35b46a 372
44cc96a8
JS
373\constfunc{const wxString\&}{GetURL}{\void}
374
375Returns the URL for the content. Content with wxTEXT\_ATTR\_URL style
376causes wxRichTextCtrl to show a hand cursor over it, and wxRichTextCtrl generates
377a wxTextUrlEvent when the content is clicked.
5f35b46a 378
9ec83118
VZ
379\membersection{wxTextAttr::HasAlignment}\label{wxtextattrhasalignment}
380
381\constfunc{bool}{HasAlignment}{\void}
382
44cc96a8 383Returns \true if the attribute object specifies alignment.
9ec83118 384
5f35b46a
JS
385\membersection{wxTextAttr::HasBackgroundColour}\label{wxtextattrhasbackgroundcolour}
386
387\constfunc{bool}{HasBackgroundColour}{\void}
388
44cc96a8
JS
389Returns \true if the attribute object specifies a background colour.
390
391\membersection{wxTextAttr::HasBulletName}\label{wxtextattrhasbulletname}
392
393\constfunc{bool}{HasBulletName}{\void}
394
395Returns \true if the attribute object specifies a standard bullet name.
396
397\membersection{wxTextAttr::HasBulletNumber}\label{wxtextattrhasbulletnumber}
398
399\constfunc{bool}{HasBulletNumber}{\void}
400
401Returns \true if the attribute object specifies a bullet number.
402
403\membersection{wxTextAttr::HasBulletStyle}\label{wxtextattrhasbulletstyle}
404
405\constfunc{bool}{HasBulletStyle}{\void}
406
407Returns \true if the attribute object specifies a bullet style.
408
409\membersection{wxTextAttr::HasBulletText}\label{wxtextattrhasbullettext}
410
411\constfunc{bool}{HasBulletText}{\void}
412
413Returns \true if the attribute object specifies bullet text (usually specifying a symbol).
414
415\membersection{wxTextAttr::HasCharacterStyleName}\label{wxtextattrhascharacterstylename}
416
417\constfunc{bool}{HasCharacterStyleName}{\void}
418
419Returns \true if the attribute object specifies a character style name.
420
421\membersection{wxTextAttr::HasFontEncoding}\label{wxtextattrhasfontencoding}
5f35b46a 422
44cc96a8
JS
423\constfunc{bool}{HasFontEncoding}{\void}
424
425Returns \true if the attribute object specifies an encoding.
426
427\membersection{wxTextAttr::HasFontFaceName}\label{wxtextattrhasfontfacename}
428
429\constfunc{bool}{HasFontFaceName}{\void}
430
431Returns \true if the attribute object specifies a font face name.
432
433\membersection{wxTextAttr::HasFlag}\label{wxtextattrhasflag}
434
435\constfunc{bool}{HasFlag}{\param{long }{flag}}
436
437Returns \true if the {\it flag} is present in the attribute object's flag bitlist.
5f35b46a
JS
438
439\membersection{wxTextAttr::HasFont}\label{wxtextattrhasfont}
440
441\constfunc{bool}{HasFont}{\void}
442
44cc96a8
JS
443Returns \true if the attribute object specifies any font attributes.
444
445\membersection{wxTextAttr::HasFontItalic}\label{wxtextattrhasfontitalic}
446
447\constfunc{bool}{HasFontItalic}{\void}
448
449Returns \true if the attribute object specifies italic style.
450
451\membersection{wxTextAttr::HasFontUnderlined}\label{wxtextattrhasfontunderlined}
452
453\constfunc{bool}{HasFontUnderlined}{\void}
454
455Returns \true if the attribute object specifies either underlining or no underlining.
456
457\membersection{wxTextAttr::HasURL}\label{wxtextattrhasurl}
458
459\constfunc{bool}{HasURL}{\void}
460
461Returns \true if the attribute object specifies a URL.
462
463\membersection{wxTextAttr::HasFontWeight}\label{wxtextattrhasfontweight}
5f35b46a 464
44cc96a8
JS
465\constfunc{bool}{HasFontWeight}{\void}
466
467Returns \true if the attribute object specifies font weight (bold, light or normal).
5f35b46a 468
9ec83118
VZ
469\membersection{wxTextAttr::HasLeftIndent}\label{wxtextattrhasleftindent}
470
471\constfunc{bool}{HasLeftIndent}{\void}
472
44cc96a8
JS
473Returns \true if the attribute object specifies a left indent.
474
475\membersection{wxTextAttr::HasLineSpacing}\label{wxtextattrhaslinespacing}
476
477\constfunc{bool}{HasLineSpacing}{\void}
478
479Returns \true if the attribute object specifies line spacing.
480
481\membersection{wxTextAttr::HasListStyleName}\label{wxtextattrhasliststylename}
482
483\constfunc{bool}{HasListStyleName}{\void}
484
485Returns \true if the attribute object specifies a list style name.
486
487\membersection{wxTextAttr::HasOutlineLevel}\label{wxtextattrhasoutlinelevel}
488
489\constfunc{bool}{HasOutlineLevel}{\void}
490
491Returns \true if the attribute object specifies an outline level.
492
493\membersection{wxTextAttr::HasPageBreak}\label{wxtextattrhaspagebreak}
494
495\constfunc{bool}{HasPageBreak}{\void}
496
497Returns \true if the attribute object specifies a page break before this paragraph.
498
499\membersection{wxTextAttr::HasParagraphSpacingAfter}\label{wxtextattrhasparagraphspacingafter}
500
501\constfunc{bool}{HasParagraphSpacingAfter}{\void}
502
503Returns \true if the attribute object specifies spacing after a paragraph.
504
505\membersection{wxTextAttr::HasParagraphSpacingBefore}\label{wxtextattrhasparagraphspacingbefore}
506
507\constfunc{bool}{HasParagraphSpacingBefore}{\void}
9ec83118 508
44cc96a8
JS
509Returns \true if the attribute object specifies spacing before a paragraph.
510
511\membersection{wxTextAttr::HasParagraphStyleName}\label{wxtextattrhasparagraphstylename}
512
513\constfunc{bool}{HasParagraphStyleName}{\void}
514
515Returns \true if the attribute object specifies a paragraph style name.
9ec83118
VZ
516
517\membersection{wxTextAttr::HasRightIndent}\label{wxtextattrhasrightindent}
518
519\constfunc{bool}{HasRightIndent}{\void}
520
44cc96a8
JS
521Returns \true if the attribute object specifies a right indent.
522
523\membersection{wxTextAttr::HasFontSize}\label{wxtextattrhasfontsize}
524
525\constfunc{bool}{HasFontSize}{\void}
9ec83118 526
44cc96a8 527Returns \true if the attribute object specifies a font point size.
9ec83118
VZ
528
529\membersection{wxTextAttr::HasTabs}\label{wxtextattrhastabs}
530
531\constfunc{bool}{HasTabs}{\void}
532
44cc96a8 533Returns \true if the attribute object specifies tab stops.
9ec83118 534
5f35b46a
JS
535\membersection{wxTextAttr::HasTextColour}\label{wxtextattrhastextcolour}
536
537\constfunc{bool}{HasTextColour}{\void}
538
44cc96a8 539Returns \true if the attribute object specifies a text foreground colour.
5f35b46a 540
44cc96a8 541\membersection{wxTextAttr::HasTextEffects}\label{wxtextattrhastexteffects}
5f35b46a 542
44cc96a8 543\constfunc{bool}{HasTextEffects}{\void}
5f35b46a 544
44cc96a8 545Returns \true if the attribute object specifies text effects.
5f35b46a 546
44cc96a8 547\membersection{wxTextAttr::IsCharacterStyle}\label{wxtextattrischaracterstyle}
5f35b46a 548
44cc96a8
JS
549\constfunc{bool}{IsCharacterStyle}{\void}
550
551Returns \true if the object represents a character style, that is,
552the flags specify a font or a text background or foreground colour.
5f35b46a
JS
553
554\membersection{wxTextAttr::IsDefault}\label{wxtextattrisdefault}
555
556\constfunc{bool}{IsDefault}{\void}
557
44cc96a8
JS
558Returns \false if we have any attributes set, \true otherwise.
559
560\membersection{wxTextAttr::IsParagraphStyle}\label{wxtextattrisparagraphstyle}
5f35b46a 561
44cc96a8
JS
562\constfunc{bool}{IsParagraphStyle}{\void}
563
564Returns \true if the object represents a paragraph style, that is,
565the flags specify alignment, indentation, tabs, paragraph spacing, or
566bullet style.
5f35b46a
JS
567
568\membersection{wxTextAttr::Merge}\label{wxtextattrmerge}
569
570\func{void}{Merge}{\param{const wxTextAttr\&}{ overlay}}
571
572Copies all defined/valid properties from \arg{overlay} to current object.
573
574\func{static wxTextAttr}{Merge}{\param{const wxTextAttr\&}{ base}, \param{const wxTextAttr\&}{ overlay}}
575
576Creates a new {\tt wxTextAttr} which is a merge of \arg{base} and
577\arg{overlay}. Properties defined in \arg{overlay} take precedence over those
578in \arg{base}. Properties undefined/invalid in both are undefined in the
579result.
580
581
582\membersection{wxTextAttr::SetAlignment}\label{wxtextattrsetalignment}
583
44cc96a8 584\func{void}{SetAlignment}{\param{wxTextAttrAlignment }{alignment}}
5f35b46a 585
44cc96a8
JS
586Sets the paragraph alignment. These are the possible values for {\it alignment}:
587
588{\small
589\begin{verbatim}
590enum wxTextAttrAlignment
591{
592 wxTEXT_ALIGNMENT_DEFAULT,
593 wxTEXT_ALIGNMENT_LEFT,
594 wxTEXT_ALIGNMENT_CENTRE,
595 wxTEXT_ALIGNMENT_CENTER = wxTEXT_ALIGNMENT_CENTRE,
596 wxTEXT_ALIGNMENT_RIGHT,
597 wxTEXT_ALIGNMENT_JUSTIFIED
598};
599\end{verbatim}
600}
5f35b46a 601
44cc96a8
JS
602Of these, wxTEXT\_ALIGNMENT\_JUSTIFIED is unimplemented. In future justification may be supported
603when printing or previewing, only.
5f35b46a
JS
604
605\membersection{wxTextAttr::SetBackgroundColour}\label{wxtextattrsetbackgroundcolour}
606
44cc96a8 607\func{void}{SetBackgroundColour}{\param{const wxColour\& }{colBack}}
5f35b46a
JS
608
609Sets the background colour.
610
44cc96a8
JS
611\membersection{wxTextAttr::SetBulletFont}\label{wxtextattrsetbulletfont}
612
613\func{void}{SetBulletFont}{\param{const wxString\& }{font}}
614
615Sets the name of the font associated with the bullet symbol.
616Only valid for attributes with wxTEXT\_ATTR\_BULLET\_SYMBOL.
617
618\membersection{wxTextAttr::SetBulletName}\label{wxtextattrsetbulletname}
619
620\func{void}{SetBulletName}{\param{const wxString\& }{name}}
621
622Sets the standard bullet name, applicable if the bullet style is wxTEXT\_ATTR\_BULLET\_STYLE\_STANDARD.
623See \helpref{wxTextAttr::GetBulletName}{wxtextattrgetbulletname} for a list
624of supported names, and how to expand the range of supported types.
625
626\membersection{wxTextAttr::SetBulletNumber}\label{wxtextattrsetbulletnumber}
627
628\func{void}{SetBulletNumber}{\param{int }{n}}
629
630Sets the bullet number.
631
632\membersection{wxTextAttr::SetBulletStyle}\label{wxtextattrsetbulletstyle}
633
634\func{void}{SetBulletStyle}{\param{int }{style}}
635
636Sets the bullet style. The following styles can be passed:
637
638{\small
639\begin{verbatim}
640#define wxTEXT_ATTR_BULLET_STYLE_NONE 0x00000000
641#define wxTEXT_ATTR_BULLET_STYLE_ARABIC 0x00000001
642#define wxTEXT_ATTR_BULLET_STYLE_LETTERS_UPPER 0x00000002
643#define wxTEXT_ATTR_BULLET_STYLE_LETTERS_LOWER 0x00000004
644#define wxTEXT_ATTR_BULLET_STYLE_ROMAN_UPPER 0x00000008
645#define wxTEXT_ATTR_BULLET_STYLE_ROMAN_LOWER 0x00000010
646#define wxTEXT_ATTR_BULLET_STYLE_SYMBOL 0x00000020
647#define wxTEXT_ATTR_BULLET_STYLE_BITMAP 0x00000040
648#define wxTEXT_ATTR_BULLET_STYLE_PARENTHESES 0x00000080
649#define wxTEXT_ATTR_BULLET_STYLE_PERIOD 0x00000100
650#define wxTEXT_ATTR_BULLET_STYLE_STANDARD 0x00000200
651#define wxTEXT_ATTR_BULLET_STYLE_RIGHT_PARENTHESIS 0x00000400
652#define wxTEXT_ATTR_BULLET_STYLE_OUTLINE 0x00000800
653#define wxTEXT_ATTR_BULLET_STYLE_ALIGN_LEFT 0x00000000
654#define wxTEXT_ATTR_BULLET_STYLE_ALIGN_RIGHT 0x00001000
655#define wxTEXT_ATTR_BULLET_STYLE_ALIGN_CENTRE 0x00002000
656\end{verbatim}
657}
658
659Currently wxTEXT\_ATTR\_BULLET\_STYLE\_BITMAP is not supported.
660
661\membersection{wxTextAttr::SetBulletText}\label{wxtextattrsetbullettext}
662
663\func{void}{SetBulletText}{\param{const wxString& }{text}}
664
665Sets the bullet text, which could be a symbol, or (for example) cached outline text.
666
667\membersection{wxTextAttr::SetCharacterStyleName}\label{wxtextattrsetcharacterstylename}
668
669\func{void}{SetCharacterStyleName}{\param{const wxString\& }{name}}
670
671Sets the character style name.
5f35b46a
JS
672
673\membersection{wxTextAttr::SetFlags}\label{wxtextattrsetflags}
674
44cc96a8 675\func{void}{SetFlags}{\param{long }{flags}}
5f35b46a 676
44cc96a8
JS
677Sets the flags determining which styles are being specified. The following
678flags can be passed in a bitlist:
5f35b46a 679
44cc96a8
JS
680{\small
681\begin{verbatim}
682// Standard wxTextAttr constants
683
684#define wxTEXT_ATTR_TEXT_COLOUR 0x00000001
685#define wxTEXT_ATTR_BACKGROUND_COLOUR 0x00000002
686#define wxTEXT_ATTR_FONT_FACE 0x00000004
687#define wxTEXT_ATTR_FONT_SIZE 0x00000008
688#define wxTEXT_ATTR_FONT_WEIGHT 0x00000010
689#define wxTEXT_ATTR_FONT_ITALIC 0x00000020
690#define wxTEXT_ATTR_FONT_UNDERLINE 0x00000040
691#define wxTEXT_ATTR_FONT \
692 wxTEXT_ATTR_FONT_FACE | wxTEXT_ATTR_FONT_SIZE | wxTEXT_ATTR_FONT_WEIGHT \
693| wxTEXT_ATTR_FONT_ITALIC | wxTEXT_ATTR_FONT_UNDERLINE
694#define wxTEXT_ATTR_ALIGNMENT 0x00000080
695#define wxTEXT_ATTR_LEFT_INDENT 0x00000100
696#define wxTEXT_ATTR_RIGHT_INDENT 0x00000200
697#define wxTEXT_ATTR_TABS 0x00000400
698
699// Extra formatting flags not in wxTextAttr
700
701#define wxTEXT_ATTR_PARA_SPACING_AFTER 0x00000800
702#define wxTEXT_ATTR_PARA_SPACING_BEFORE 0x00001000
703#define wxTEXT_ATTR_LINE_SPACING 0x00002000
704#define wxTEXT_ATTR_CHARACTER_STYLE_NAME 0x00004000
705#define wxTEXT_ATTR_PARAGRAPH_STYLE_NAME 0x00008000
706#define wxTEXT_ATTR_LIST_STYLE_NAME 0x00010000
707#define wxTEXT_ATTR_BULLET_STYLE 0x00020000
708#define wxTEXT_ATTR_BULLET_NUMBER 0x00040000
709#define wxTEXT_ATTR_BULLET_TEXT 0x00080000
710#define wxTEXT_ATTR_BULLET_NAME 0x00100000
711#define wxTEXT_ATTR_URL 0x00200000
712#define wxTEXT_ATTR_PAGE_BREAK 0x00400000
713#define wxTEXT_ATTR_EFFECTS 0x00800000
714#define wxTEXT_ATTR_OUTLINE_LEVEL 0x01000000
715\end{verbatim}
716}
5f35b46a
JS
717
718\membersection{wxTextAttr::SetFont}\label{wxtextattrsetfont}
719
720\func{void}{SetFont}{\param{const wxFont\&}{ font}}
721
44cc96a8
JS
722Sets the attributes for the given font. Note that wxTextAttr does not store an actual wxFont object.
723
724\membersection{wxTextAttr::SetFontEncoding}\label{wxtextattrsetfontencoding}
725
726\func{void}{SetFontEncoding}{\param{wxFontEncoding }{encoding}}
727
728Sets the font encoding.
729
730\membersection{wxTextAttr::SetFontFaceName}\label{wxtextattrsetfontfacename}
731
732\func{void}{SetFontFaceName}{\param{const wxString\& }{faceName}}
733
734Sets the paragraph alignment.
735
736\membersection{wxTextAttr::SetFontSize}\label{wxtextattrsetfontsize}
737
738\func{void}{SetFontSize}{\param{int }{pointSize}}
739
740Sets the font size in points.
741
742\membersection{wxTextAttr::SetFontStyle}\label{wxtextattrsetfontstyle}
743
744\func{void}{SetFontStyle}{\param{int }{fontStyle}}
745
746Sets the font style (normal, italic or slanted).
747
748\membersection{wxTextAttr::SetFontUnderlined}\label{wxtextattrsetfontunderlined}
749
750\func{void}{SetFontUnderlined}{\param{bool }{underlined}}
5f35b46a 751
44cc96a8
JS
752Sets the font underlining.
753
754\membersection{wxTextAttr::SetFontWeight}\label{wxtextattrsetfontweight}
755
756\func{void}{SetFontWeight}{\param{int }{fontWeight}}
757
758Sets the font weight.
5f35b46a
JS
759
760\membersection{wxTextAttr::SetLeftIndent}\label{wxtextattrsetleftindent}
761
762\func{void}{SetLeftIndent}{\param{int }{indent}, \param{int }{subIndent = 0}}
763
44cc96a8
JS
764Sets the left indent and left subindent in tenths of a millimetre.
765
766The sub-indent is an offset from the left of the paragraph, and is used for all but the
767first line in a paragraph. A positive value will cause the first line to appear to the left
768of the subsequent lines, and a negative value will cause the first line to be indented
769relative to the subsequent lines.
770
771wxRichTextBuffer uses indentation to render a bulleted item. The left indent is the distance between
772the margin and the bullet. The content of the paragraph, including the first line, starts
773at leftMargin + leftSubIndent. So the distance between the left edge of the bullet and the
774left of the actual paragraph is leftSubIndent.
775
776\membersection{wxTextAttr::SetLineSpacing}\label{wxtextattrsetlinespacing}
777
778\func{void}{SetLineSpacing}{\param{int }{spacing}}
779
780Sets the line spacing. {\it spacing} is a multiple, where 10 means single-spacing,
78115 means 1.5 spacing, and 20 means double spacing. The following constants are
782defined for convenience:
783
784{\small
785\begin{verbatim}
786#define wxTEXT_ATTR_LINE_SPACING_NORMAL 10
787#define wxTEXT_ATTR_LINE_SPACING_HALF 15
788#define wxTEXT_ATTR_LINE_SPACING_TWICE 20
789\end{verbatim}
790}
791
792\membersection{wxTextAttr::SetListStyleName}\label{wxtextattrsetliststylename}
793
794\func{void}{SetListStyleName}{\param{const wxString\& }{name}}
795
796Sets the list style name.
797
798\membersection{wxTextAttr::SetOutlineLevel}\label{wxtextattrsetoutlinelevel}
5f35b46a 799
44cc96a8
JS
800\func{void}{SetOutlineLevel}{\param{int}{ level}}
801
802Specifies the outline level. Zero represents normal text. At present, the outline level is
803not used, but may be used in future for determining list levels and for applications
804that need to store document structure information.
805
806\membersection{wxTextAttr::SetPageBreak}\label{wxtextattrsetpagebreak}
807
808\func{void}{SetPageBreak}{\param{bool}{ pageBreak = true}}
809
810Specifies a page break before this paragraph.
811
812\membersection{wxTextAttr::SetParagraphSpacingAfter}\label{wxtextattrsetparagraphspacingafter}
813
814\func{void}{SetParagraphSpacingAfter}{\param{int }{spacing}}
815
816Sets the spacing after a paragraph, in tenths of a millimetre.
817
818\membersection{wxTextAttr::SetParagraphSpacingBefore}\label{wxtextattrsetparagraphspacingbefore}
819
820\func{void}{SetParagraphSpacingBefore}{\param{int }{spacing}}
821
822Sets the spacing before a paragraph, in tenths of a millimetre.
823
824\membersection{wxTextAttr::SetParagraphStyleName}\label{wxtextattrsetparagraphstylename}
825
826\func{void}{SetParagraphStyleName}{\param{const wxString\& }{name}}
827
828Sets the name of the paragraph style.
5f35b46a
JS
829
830\membersection{wxTextAttr::SetRightIndent}\label{wxtextattrsetrightindent}
831
832\func{void}{SetRightIndent}{\param{int }{indent}}
833
834Sets the right indent in tenths of a millimetre.
835
5f35b46a
JS
836\membersection{wxTextAttr::SetTabs}\label{wxtextattrsettabs}
837
44cc96a8 838\func{void}{SetTabs}{\param{const wxArrayInt\& }{tabs}}
5f35b46a 839
44cc96a8
JS
840Sets the tab stops, expressed in tenths of a millimetre.
841Each stop is measured from the left margin and therefore each value must be larger than the last.
5f35b46a
JS
842
843\membersection{wxTextAttr::SetTextColour}\label{wxtextattrsettextcolour}
844
44cc96a8
JS
845\func{void}{SetTextColour}{\param{const wxColour\& }{colText}}
846
847Sets the text foreground colout.
848
849\membersection{wxTextAttr::SetTextEffectFlags}\label{wxtextattrsettexteffectflags}
850
851\func{void}{SetTextEffectFlags}{\param{int }{flags}}
852
853Sets the text effect bits of interest. You should also pass wxTEXT\_ATTR\_EFFECTS to \helpref{wxTextAttr::SetFlags}{wxtextattrsetflags}.
854See \helpref{wxTextAttr::SetFlags}{wxtextattrsetflags} for further information.
855
856\membersection{wxTextAttr::SetTextEffects}\label{wxtextattrsettexteffects}
857
858\func{void}{SetTextEffects}{\param{int }{effects}}
859
860Sets the text effects, a bit list of styles.
861
862The following styles can be passed:
863
864{\small
865\begin{verbatim}
866#define wxTEXT_ATTR_EFFECT_NONE 0x00000000
867#define wxTEXT_ATTR_EFFECT_CAPITALS 0x00000001
868#define wxTEXT_ATTR_EFFECT_SMALL_CAPITALS 0x00000002
869#define wxTEXT_ATTR_EFFECT_STRIKETHROUGH 0x00000004
870#define wxTEXT_ATTR_EFFECT_DOUBLE_STRIKETHROUGH 0x00000008
871#define wxTEXT_ATTR_EFFECT_SHADOW 0x00000010
872#define wxTEXT_ATTR_EFFECT_EMBOSS 0x00000020
873#define wxTEXT_ATTR_EFFECT_OUTLINE 0x00000040
874#define wxTEXT_ATTR_EFFECT_ENGRAVE 0x00000080
875#define wxTEXT_ATTR_EFFECT_SUPERSCRIPT 0x00000100
876#define wxTEXT_ATTR_EFFECT_SUBSCRIPT 0x00000200
877\end{verbatim}
878}
879
880Of these, only wxTEXT\_ATTR\_EFFECT\_CAPITALS and wxTEXT\_ATTR\_EFFECT\_STRIKETHROUGH are implemented.
881wxTEXT\_ATTR\_EFFECT\_CAPITALS capitalises text when displayed (leaving the case of the actual buffer
882text unchanged), and wxTEXT\_ATTR\_EFFECT\_STRIKETHROUGH draws a line through text.
883
884To set effects, you should also pass wxTEXT\_ATTR\_EFFECTS to \helpref{wxTextAttr::SetFlags}{wxtextattrsetflags}, and call\rtfsp
885\helpref{wxTextAttr::SetTextEffectFlags}{wxtextattrsettexteffectflags} with the styles (taken from the
886above set) that you are interested in setting.
887
888\membersection{wxTextAttr::SetURL}\label{wxtextattrseturl}
889
890\func{void}{SetURL}{\param{const wxString\& }{url}}
891
892Sets the URL for the content. Sets the wxTEXT\_ATTR\_URL style; content with this style
893causes wxRichTextCtrl to show a hand cursor over it, and wxRichTextCtrl generates
894a wxTextUrlEvent when the content is clicked.
895
896\membersection{wxTextAttr::operator=}\label{wxtextattroperatorassign}
897
898\func{void operator}{operator=}{\param{const wxTextAttr\& }{attr}}
5f35b46a 899
44cc96a8 900Assignment from a \helpref{wxTextAttr}{wxtextattr} object.
b67a86d5 901