]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/richtextattr.tex
added missing libraries to the requirements list
[wxWidgets.git] / docs / latex / wx / richtextattr.tex
CommitLineData
5f35b46a
JS
1\section{\class{wxRichTextAttr}}\label{wxrichtextattr}
2
3wxRichTextAttr represents the character and paragraph attributes, or style,
4for a range of text in a \helpref{wxRichTextCtrl}{wxrichtextctrl}. This class
5is specific to wxRichTextCtrl, although you can also use the
6standard \helpref{wxTextAttr}{wxtextattr} class with wxRichTextCtrl.
7
8When setting up a wxRichTextAttr object, pass a bitlist mask to \helpref{SetFlags}{wxrichtextattrsetflags} to
9indicate which style elements should be changed. As a convenience, when you call a setter such
1f65137f 10as SetFont, the relevant bit will be set.
5f35b46a 11
1f65137f 12wxRichTextAttr stores attributes without a wxFont object, so is a more
5f35b46a
JS
13efficient way to query styles than using a \helpref{wxTextAttr}{wxtextattr} or \helpref{wxTextAttrEx}{wxtextattrex} object.
14
15\wxheading{Derived from}
16
17No base class
18
19\wxheading{Include files}
20
21<wx/richtext/richtextbuffer.h>
22
23\wxheading{Constants}
24
1f65137f 25The following values can be passed to wxRichTextAttr::SetAlignment to determine
5f35b46a
JS
26paragraph alignment.
27
28{\small
29\begin{verbatim}
30enum wxTextAttrAlignment
31{
32 wxTEXT_ALIGNMENT_DEFAULT,
33 wxTEXT_ALIGNMENT_LEFT,
34 wxTEXT_ALIGNMENT_CENTRE,
35 wxTEXT_ALIGNMENT_CENTER = wxTEXT_ALIGNMENT_CENTRE,
36 wxTEXT_ALIGNMENT_RIGHT,
37 wxTEXT_ALIGNMENT_JUSTIFIED
38};
39\end{verbatim}
40}
41
1f65137f
JS
42Of these, wxTEXT\_ALIGNMENT\_JUSTIFIED is unimplemented. In future justification may be supported
43when printing or previewing, only.
44
45The following values are passed in a bitlist to wxRichTextAttr::SetFlags to determine
5f35b46a
JS
46what attributes will be considered when setting the attributes
47for a text control.
48
49{\small
50\begin{verbatim}
51// Standard wxTextAttr constants
52
1f65137f
JS
53#define wxTEXT_ATTR_TEXT_COLOUR 0x00000001
54#define wxTEXT_ATTR_BACKGROUND_COLOUR 0x00000002
55#define wxTEXT_ATTR_FONT_FACE 0x00000004
56#define wxTEXT_ATTR_FONT_SIZE 0x00000008
57#define wxTEXT_ATTR_FONT_WEIGHT 0x00000010
58#define wxTEXT_ATTR_FONT_ITALIC 0x00000020
59#define wxTEXT_ATTR_FONT_UNDERLINE 0x00000040
5f35b46a
JS
60#define wxTEXT_ATTR_FONT \
61 wxTEXT_ATTR_FONT_FACE | wxTEXT_ATTR_FONT_SIZE | wxTEXT_ATTR_FONT_WEIGHT \
62| wxTEXT_ATTR_FONT_ITALIC | wxTEXT_ATTR_FONT_UNDERLINE
1f65137f
JS
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
5f35b46a
JS
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
d2d0adc7
JS
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
36f01cc7 81#define wxTEXT_ATTR_PAGE_BREAK 0x00400000
1f65137f 82#define wxTEXT_ATTR_EFFECTS 0x00800000
4d6d8bf4 83#define wxTEXT_ATTR_OUTLINE_LEVEL 0x01000000
5f35b46a
JS
84\end{verbatim}
85}
86
87The following styles can be passed to wxRichTextAttr::SetBulletStyle:
88
89{\small
90\begin{verbatim}
d2d0adc7
JS
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
5f35b46a
JS
107\end{verbatim}
108}
109
1f65137f
JS
110Of these, wxTEXT\_ATTR\_BULLET\_STYLE\_BITMAP is unimplemented.
111
5f35b46a
JS
112The following constants can be passed to wxRichTextAttr::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
1f65137f
JS
122The following styles can be passed to wxTextAttrEx::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
5f35b46a
JS
142\wxheading{See also}
143
144\helpref{wxTextAttr}{wxtextattr}, \helpref{wxTextAttrEx}{wxtextattrex}, \helpref{wxRichTextCtrl}{wxrichtextctrl}
145
146\latexignore{\rtfignore{\wxheading{Members}}}
147
148\membersection{wxRichTextAttr::wxRichTextAttr}\label{wxrichtextattrwxrichtextattr}
149
150\func{}{wxRichTextAttr}{\void}
151
152\func{}{wxRichTextAttr}{\param{const wxColour\& }{colText}, \param{const wxColour\& }{colBack = wxNullColour}, \param{wxTextAttrAlignment }{alignment = wxTEXT\_ALIGNMENT\_DEFAULT}}
153
154\func{}{wxRichTextAttr}{\param{const wxTextAttrEx\& }{attr}}
155
156Constructors.
157
336d8ae9 158\membersection{wxRichTextAttr::Apply}\label{wxrichtextattrapply}
5f35b46a 159
336d8ae9 160\func{bool}{Combine}{\param{const wxRichTextAttrEx\& }{style}, \param{const wxRichTextAttrEx* }{compareWith = NULL}}
5f35b46a 161
336d8ae9
VZ
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
164See also \helpref{wxRichTextAttr::Combine}{wxrichtextattrcombine} for a function that does almost the same but returns a new object instead of modifying the original object.
165
166\membersection{wxRichTextAttr::Combine}\label{wxrichtextattrcombine}
167
168\constfunc{wxRichTextAttr}{Combine}{\param{const wxRichTextAttrEx\& }{style}, \param{const wxRichTextAttrEx* }{compareWith = NULL}}
169
170Combines 'this' with {\it style}, but not applying attributes from {\it style} that are the same as those in {\it compareWith} (if passed).
171A wxRichTextAttr object is returned and the original object is not changed.
172
173See also \helpref{wxRichTextAttr::Apply}{wxrichtextattrapply} for a function that does almost the same but modifies the original object instead of returning a new one.
5f35b46a
JS
174
175\membersection{wxRichTextAttr::CreateFont}\label{wxrichtextattrcreatefont}
176
177\constfunc{wxFont}{CreateFont}{\void}
178
179Creates a font from the font attributes.
180
181\membersection{wxRichTextAttr::GetAlignment}\label{wxrichtextattrgetalignment}
182
183\constfunc{wxTextAttrAlignment}{GetAlignment}{\void}
184
185Returns the alignment flags.
186See \helpref{wxRichTextAttr::SetAlignment}{wxrichtextattrsetalignment} for a list of available styles.
187
188\membersection{wxRichTextAttr::GetBackgroundColour}\label{wxrichtextattrgetbackgroundcolour}
189
190\constfunc{const wxColour\&}{GetBackgroundColour}{\void}
191
192Returns the background colour.
193
62a268cc
JS
194\membersection{wxRichTextAttr::GetBulletFont}\label{wxrichtextattrgetbulletfont}
195
196\constfunc{const wxString\&}{GetBulletFont}{\void}
197
198Returns a string containing the name of the font associated with the bullet symbol.
199Only valid for attributes with wxTEXT\_ATTR\_BULLET\_SYMBOL.
200
d2d0adc7
JS
201\membersection{wxRichTextAttr::GetBulletName}\label{wxrichtextattrgetbulletname}
202
203\constfunc{const wxString\&}{GetBulletName}{\void}
204
205Returns the standard bullet name, applicable if the bullet style is wxTEXT\_ATTR\_BULLET\_STYLE\_STANDARD.
206Currently the following standard bullet names are supported:
207
208\begin{itemize}\itemsep=0pt
209\item {\tt standard/circle}
210\item {\tt standard/square}
211\item {\tt standard/diamond}
212\item {\tt standard/triangle}
213\end{itemize}
214
215If you wish your application to support further bullet graphics, you can derive a
216class from wxRichTextRenderer or wxRichTextStdRenderer, override {\tt DrawStandardBullet} and {\tt EnumerateStandardBulletNames}, and
217set an instance of the class using \helpref{wxRichTextBuffer::SetRenderer}{wxrichtextbuffersetrenderer}.
218
5f35b46a
JS
219\membersection{wxRichTextAttr::GetBulletNumber}\label{wxrichtextattrgetbulletnumber}
220
221\constfunc{int}{GetBulletNumber}{\void}
222
223Returns the bullet number.
224
225\membersection{wxRichTextAttr::GetBulletStyle}\label{wxrichtextattrgetbulletstyle}
226
227\constfunc{int}{GetBulletStyle}{\void}
228
229Returns the bullet style.
230See \helpref{wxRichTextAttr::SetBulletStyle}{wxrichtextattrsetbulletstyle} for a list of available styles.
231
d2d0adc7 232\membersection{wxRichTextAttr::GetBulletText}\label{wxrichtextattrgetbullettext}
5f35b46a 233
d2d0adc7 234\constfunc{const wxString\&}{GetBulletText}{\void}
5f35b46a 235
d2d0adc7 236Returns the bullet text, which could be a symbol, or (for example) cached outline text.
5f35b46a
JS
237
238\membersection{wxRichTextAttr::GetCharacterStyleName}\label{wxrichtextattrgetcharacterstylename}
239
240\constfunc{const wxString\&}{GetCharacterStyleName}{\void}
241
242Returns the name of the character style.
243
244\membersection{wxRichTextAttr::GetFlags}\label{wxrichtextattrgetflags}
245
246\constfunc{long}{GetFlags}{\void}
247
248Returns flags indicating which attributes are applicable.
249See \helpref{wxRichTextAttr::SetFlags}{wxrichtextattrsetflags} for a list of available flags.
250
251\membersection{wxRichTextAttr::GetFontAttributes}\label{wxrichtextattrgetfontattributes}
252
253\func{bool}{GetFontAttributes}{\param{const wxFont\& }{font}}
254
255Sets the font attributes from the given font.
256
257\membersection{wxRichTextAttr::GetFontFaceName}\label{wxrichtextattrgetfontfacename}
258
259\constfunc{const wxString\&}{GetFontFaceName}{\void}
260
261Returns the font face name.
262
263\membersection{wxRichTextAttr::GetFontSize}\label{wxrichtextattrgetfontsize}
264
265\constfunc{int}{GetFontSize}{\void}
266
267Returns the font size in points.
268
269\membersection{wxRichTextAttr::GetFontStyle}\label{wxrichtextattrgetfontstyle}
270
271\constfunc{int}{GetFontStyle}{\void}
272
273Returns the font style.
274
275\membersection{wxRichTextAttr::GetFontUnderlined}\label{wxrichtextattrgetfontunderlined}
276
277\constfunc{bool}{GetFontUnderlined}{\void}
278
279Returns \true if the font is underlined.
280
281\membersection{wxRichTextAttr::GetFontWeight}\label{wxrichtextattrgetfontweight}
282
283\constfunc{int}{GetFontWeight}{\void}
284
285Returns the font weight.
286
287\membersection{wxRichTextAttr::GetLeftIndent}\label{wxrichtextattrgetleftindent}
288
289\constfunc{long}{GetLeftIndent}{\void}
290
291Returns the left indent in tenths of a millimetre.
292
293\membersection{wxRichTextAttr::GetLeftSubIndent}\label{wxrichtextattrgetleftsubindent}
294
295\constfunc{long}{GetLeftSubIndent}{\void}
296
297Returns the left sub-indent in tenths of a millimetre.
298
299\membersection{wxRichTextAttr::GetLineSpacing}\label{wxrichtextattrgetlinespacing}
300
301\constfunc{int}{GetLineSpacing}{\void}
302
303Returns the line spacing value, one of wxTEXT\_ATTR\_LINE\_SPACING\_NORMAL,
304wxTEXT\_ATTR\_LINE\_SPACING\_HALF, and wxTEXT\_ATTR\_LINE\_SPACING\_TWICE.
305
d2d0adc7
JS
306\membersection{wxRichTextAttr::GetListStyleName}\label{wxrichtextattrgetliststylename}
307
308\constfunc{const wxString\&}{GetListStyleName}{\void}
309
310Returns the name of the list style.
311
4d6d8bf4
JS
312\membersection{wxRichTextAttr::GetOutlineLevel}\label{wxrichtextattrgetoutlinelevel}
313
314\constfunc{bool}{GetOutlineLevel}{\void}
315
316Returns the outline level.
317
5f35b46a
JS
318\membersection{wxRichTextAttr::GetParagraphSpacingAfter}\label{wxrichtextattrgetparagraphspacingafter}
319
320\constfunc{int}{GetParagraphSpacingAfter}{\void}
321
322Returns the space in tenths of a millimeter after the paragraph.
323
324\membersection{wxRichTextAttr::GetParagraphSpacingBefore}\label{wxrichtextattrgetparagraphspacingbefore}
325
326\constfunc{int}{GetParagraphSpacingBefore}{\void}
327
328Returns the space in tenths of a millimeter before the paragraph.
329
330\membersection{wxRichTextAttr::GetParagraphStyleName}\label{wxrichtextattrgetparagraphstylename}
331
332\constfunc{const wxString\&}{GetParagraphStyleName}{\void}
333
334Returns the name of the paragraph style.
335
336\membersection{wxRichTextAttr::GetRightIndent}\label{wxrichtextattrgetrightindent}
337
338\constfunc{long}{GetRightIndent}{\void}
339
340Returns the right indent in tenths of a millimeter.
341
342\membersection{wxRichTextAttr::GetTabs}\label{wxrichtextattrgettabs}
343
344\constfunc{const wxArrayInt\&}{GetTabs}{\void}
345
346Returns an array of tab stops, each expressed in tenths of a millimeter. Each stop
347is measured from the left margin and therefore each value must be larger than the last.
348
349\membersection{wxRichTextAttr::GetTextColour}\label{wxrichtextattrgettextcolour}
350
351\constfunc{const wxColour\&}{GetTextColour}{\void}
352
353Returns the text foreground colour.
354
1f65137f
JS
355\membersection{wxRichTextAttr::GetTextEffectFlags}\label{wxrichtextattrgettexteffectflags}
356
357\constfunc{int}{GetTextEffectFlags}{\void}
358
359Returns the text effect bits of interest. See \helpref{wxRichTextAttr::SetFlags}{wxrichtextattrsetflags} for further information.
360
361\membersection{wxRichTextAttr::GetTextEffects}\label{wxrichtextattrgettexteffects}
362
363\constfunc{int}{GetTextEffects}{\void}
364
365Returns the text effects, a bit list of styles. See \helpref{wxRichTextAttr::SetTextEffects}{wxrichtextattrsettexteffects} for
366details.
367
d2d0adc7
JS
368\membersection{wxRichTextAttr::GetURL}\label{wxrichtextattrgeturl}
369
370\constfunc{const wxString\&}{GetURL}{\void}
371
372Returns the URL for the content. Content with wxTEXT\_ATTR\_URL style
373causes wxRichTextCtrl to show a hand cursor over it, and wxRichTextCtrl generates
374a wxTextUrlEvent when the content is clicked.
375
5f35b46a
JS
376\membersection{wxRichTextAttr::HasAlignment}\label{wxrichtextattrhasalignment}
377
378\constfunc{bool}{HasAlignment}{\void}
379
380Returns \true if the attribute object specifies alignment.
381
382\membersection{wxRichTextAttr::HasBackgroundColour}\label{wxrichtextattrhasbackgroundcolour}
383
384\constfunc{bool}{HasBackgroundColour}{\void}
385
386Returns \true if the attribute object specifies a background colour.
387
d2d0adc7
JS
388\membersection{wxRichTextAttr::HasBulletName}\label{wxrichtextattrhasbulletname}
389
390\constfunc{bool}{HasBulletName}{\void}
391
392Returns \true if the attribute object specifies a standard bullet name.
393
5f35b46a
JS
394\membersection{wxRichTextAttr::HasBulletNumber}\label{wxrichtextattrhasbulletnumber}
395
396\constfunc{bool}{HasBulletNumber}{\void}
397
398Returns \true if the attribute object specifies a bullet number.
399
400\membersection{wxRichTextAttr::HasBulletStyle}\label{wxrichtextattrhasbulletstyle}
401
402\constfunc{bool}{HasBulletStyle}{\void}
403
404Returns \true if the attribute object specifies a bullet style.
405
d2d0adc7 406\membersection{wxRichTextAttr::HasBulletText}\label{wxrichtextattrhasbullettext}
5f35b46a 407
d2d0adc7 408\constfunc{bool}{HasBulletText}{\void}
5f35b46a 409
d2d0adc7 410Returns \true if the attribute object specifies bullet text (usually specifying a symbol).
5f35b46a
JS
411
412\membersection{wxRichTextAttr::HasCharacterStyleName}\label{wxrichtextattrhascharacterstylename}
413
414\constfunc{bool}{HasCharacterStyleName}{\void}
415
416Returns \true if the attribute object specifies a character style name.
417
336d8ae9 418\membersection{wxRichTextAttr::HasFontFaceName}\label{wxrichtextattrhasfontfacename}
5f35b46a 419
336d8ae9 420\constfunc{bool}{HasFontFaceName}{\void}
5f35b46a
JS
421
422Returns \true if the attribute object specifies a font face name.
423
424\membersection{wxRichTextAttr::HasFlag}\label{wxrichtextattrhasflag}
425
426\constfunc{bool}{HasFlag}{\param{long }{flag}}
427
428Returns \true if the {\it flag} is present in the attribute object's flag bitlist.
429
430\membersection{wxRichTextAttr::HasFont}\label{wxrichtextattrhasfont}
431
432\constfunc{bool}{HasFont}{\void}
433
434Returns \true if the attribute object specifies any font attributes.
435
336d8ae9 436\membersection{wxRichTextAttr::HasFontItalic}\label{wxrichtextattrhasfontitalic}
5f35b46a 437
336d8ae9 438\constfunc{bool}{HasFontItalic}{\void}
5f35b46a
JS
439
440Returns \true if the attribute object specifies italic style.
441
442\membersection{wxRichTextAttr::HasLeftIndent}\label{wxrichtextattrhasleftindent}
443
444\constfunc{bool}{HasLeftIndent}{\void}
445
446Returns \true if the attribute object specifies a left indent.
447
448\membersection{wxRichTextAttr::HasLineSpacing}\label{wxrichtextattrhaslinespacing}
449
450\constfunc{bool}{HasLineSpacing}{\void}
451
452Returns \true if the attribute object specifies line spacing.
453
d2d0adc7
JS
454\membersection{wxRichTextAttr::HasListStyleName}\label{wxrichtextattrhasliststylename}
455
456\constfunc{bool}{HasListStyleName}{\void}
457
458Returns \true if the attribute object specifies a list style name.
459
4d6d8bf4
JS
460\membersection{wxRichTextAttr::HasOutlineLevel}\label{wxrichtextattrhasoutlinelevel}
461
462\constfunc{bool}{HasOutlineLevel}{\void}
463
464Returns \true if the attribute object specifies an outline level.
465
36f01cc7
JS
466\membersection{wxRichTextAttr::HasPageBreak}\label{wxrichtextattrhaspagebreak}
467
468\constfunc{bool}{HasPageBreak}{\void}
469
470Returns \true if the attribute object specifies a page break before this paragraph.
471
5f35b46a
JS
472\membersection{wxRichTextAttr::HasParagraphSpacingAfter}\label{wxrichtextattrhasparagraphspacingafter}
473
474\constfunc{bool}{HasParagraphSpacingAfter}{\void}
475
476Returns \true if the attribute object specifies spacing after a paragraph.
477
478\membersection{wxRichTextAttr::HasParagraphSpacingBefore}\label{wxrichtextattrhasparagraphspacingbefore}
479
480\constfunc{bool}{HasParagraphSpacingBefore}{\void}
481
482Returns \true if the attribute object specifies spacing before a paragraph.
483
484\membersection{wxRichTextAttr::HasParagraphStyleName}\label{wxrichtextattrhasparagraphstylename}
485
486\constfunc{bool}{HasParagraphStyleName}{\void}
487
488Returns \true if the attribute object specifies a paragraph style name.
489
490\membersection{wxRichTextAttr::HasRightIndent}\label{wxrichtextattrhasrightindent}
491
492\constfunc{bool}{HasRightIndent}{\void}
493
494Returns \true if the attribute object specifies a right indent.
495
336d8ae9 496\membersection{wxRichTextAttr::HasFontSize}\label{wxrichtextattrhasfontsize}
5f35b46a 497
336d8ae9 498\constfunc{bool}{HasFontSize}{\void}
5f35b46a
JS
499
500Returns \true if the attribute object specifies a font point size.
501
502\membersection{wxRichTextAttr::HasTabs}\label{wxrichtextattrhastabs}
503
504\constfunc{bool}{HasTabs}{\void}
505
506Returns \true if the attribute object specifies tab stops.
507
508\membersection{wxRichTextAttr::HasTextColour}\label{wxrichtextattrhastextcolour}
509
510\constfunc{bool}{HasTextColour}{\void}
511
512Returns \true if the attribute object specifies a text foreground colour.
513
4d6d8bf4
JS
514\membersection{wxRichTextAttr::HasTextEffects}\label{wxrichtextattrhastexteffects}
515
516\constfunc{bool}{HasTextEffects}{\void}
517
518Returns \true if the attribute object specifies text effects.
519
336d8ae9 520\membersection{wxRichTextAttr::HasFontUnderlined}\label{wxrichtextattrhasfontunderlined}
5f35b46a 521
336d8ae9 522\constfunc{bool}{HasFontUnderlined}{\void}
5f35b46a
JS
523
524Returns \true if the attribute object specifies either underlining or no underlining.
525
4d6d8bf4
JS
526\membersection{wxRichTextAttr::HasURL}\label{wxrichtextattrhasurl}
527
528\constfunc{bool}{HasURL}{\void}
529
530Returns \true if the attribute object specifies a URL.
531
336d8ae9 532\membersection{wxRichTextAttr::HasFontWeight}\label{wxrichtextattrhasfontweight}
5f35b46a 533
336d8ae9 534\constfunc{bool}{HasFontWeight}{\void}
5f35b46a
JS
535
536Returns \true if the attribute object specifies font weight (bold, light or normal).
537
5f35b46a
JS
538\membersection{wxRichTextAttr::IsCharacterStyle}\label{wxrichtextattrischaracterstyle}
539
540\constfunc{bool}{IsCharacterStyle}{\void}
541
542Returns \true if the object represents a character style, that is,
543the flags specify a font or a text background or foreground colour.
544
545\membersection{wxRichTextAttr::IsDefault}\label{wxrichtextattrisdefault}
546
547\constfunc{bool}{IsDefault}{\void}
548
549Returns \false if we have any attributes set, \true otherwise.
550
551\membersection{wxRichTextAttr::IsParagraphStyle}\label{wxrichtextattrisparagraphstyle}
552
553\constfunc{bool}{IsParagraphStyle}{\void}
554
555Returns \true if the object represents a paragraph style, that is,
556the flags specify alignment, indentation, tabs, paragraph spacing, or
557bullet style.
558
559\membersection{wxRichTextAttr::SetAlignment}\label{wxrichtextattrsetalignment}
560
561\func{void}{SetAlignment}{\param{wxTextAttrAlignment }{alignment}}
562
563Sets the paragraph alignment. These are the possible values for {\it alignment}:
564
565{\small
566\begin{verbatim}
567enum wxTextAttrAlignment
568{
569 wxTEXT_ALIGNMENT_DEFAULT,
570 wxTEXT_ALIGNMENT_LEFT,
571 wxTEXT_ALIGNMENT_CENTRE,
572 wxTEXT_ALIGNMENT_CENTER = wxTEXT_ALIGNMENT_CENTRE,
573 wxTEXT_ALIGNMENT_RIGHT,
574 wxTEXT_ALIGNMENT_JUSTIFIED
575};
576\end{verbatim}
577}
578
1f65137f
JS
579Of these, wxTEXT\_ALIGNMENT\_JUSTIFIED is unimplemented. In future justification may be supported
580when printing or previewing, only.
581
5f35b46a
JS
582\membersection{wxRichTextAttr::SetBackgroundColour}\label{wxrichtextattrsetbackgroundcolour}
583
584\func{void}{SetBackgroundColour}{\param{const wxColour\& }{colBack}}
585
586Sets the background colour.
587
62a268cc
JS
588\membersection{wxRichTextAttr::SetBulletFont}\label{wxrichtextattrsetbulletfont}
589
590\func{void}{SetBulletFont}{\param{const wxString\& }{font}}
591
592Sets the name of the font associated with the bullet symbol.
593Only valid for attributes with wxTEXT\_ATTR\_BULLET\_SYMBOL.
594
d2d0adc7
JS
595\membersection{wxRichTextAttr::SetBulletName}\label{wxrichtextattrsetbulletname}
596
597\func{void}{SetBulletName}{\param{const wxString\& }{name}}
598
599Sets the standard bullet name, applicable if the bullet style is wxTEXT\_ATTR\_BULLET\_STYLE\_STANDARD.
600See \helpref{wxRichTextAttr::GetBulletName}{wxrichtextattrgetbulletname} for a list
601of supported names, and how to expand the range of supported types.
602
5f35b46a
JS
603\membersection{wxRichTextAttr::SetBulletNumber}\label{wxrichtextattrsetbulletnumber}
604
605\func{void}{SetBulletNumber}{\param{int }{n}}
606
607Sets the bullet number.
608
609\membersection{wxRichTextAttr::SetBulletStyle}\label{wxrichtextattrsetbulletstyle}
610
611\func{void}{SetBulletStyle}{\param{int }{style}}
612
613Sets the bullet style. The following styles can be passed:
614
615{\small
616\begin{verbatim}
d2d0adc7
JS
617#define wxTEXT_ATTR_BULLET_STYLE_NONE 0x00000000
618#define wxTEXT_ATTR_BULLET_STYLE_ARABIC 0x00000001
619#define wxTEXT_ATTR_BULLET_STYLE_LETTERS_UPPER 0x00000002
620#define wxTEXT_ATTR_BULLET_STYLE_LETTERS_LOWER 0x00000004
621#define wxTEXT_ATTR_BULLET_STYLE_ROMAN_UPPER 0x00000008
622#define wxTEXT_ATTR_BULLET_STYLE_ROMAN_LOWER 0x00000010
623#define wxTEXT_ATTR_BULLET_STYLE_SYMBOL 0x00000020
624#define wxTEXT_ATTR_BULLET_STYLE_BITMAP 0x00000040
625#define wxTEXT_ATTR_BULLET_STYLE_PARENTHESES 0x00000080
626#define wxTEXT_ATTR_BULLET_STYLE_PERIOD 0x00000100
627#define wxTEXT_ATTR_BULLET_STYLE_STANDARD 0x00000200
628#define wxTEXT_ATTR_BULLET_STYLE_RIGHT_PARENTHESIS 0x00000400
629#define wxTEXT_ATTR_BULLET_STYLE_OUTLINE 0x00000800
630#define wxTEXT_ATTR_BULLET_STYLE_ALIGN_LEFT 0x00000000
631#define wxTEXT_ATTR_BULLET_STYLE_ALIGN_RIGHT 0x00001000
632#define wxTEXT_ATTR_BULLET_STYLE_ALIGN_CENTRE 0x00002000
5f35b46a
JS
633\end{verbatim}
634}
635
1f65137f
JS
636Currently wxTEXT\_ATTR\_BULLET\_STYLE\_BITMAP is not supported.
637
d2d0adc7 638\membersection{wxRichTextAttr::SetBulletText}\label{wxrichtextattrsetbullettext}
5f35b46a 639
d2d0adc7 640\func{void}{SetBulletText}{\param{const wxString& }{text}}
5f35b46a 641
d2d0adc7 642Sets the bullet text, which could be a symbol, or (for example) cached outline text.
5f35b46a
JS
643
644\membersection{wxRichTextAttr::SetCharacterStyleName}\label{wxrichtextattrsetcharacterstylename}
645
646\func{void}{SetCharacterStyleName}{\param{const wxString\& }{name}}
647
648Sets the character style name.
649
650\membersection{wxRichTextAttr::SetFlags}\label{wxrichtextattrsetflags}
651
652\func{void}{SetFlags}{\param{long }{flags}}
653
654Sets the flags determining which styles are being specified. The following
655flags can be passed in a bitlist:
656
657{\small
658\begin{verbatim}
659// Standard wxTextAttr constants
660
1f65137f
JS
661#define wxTEXT_ATTR_TEXT_COLOUR 0x00000001
662#define wxTEXT_ATTR_BACKGROUND_COLOUR 0x00000002
663#define wxTEXT_ATTR_FONT_FACE 0x00000004
664#define wxTEXT_ATTR_FONT_SIZE 0x00000008
665#define wxTEXT_ATTR_FONT_WEIGHT 0x00000010
666#define wxTEXT_ATTR_FONT_ITALIC 0x00000020
667#define wxTEXT_ATTR_FONT_UNDERLINE 0x00000040
5f35b46a
JS
668#define wxTEXT_ATTR_FONT \
669 wxTEXT_ATTR_FONT_FACE | wxTEXT_ATTR_FONT_SIZE | wxTEXT_ATTR_FONT_WEIGHT \
670| wxTEXT_ATTR_FONT_ITALIC | wxTEXT_ATTR_FONT_UNDERLINE
1f65137f
JS
671#define wxTEXT_ATTR_ALIGNMENT 0x00000080
672#define wxTEXT_ATTR_LEFT_INDENT 0x00000100
673#define wxTEXT_ATTR_RIGHT_INDENT 0x00000200
674#define wxTEXT_ATTR_TABS 0x00000400
5f35b46a
JS
675
676// Extra formatting flags not in wxTextAttr
677
678#define wxTEXT_ATTR_PARA_SPACING_AFTER 0x00000800
679#define wxTEXT_ATTR_PARA_SPACING_BEFORE 0x00001000
680#define wxTEXT_ATTR_LINE_SPACING 0x00002000
681#define wxTEXT_ATTR_CHARACTER_STYLE_NAME 0x00004000
682#define wxTEXT_ATTR_PARAGRAPH_STYLE_NAME 0x00008000
d2d0adc7
JS
683#define wxTEXT_ATTR_LIST_STYLE_NAME 0x00010000
684#define wxTEXT_ATTR_BULLET_STYLE 0x00020000
685#define wxTEXT_ATTR_BULLET_NUMBER 0x00040000
686#define wxTEXT_ATTR_BULLET_TEXT 0x00080000
687#define wxTEXT_ATTR_BULLET_NAME 0x00100000
688#define wxTEXT_ATTR_URL 0x00200000
1f65137f
JS
689#define wxTEXT_ATTR_PAGE_BREAK 0x00400000
690#define wxTEXT_ATTR_EFFECTS 0x00800000
4d6d8bf4 691#define wxTEXT_ATTR_OUTLINE_LEVEL 0x01000000
5f35b46a
JS
692\end{verbatim}
693}
694
695\membersection{wxRichTextAttr::SetFontFaceName}\label{wxrichtextattrsetfontfacename}
696
697\func{void}{SetFontFaceName}{\param{const wxString\& }{faceName}}
698
699Sets the paragraph alignment.
700
701\membersection{wxRichTextAttr::SetFontSize}\label{wxrichtextattrsetfontsize}
702
703\func{void}{SetFontSize}{\param{int }{pointSize}}
704
705Sets the font size in points.
706
707\membersection{wxRichTextAttr::SetFontStyle}\label{wxrichtextattrsetfontstyle}
708
709\func{void}{SetFontStyle}{\param{int }{fontStyle}}
710
711Sets the font style (normal, italic or slanted).
712
713\membersection{wxRichTextAttr::SetFontUnderlined}\label{wxrichtextattrsetfontunderlined}
714
715\func{void}{SetFontUnderlined}{\param{bool }{underlined}}
716
717Sets the font underlining.
718
719\membersection{wxRichTextAttr::SetFontWeight}\label{wxrichtextattrsetfontweight}
720
721\func{void}{SetFontWeight}{\param{int }{fontWeight}}
722
723Sets the font weight.
724
725\membersection{wxRichTextAttr::SetLeftIndent}\label{wxrichtextattrsetleftindent}
726
727\func{void}{SetLeftIndent}{\param{int }{indent}, \param{int }{subIndent = 0}}
728
729Sets the left indent and left subindent in tenths of a millimetre.
730
731The sub-indent is an offset from the left of the paragraph, and is used for all but the
732first line in a paragraph. A positive value will cause the first line to appear to the left
733of the subsequent lines, and a negative value will cause the first line to be indented
734relative to the subsequent lines.
735
736wxRichTextBuffer uses indentation to render a bulleted item. The left indent is the distance between
737the margin and the bullet. The content of the paragraph, including the first line, starts
738at leftMargin + leftSubIndent. So the distance between the left edge of the bullet and the
739left of the actual paragraph is leftSubIndent.
740
741\membersection{wxRichTextAttr::SetLineSpacing}\label{wxrichtextattrsetlinespacing}
742
743\func{void}{SetLineSpacing}{\param{int }{spacing}}
744
745Sets the line spacing. {\it spacing} is a multiple, where 10 means single-spacing,
74615 means 1.5 spacing, and 20 means double spacing. The following constants are
747defined for convenience:
748
749{\small
750\begin{verbatim}
751#define wxTEXT_ATTR_LINE_SPACING_NORMAL 10
752#define wxTEXT_ATTR_LINE_SPACING_HALF 15
753#define wxTEXT_ATTR_LINE_SPACING_TWICE 20
754\end{verbatim}
755}
756
d2d0adc7
JS
757\membersection{wxRichTextAttr::SetListStyleName}\label{wxrichtextattrsetliststylename}
758
759\func{void}{SetListStyleName}{\param{const wxString\& }{name}}
760
761Sets the list style name.
762
4d6d8bf4
JS
763\membersection{wxRichTextAttr::SetOutlineLevel}\label{wxrichtextattrsetoutlinelevel}
764
765\func{void}{SetOutlineLevel}{\param{int}{ level}}
766
767Specifies the outline level. Zero represents normal text. At present, the outline level is
768not used, but may be used in future for determining list levels and for applications
769that need to store document structure information.
770
36f01cc7
JS
771\membersection{wxRichTextAttr::SetPageBreak}\label{wxrichtextattrsetpagebreak}
772
773\func{void}{SetPageBreak}{\param{bool}{ pageBreak = true}}
774
775Specifies a page break before this paragraph.
776
5f35b46a
JS
777\membersection{wxRichTextAttr::SetParagraphSpacingAfter}\label{wxrichtextattrsetparagraphspacingafter}
778
779\func{void}{SetParagraphSpacingAfter}{\param{int }{spacing}}
780
781Sets the spacing after a paragraph, in tenths of a millimetre.
782
783\membersection{wxRichTextAttr::SetParagraphSpacingBefore}\label{wxrichtextattrsetparagraphspacingbefore}
784
785\func{void}{SetParagraphSpacingBefore}{\param{int }{spacing}}
786
787Sets the spacing before a paragraph, in tenths of a millimetre.
788
789\membersection{wxRichTextAttr::SetParagraphStyleName}\label{wxrichtextattrsetparagraphstylename}
790
791\func{void}{SetParagraphStyleName}{\param{const wxString\& }{name}}
792
793Sets the name of the paragraph style.
794
795\membersection{wxRichTextAttr::SetRightIndent}\label{wxrichtextattrsetrightindent}
796
797\func{void}{SetRightIndent}{\param{int }{indent}}
798
799Sets the right indent in tenths of a millimetre.
800
801\membersection{wxRichTextAttr::SetTabs}\label{wxrichtextattrsettabs}
802
803\func{void}{SetTabs}{\param{const wxArrayInt\& }{tabs}}
804
805Sets the tab stops, expressed in tenths of a millimetre.
806Each stop is measured from the left margin and therefore each value must be larger than the last.
807
808\membersection{wxRichTextAttr::SetTextColour}\label{wxrichtextattrsettextcolour}
809
810\func{void}{SetTextColour}{\param{const wxColour\& }{colText}}
811
812Sets the text foreground colout.
813
1f65137f
JS
814\membersection{wxRichTextAttr::SetTextEffectFlags}\label{wxrichtextattrsettexteffectflags}
815
816\func{void}{SetTextEffectFlags}{\param{int }{flags}}
817
818Sets the text effect bits of interest. You should also pass wxTEXT\_ATTR\_EFFECTS to \helpref{wxRichTextAttr::SetFlags}{wxrichtextattrsetflags}.
819See \helpref{wxRichTextAttr::SetFlags}{wxrichtextattrsetflags} for further information.
820
821\membersection{wxRichTextAttr::SetTextEffects}\label{wxrichtextattrsettexteffects}
822
823\func{void}{SetTextEffects}{\param{int }{effects}}
824
825Sets the text effects, a bit list of styles.
826
827The following styles can be passed:
828
829{\small
830\begin{verbatim}
831#define wxTEXT_ATTR_EFFECT_NONE 0x00000000
832#define wxTEXT_ATTR_EFFECT_CAPITALS 0x00000001
833#define wxTEXT_ATTR_EFFECT_SMALL_CAPITALS 0x00000002
834#define wxTEXT_ATTR_EFFECT_STRIKETHROUGH 0x00000004
835#define wxTEXT_ATTR_EFFECT_DOUBLE_STRIKETHROUGH 0x00000008
836#define wxTEXT_ATTR_EFFECT_SHADOW 0x00000010
837#define wxTEXT_ATTR_EFFECT_EMBOSS 0x00000020
838#define wxTEXT_ATTR_EFFECT_OUTLINE 0x00000040
839#define wxTEXT_ATTR_EFFECT_ENGRAVE 0x00000080
840#define wxTEXT_ATTR_EFFECT_SUPERSCRIPT 0x00000100
841#define wxTEXT_ATTR_EFFECT_SUBSCRIPT 0x00000200
842\end{verbatim}
843}
844
845Of these, only wxTEXT\_ATTR\_EFFECT\_CAPITALS and wxTEXT\_ATTR\_EFFECT\_STRIKETHROUGH are implemented.
846wxTEXT\_ATTR\_EFFECT\_CAPITALS capitalises text when displayed (leaving the case of the actual buffer
847text unchanged), and wxTEXT\_ATTR\_EFFECT\_STRIKETHROUGH draws a line through text.
848
849To set effects, you should also pass wxTEXT\_ATTR\_EFFECTS to \helpref{wxRichTextAttr::SetFlags}{wxrichtextattrsetflags}, and call\rtfsp
850\helpref{wxRichTextAttr::SetTextEffectFlags}{wxrichtextattrsettexteffectflags} with the styles (taken from the
851above set) that you are interested in setting.
852
d2d0adc7
JS
853\membersection{wxRichTextAttr::SetURL}\label{wxrichtextattrseturl}
854
855\func{void}{SetURL}{\param{const wxString\& }{url}}
856
857Sets the URL for the content. Sets the wxTEXT\_ATTR\_URL style; content with this style
858causes wxRichTextCtrl to show a hand cursor over it, and wxRichTextCtrl generates
859a wxTextUrlEvent when the content is clicked.
860
5f35b46a
JS
861\membersection{wxRichTextAttr::operator=}\label{wxrichtextattroperatorassign}
862
863\func{void operator}{operator=}{\param{const wxTextAttrEx\& }{attr}}
864
865Assignment from a \helpref{wxTextAttrEx}{wxtextattr} object.
866
867\func{void operator}{operator=}{\param{const wxRichTextAttr\& }{attr}}
868
869Assignment from a \helpref{wxRichTextAttr}{wxrichtextattr} object.
870
871\membersection{wxRichTextAttr::wxTextAttrEx}\label{wxrichtextattrwxtextattrex}
872
873\constfunc{operator}{wxTextAttrEx}{\void}
874
875Makes a \helpref{wxTextAttrEx}{wxtextattrex} object from this object.
62a268cc 876