]>
Commit | Line | Data |
---|---|---|
5f35b46a JS |
1 | \section{\class{wxRichTextAttr}}\label{wxrichtextattr} |
2 | ||
3 | wxRichTextAttr represents the character and paragraph attributes, or style, | |
4 | for a range of text in a \helpref{wxRichTextCtrl}{wxrichtextctrl}. This class | |
5 | is specific to wxRichTextCtrl, although you can also use the | |
6 | standard \helpref{wxTextAttr}{wxtextattr} class with wxRichTextCtrl. | |
7 | ||
8 | When setting up a wxRichTextAttr object, pass a bitlist mask to \helpref{SetFlags}{wxrichtextattrsetflags} to | |
9 | indicate which style elements should be changed. As a convenience, when you call a setter such | |
10 | s SetFont, the relevant bit will be set. | |
11 | ||
12 | wxRichTextAttr stores attributes without a wxFont object, so is a much more | |
13 | efficient way to query styles than using a \helpref{wxTextAttr}{wxtextattr} or \helpref{wxTextAttrEx}{wxtextattrex} object. | |
14 | ||
15 | \wxheading{Derived from} | |
16 | ||
17 | No base class | |
18 | ||
19 | \wxheading{Include files} | |
20 | ||
21 | <wx/richtext/richtextbuffer.h> | |
22 | ||
23 | \wxheading{Constants} | |
24 | ||
25 | The following values can be passed to SetAlignment to determine | |
26 | paragraph alignment. | |
27 | ||
28 | {\small | |
29 | \begin{verbatim} | |
30 | enum 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 | ||
42 | These values are passed in a bitlist to SetFlags to determine | |
43 | what attributes will be considered when setting the attributes | |
44 | for a text control. | |
45 | ||
46 | {\small | |
47 | \begin{verbatim} | |
48 | // Standard wxTextAttr constants | |
49 | ||
50 | #define wxTEXT_ATTR_TEXT_COLOUR 0x0001 | |
51 | #define wxTEXT_ATTR_BACKGROUND_COLOUR 0x0002 | |
52 | #define wxTEXT_ATTR_FONT_FACE 0x0004 | |
53 | #define wxTEXT_ATTR_FONT_SIZE 0x0008 | |
54 | #define wxTEXT_ATTR_FONT_WEIGHT 0x0010 | |
55 | #define wxTEXT_ATTR_FONT_ITALIC 0x0020 | |
56 | #define wxTEXT_ATTR_FONT_UNDERLINE 0x0040 | |
57 | #define wxTEXT_ATTR_FONT \ | |
58 | wxTEXT_ATTR_FONT_FACE | wxTEXT_ATTR_FONT_SIZE | wxTEXT_ATTR_FONT_WEIGHT \ | |
59 | | wxTEXT_ATTR_FONT_ITALIC | wxTEXT_ATTR_FONT_UNDERLINE | |
60 | #define wxTEXT_ATTR_ALIGNMENT 0x0080 | |
61 | #define wxTEXT_ATTR_LEFT_INDENT 0x0100 | |
62 | #define wxTEXT_ATTR_RIGHT_INDENT 0x0200 | |
63 | #define wxTEXT_ATTR_TABS 0x0400 | |
64 | ||
65 | // Extra formatting flags not in wxTextAttr | |
66 | ||
67 | #define wxTEXT_ATTR_PARA_SPACING_AFTER 0x00000800 | |
68 | #define wxTEXT_ATTR_PARA_SPACING_BEFORE 0x00001000 | |
69 | #define wxTEXT_ATTR_LINE_SPACING 0x00002000 | |
70 | #define wxTEXT_ATTR_CHARACTER_STYLE_NAME 0x00004000 | |
71 | #define wxTEXT_ATTR_PARAGRAPH_STYLE_NAME 0x00008000 | |
d2d0adc7 JS |
72 | #define wxTEXT_ATTR_LIST_STYLE_NAME 0x00010000 |
73 | #define wxTEXT_ATTR_BULLET_STYLE 0x00020000 | |
74 | #define wxTEXT_ATTR_BULLET_NUMBER 0x00040000 | |
75 | #define wxTEXT_ATTR_BULLET_TEXT 0x00080000 | |
76 | #define wxTEXT_ATTR_BULLET_NAME 0x00100000 | |
77 | #define wxTEXT_ATTR_URL 0x00200000 | |
5f35b46a JS |
78 | \end{verbatim} |
79 | } | |
80 | ||
81 | The following styles can be passed to wxRichTextAttr::SetBulletStyle: | |
82 | ||
83 | {\small | |
84 | \begin{verbatim} | |
d2d0adc7 JS |
85 | #define wxTEXT_ATTR_BULLET_STYLE_NONE 0x00000000 |
86 | #define wxTEXT_ATTR_BULLET_STYLE_ARABIC 0x00000001 | |
87 | #define wxTEXT_ATTR_BULLET_STYLE_LETTERS_UPPER 0x00000002 | |
88 | #define wxTEXT_ATTR_BULLET_STYLE_LETTERS_LOWER 0x00000004 | |
89 | #define wxTEXT_ATTR_BULLET_STYLE_ROMAN_UPPER 0x00000008 | |
90 | #define wxTEXT_ATTR_BULLET_STYLE_ROMAN_LOWER 0x00000010 | |
91 | #define wxTEXT_ATTR_BULLET_STYLE_SYMBOL 0x00000020 | |
92 | #define wxTEXT_ATTR_BULLET_STYLE_BITMAP 0x00000040 | |
93 | #define wxTEXT_ATTR_BULLET_STYLE_PARENTHESES 0x00000080 | |
94 | #define wxTEXT_ATTR_BULLET_STYLE_PERIOD 0x00000100 | |
95 | #define wxTEXT_ATTR_BULLET_STYLE_STANDARD 0x00000200 | |
96 | #define wxTEXT_ATTR_BULLET_STYLE_RIGHT_PARENTHESIS 0x00000400 | |
97 | #define wxTEXT_ATTR_BULLET_STYLE_OUTLINE 0x00000800 | |
98 | #define wxTEXT_ATTR_BULLET_STYLE_ALIGN_LEFT 0x00000000 | |
99 | #define wxTEXT_ATTR_BULLET_STYLE_ALIGN_RIGHT 0x00001000 | |
100 | #define wxTEXT_ATTR_BULLET_STYLE_ALIGN_CENTRE 0x00002000 | |
5f35b46a JS |
101 | \end{verbatim} |
102 | } | |
103 | ||
104 | The following constants can be passed to wxRichTextAttr::SetLineSpacing: | |
105 | ||
106 | {\small | |
107 | \begin{verbatim} | |
108 | #define wxTEXT_ATTR_LINE_SPACING_NORMAL 10 | |
109 | #define wxTEXT_ATTR_LINE_SPACING_HALF 15 | |
110 | #define wxTEXT_ATTR_LINE_SPACING_TWICE 20 | |
111 | \end{verbatim} | |
112 | } | |
113 | ||
114 | \wxheading{See also} | |
115 | ||
116 | \helpref{wxTextAttr}{wxtextattr}, \helpref{wxTextAttrEx}{wxtextattrex}, \helpref{wxRichTextCtrl}{wxrichtextctrl} | |
117 | ||
118 | \latexignore{\rtfignore{\wxheading{Members}}} | |
119 | ||
120 | \membersection{wxRichTextAttr::wxRichTextAttr}\label{wxrichtextattrwxrichtextattr} | |
121 | ||
122 | \func{}{wxRichTextAttr}{\void} | |
123 | ||
124 | \func{}{wxRichTextAttr}{\param{const wxColour\& }{colText}, \param{const wxColour\& }{colBack = wxNullColour}, \param{wxTextAttrAlignment }{alignment = wxTEXT\_ALIGNMENT\_DEFAULT}} | |
125 | ||
126 | \func{}{wxRichTextAttr}{\param{const wxTextAttrEx\& }{attr}} | |
127 | ||
128 | Constructors. | |
129 | ||
130 | \membersection{wxRichTextAttr::CopyTo}\label{wxrichtextattrcopyto} | |
131 | ||
132 | \constfunc{void}{CopyTo}{\param{wxTextAttrEx\& }{attr}} | |
133 | ||
134 | Copies the wxRichTextAttr attributes to a \helpref{wxTextAttrEx}{wxtextattrex} object. | |
135 | ||
136 | \membersection{wxRichTextAttr::CreateFont}\label{wxrichtextattrcreatefont} | |
137 | ||
138 | \constfunc{wxFont}{CreateFont}{\void} | |
139 | ||
140 | Creates a font from the font attributes. | |
141 | ||
142 | \membersection{wxRichTextAttr::GetAlignment}\label{wxrichtextattrgetalignment} | |
143 | ||
144 | \constfunc{wxTextAttrAlignment}{GetAlignment}{\void} | |
145 | ||
146 | Returns the alignment flags. | |
147 | See \helpref{wxRichTextAttr::SetAlignment}{wxrichtextattrsetalignment} for a list of available styles. | |
148 | ||
149 | \membersection{wxRichTextAttr::GetBackgroundColour}\label{wxrichtextattrgetbackgroundcolour} | |
150 | ||
151 | \constfunc{const wxColour\&}{GetBackgroundColour}{\void} | |
152 | ||
153 | Returns the background colour. | |
154 | ||
62a268cc JS |
155 | \membersection{wxRichTextAttr::GetBulletFont}\label{wxrichtextattrgetbulletfont} |
156 | ||
157 | \constfunc{const wxString\&}{GetBulletFont}{\void} | |
158 | ||
159 | Returns a string containing the name of the font associated with the bullet symbol. | |
160 | Only valid for attributes with wxTEXT\_ATTR\_BULLET\_SYMBOL. | |
161 | ||
d2d0adc7 JS |
162 | \membersection{wxRichTextAttr::GetBulletName}\label{wxrichtextattrgetbulletname} |
163 | ||
164 | \constfunc{const wxString\&}{GetBulletName}{\void} | |
165 | ||
166 | Returns the standard bullet name, applicable if the bullet style is wxTEXT\_ATTR\_BULLET\_STYLE\_STANDARD. | |
167 | Currently the following standard bullet names are supported: | |
168 | ||
169 | \begin{itemize}\itemsep=0pt | |
170 | \item {\tt standard/circle} | |
171 | \item {\tt standard/square} | |
172 | \item {\tt standard/diamond} | |
173 | \item {\tt standard/triangle} | |
174 | \end{itemize} | |
175 | ||
176 | If you wish your application to support further bullet graphics, you can derive a | |
177 | class from wxRichTextRenderer or wxRichTextStdRenderer, override {\tt DrawStandardBullet} and {\tt EnumerateStandardBulletNames}, and | |
178 | set an instance of the class using \helpref{wxRichTextBuffer::SetRenderer}{wxrichtextbuffersetrenderer}. | |
179 | ||
5f35b46a JS |
180 | \membersection{wxRichTextAttr::GetBulletNumber}\label{wxrichtextattrgetbulletnumber} |
181 | ||
182 | \constfunc{int}{GetBulletNumber}{\void} | |
183 | ||
184 | Returns the bullet number. | |
185 | ||
186 | \membersection{wxRichTextAttr::GetBulletStyle}\label{wxrichtextattrgetbulletstyle} | |
187 | ||
188 | \constfunc{int}{GetBulletStyle}{\void} | |
189 | ||
190 | Returns the bullet style. | |
191 | See \helpref{wxRichTextAttr::SetBulletStyle}{wxrichtextattrsetbulletstyle} for a list of available styles. | |
192 | ||
d2d0adc7 | 193 | \membersection{wxRichTextAttr::GetBulletText}\label{wxrichtextattrgetbullettext} |
5f35b46a | 194 | |
d2d0adc7 | 195 | \constfunc{const wxString\&}{GetBulletText}{\void} |
5f35b46a | 196 | |
d2d0adc7 | 197 | Returns the bullet text, which could be a symbol, or (for example) cached outline text. |
5f35b46a JS |
198 | |
199 | \membersection{wxRichTextAttr::GetCharacterStyleName}\label{wxrichtextattrgetcharacterstylename} | |
200 | ||
201 | \constfunc{const wxString\&}{GetCharacterStyleName}{\void} | |
202 | ||
203 | Returns the name of the character style. | |
204 | ||
205 | \membersection{wxRichTextAttr::GetFlags}\label{wxrichtextattrgetflags} | |
206 | ||
207 | \constfunc{long}{GetFlags}{\void} | |
208 | ||
209 | Returns flags indicating which attributes are applicable. | |
210 | See \helpref{wxRichTextAttr::SetFlags}{wxrichtextattrsetflags} for a list of available flags. | |
211 | ||
212 | \membersection{wxRichTextAttr::GetFontAttributes}\label{wxrichtextattrgetfontattributes} | |
213 | ||
214 | \func{bool}{GetFontAttributes}{\param{const wxFont\& }{font}} | |
215 | ||
216 | Sets the font attributes from the given font. | |
217 | ||
218 | \membersection{wxRichTextAttr::GetFontFaceName}\label{wxrichtextattrgetfontfacename} | |
219 | ||
220 | \constfunc{const wxString\&}{GetFontFaceName}{\void} | |
221 | ||
222 | Returns the font face name. | |
223 | ||
224 | \membersection{wxRichTextAttr::GetFontSize}\label{wxrichtextattrgetfontsize} | |
225 | ||
226 | \constfunc{int}{GetFontSize}{\void} | |
227 | ||
228 | Returns the font size in points. | |
229 | ||
230 | \membersection{wxRichTextAttr::GetFontStyle}\label{wxrichtextattrgetfontstyle} | |
231 | ||
232 | \constfunc{int}{GetFontStyle}{\void} | |
233 | ||
234 | Returns the font style. | |
235 | ||
236 | \membersection{wxRichTextAttr::GetFontUnderlined}\label{wxrichtextattrgetfontunderlined} | |
237 | ||
238 | \constfunc{bool}{GetFontUnderlined}{\void} | |
239 | ||
240 | Returns \true if the font is underlined. | |
241 | ||
242 | \membersection{wxRichTextAttr::GetFontWeight}\label{wxrichtextattrgetfontweight} | |
243 | ||
244 | \constfunc{int}{GetFontWeight}{\void} | |
245 | ||
246 | Returns the font weight. | |
247 | ||
248 | \membersection{wxRichTextAttr::GetLeftIndent}\label{wxrichtextattrgetleftindent} | |
249 | ||
250 | \constfunc{long}{GetLeftIndent}{\void} | |
251 | ||
252 | Returns the left indent in tenths of a millimetre. | |
253 | ||
254 | \membersection{wxRichTextAttr::GetLeftSubIndent}\label{wxrichtextattrgetleftsubindent} | |
255 | ||
256 | \constfunc{long}{GetLeftSubIndent}{\void} | |
257 | ||
258 | Returns the left sub-indent in tenths of a millimetre. | |
259 | ||
260 | \membersection{wxRichTextAttr::GetLineSpacing}\label{wxrichtextattrgetlinespacing} | |
261 | ||
262 | \constfunc{int}{GetLineSpacing}{\void} | |
263 | ||
264 | Returns the line spacing value, one of wxTEXT\_ATTR\_LINE\_SPACING\_NORMAL, | |
265 | wxTEXT\_ATTR\_LINE\_SPACING\_HALF, and wxTEXT\_ATTR\_LINE\_SPACING\_TWICE. | |
266 | ||
d2d0adc7 JS |
267 | \membersection{wxRichTextAttr::GetListStyleName}\label{wxrichtextattrgetliststylename} |
268 | ||
269 | \constfunc{const wxString\&}{GetListStyleName}{\void} | |
270 | ||
271 | Returns the name of the list style. | |
272 | ||
5f35b46a JS |
273 | \membersection{wxRichTextAttr::GetParagraphSpacingAfter}\label{wxrichtextattrgetparagraphspacingafter} |
274 | ||
275 | \constfunc{int}{GetParagraphSpacingAfter}{\void} | |
276 | ||
277 | Returns the space in tenths of a millimeter after the paragraph. | |
278 | ||
279 | \membersection{wxRichTextAttr::GetParagraphSpacingBefore}\label{wxrichtextattrgetparagraphspacingbefore} | |
280 | ||
281 | \constfunc{int}{GetParagraphSpacingBefore}{\void} | |
282 | ||
283 | Returns the space in tenths of a millimeter before the paragraph. | |
284 | ||
285 | \membersection{wxRichTextAttr::GetParagraphStyleName}\label{wxrichtextattrgetparagraphstylename} | |
286 | ||
287 | \constfunc{const wxString\&}{GetParagraphStyleName}{\void} | |
288 | ||
289 | Returns the name of the paragraph style. | |
290 | ||
291 | \membersection{wxRichTextAttr::GetRightIndent}\label{wxrichtextattrgetrightindent} | |
292 | ||
293 | \constfunc{long}{GetRightIndent}{\void} | |
294 | ||
295 | Returns the right indent in tenths of a millimeter. | |
296 | ||
297 | \membersection{wxRichTextAttr::GetTabs}\label{wxrichtextattrgettabs} | |
298 | ||
299 | \constfunc{const wxArrayInt\&}{GetTabs}{\void} | |
300 | ||
301 | Returns an array of tab stops, each expressed in tenths of a millimeter. Each stop | |
302 | is measured from the left margin and therefore each value must be larger than the last. | |
303 | ||
304 | \membersection{wxRichTextAttr::GetTextColour}\label{wxrichtextattrgettextcolour} | |
305 | ||
306 | \constfunc{const wxColour\&}{GetTextColour}{\void} | |
307 | ||
308 | Returns the text foreground colour. | |
309 | ||
d2d0adc7 JS |
310 | \membersection{wxRichTextAttr::GetURL}\label{wxrichtextattrgeturl} |
311 | ||
312 | \constfunc{const wxString\&}{GetURL}{\void} | |
313 | ||
314 | Returns the URL for the content. Content with wxTEXT\_ATTR\_URL style | |
315 | causes wxRichTextCtrl to show a hand cursor over it, and wxRichTextCtrl generates | |
316 | a wxTextUrlEvent when the content is clicked. | |
317 | ||
5f35b46a JS |
318 | \membersection{wxRichTextAttr::HasAlignment}\label{wxrichtextattrhasalignment} |
319 | ||
320 | \constfunc{bool}{HasAlignment}{\void} | |
321 | ||
322 | Returns \true if the attribute object specifies alignment. | |
323 | ||
324 | \membersection{wxRichTextAttr::HasBackgroundColour}\label{wxrichtextattrhasbackgroundcolour} | |
325 | ||
326 | \constfunc{bool}{HasBackgroundColour}{\void} | |
327 | ||
328 | Returns \true if the attribute object specifies a background colour. | |
329 | ||
d2d0adc7 JS |
330 | \membersection{wxRichTextAttr::HasBulletName}\label{wxrichtextattrhasbulletname} |
331 | ||
332 | \constfunc{bool}{HasBulletName}{\void} | |
333 | ||
334 | Returns \true if the attribute object specifies a standard bullet name. | |
335 | ||
5f35b46a JS |
336 | \membersection{wxRichTextAttr::HasBulletNumber}\label{wxrichtextattrhasbulletnumber} |
337 | ||
338 | \constfunc{bool}{HasBulletNumber}{\void} | |
339 | ||
340 | Returns \true if the attribute object specifies a bullet number. | |
341 | ||
342 | \membersection{wxRichTextAttr::HasBulletStyle}\label{wxrichtextattrhasbulletstyle} | |
343 | ||
344 | \constfunc{bool}{HasBulletStyle}{\void} | |
345 | ||
346 | Returns \true if the attribute object specifies a bullet style. | |
347 | ||
d2d0adc7 | 348 | \membersection{wxRichTextAttr::HasBulletText}\label{wxrichtextattrhasbullettext} |
5f35b46a | 349 | |
d2d0adc7 | 350 | \constfunc{bool}{HasBulletText}{\void} |
5f35b46a | 351 | |
d2d0adc7 | 352 | Returns \true if the attribute object specifies bullet text (usually specifying a symbol). |
5f35b46a JS |
353 | |
354 | \membersection{wxRichTextAttr::HasCharacterStyleName}\label{wxrichtextattrhascharacterstylename} | |
355 | ||
356 | \constfunc{bool}{HasCharacterStyleName}{\void} | |
357 | ||
358 | Returns \true if the attribute object specifies a character style name. | |
359 | ||
360 | \membersection{wxRichTextAttr::HasFaceName}\label{wxrichtextattrhasfacename} | |
361 | ||
362 | \constfunc{bool}{HasFaceName}{\void} | |
363 | ||
364 | Returns \true if the attribute object specifies a font face name. | |
365 | ||
366 | \membersection{wxRichTextAttr::HasFlag}\label{wxrichtextattrhasflag} | |
367 | ||
368 | \constfunc{bool}{HasFlag}{\param{long }{flag}} | |
369 | ||
370 | Returns \true if the {\it flag} is present in the attribute object's flag bitlist. | |
371 | ||
372 | \membersection{wxRichTextAttr::HasFont}\label{wxrichtextattrhasfont} | |
373 | ||
374 | \constfunc{bool}{HasFont}{\void} | |
375 | ||
376 | Returns \true if the attribute object specifies any font attributes. | |
377 | ||
378 | \membersection{wxRichTextAttr::HasItalic}\label{wxrichtextattrhasitalic} | |
379 | ||
380 | \constfunc{bool}{HasItalic}{\void} | |
381 | ||
382 | Returns \true if the attribute object specifies italic style. | |
383 | ||
384 | \membersection{wxRichTextAttr::HasLeftIndent}\label{wxrichtextattrhasleftindent} | |
385 | ||
386 | \constfunc{bool}{HasLeftIndent}{\void} | |
387 | ||
388 | Returns \true if the attribute object specifies a left indent. | |
389 | ||
390 | \membersection{wxRichTextAttr::HasLineSpacing}\label{wxrichtextattrhaslinespacing} | |
391 | ||
392 | \constfunc{bool}{HasLineSpacing}{\void} | |
393 | ||
394 | Returns \true if the attribute object specifies line spacing. | |
395 | ||
d2d0adc7 JS |
396 | \membersection{wxRichTextAttr::HasListStyleName}\label{wxrichtextattrhasliststylename} |
397 | ||
398 | \constfunc{bool}{HasListStyleName}{\void} | |
399 | ||
400 | Returns \true if the attribute object specifies a list style name. | |
401 | ||
5f35b46a JS |
402 | \membersection{wxRichTextAttr::HasParagraphSpacingAfter}\label{wxrichtextattrhasparagraphspacingafter} |
403 | ||
404 | \constfunc{bool}{HasParagraphSpacingAfter}{\void} | |
405 | ||
406 | Returns \true if the attribute object specifies spacing after a paragraph. | |
407 | ||
408 | \membersection{wxRichTextAttr::HasParagraphSpacingBefore}\label{wxrichtextattrhasparagraphspacingbefore} | |
409 | ||
410 | \constfunc{bool}{HasParagraphSpacingBefore}{\void} | |
411 | ||
412 | Returns \true if the attribute object specifies spacing before a paragraph. | |
413 | ||
414 | \membersection{wxRichTextAttr::HasParagraphStyleName}\label{wxrichtextattrhasparagraphstylename} | |
415 | ||
416 | \constfunc{bool}{HasParagraphStyleName}{\void} | |
417 | ||
418 | Returns \true if the attribute object specifies a paragraph style name. | |
419 | ||
420 | \membersection{wxRichTextAttr::HasRightIndent}\label{wxrichtextattrhasrightindent} | |
421 | ||
422 | \constfunc{bool}{HasRightIndent}{\void} | |
423 | ||
424 | Returns \true if the attribute object specifies a right indent. | |
425 | ||
426 | \membersection{wxRichTextAttr::HasSize}\label{wxrichtextattrhassize} | |
427 | ||
428 | \constfunc{bool}{HasSize}{\void} | |
429 | ||
430 | Returns \true if the attribute object specifies a font point size. | |
431 | ||
432 | \membersection{wxRichTextAttr::HasTabs}\label{wxrichtextattrhastabs} | |
433 | ||
434 | \constfunc{bool}{HasTabs}{\void} | |
435 | ||
436 | Returns \true if the attribute object specifies tab stops. | |
437 | ||
438 | \membersection{wxRichTextAttr::HasTextColour}\label{wxrichtextattrhastextcolour} | |
439 | ||
440 | \constfunc{bool}{HasTextColour}{\void} | |
441 | ||
442 | Returns \true if the attribute object specifies a text foreground colour. | |
443 | ||
444 | \membersection{wxRichTextAttr::HasUnderlined}\label{wxrichtextattrhasunderlined} | |
445 | ||
446 | \constfunc{bool}{HasUnderlined}{\void} | |
447 | ||
448 | Returns \true if the attribute object specifies either underlining or no underlining. | |
449 | ||
450 | \membersection{wxRichTextAttr::HasWeight}\label{wxrichtextattrhasweight} | |
451 | ||
452 | \constfunc{bool}{HasWeight}{\void} | |
453 | ||
454 | Returns \true if the attribute object specifies font weight (bold, light or normal). | |
455 | ||
456 | \membersection{wxRichTextAttr::Init}\label{wxrichtextattrinit} | |
457 | ||
458 | \func{void}{Init}{\void} | |
459 | ||
460 | Initialise the object. | |
461 | ||
462 | \membersection{wxRichTextAttr::IsCharacterStyle}\label{wxrichtextattrischaracterstyle} | |
463 | ||
464 | \constfunc{bool}{IsCharacterStyle}{\void} | |
465 | ||
466 | Returns \true if the object represents a character style, that is, | |
467 | the flags specify a font or a text background or foreground colour. | |
468 | ||
469 | \membersection{wxRichTextAttr::IsDefault}\label{wxrichtextattrisdefault} | |
470 | ||
471 | \constfunc{bool}{IsDefault}{\void} | |
472 | ||
473 | Returns \false if we have any attributes set, \true otherwise. | |
474 | ||
475 | \membersection{wxRichTextAttr::IsParagraphStyle}\label{wxrichtextattrisparagraphstyle} | |
476 | ||
477 | \constfunc{bool}{IsParagraphStyle}{\void} | |
478 | ||
479 | Returns \true if the object represents a paragraph style, that is, | |
480 | the flags specify alignment, indentation, tabs, paragraph spacing, or | |
481 | bullet style. | |
482 | ||
483 | \membersection{wxRichTextAttr::SetAlignment}\label{wxrichtextattrsetalignment} | |
484 | ||
485 | \func{void}{SetAlignment}{\param{wxTextAttrAlignment }{alignment}} | |
486 | ||
487 | Sets the paragraph alignment. These are the possible values for {\it alignment}: | |
488 | ||
489 | {\small | |
490 | \begin{verbatim} | |
491 | enum wxTextAttrAlignment | |
492 | { | |
493 | wxTEXT_ALIGNMENT_DEFAULT, | |
494 | wxTEXT_ALIGNMENT_LEFT, | |
495 | wxTEXT_ALIGNMENT_CENTRE, | |
496 | wxTEXT_ALIGNMENT_CENTER = wxTEXT_ALIGNMENT_CENTRE, | |
497 | wxTEXT_ALIGNMENT_RIGHT, | |
498 | wxTEXT_ALIGNMENT_JUSTIFIED | |
499 | }; | |
500 | \end{verbatim} | |
501 | } | |
502 | ||
503 | \membersection{wxRichTextAttr::SetBackgroundColour}\label{wxrichtextattrsetbackgroundcolour} | |
504 | ||
505 | \func{void}{SetBackgroundColour}{\param{const wxColour\& }{colBack}} | |
506 | ||
507 | Sets the background colour. | |
508 | ||
62a268cc JS |
509 | \membersection{wxRichTextAttr::SetBulletFont}\label{wxrichtextattrsetbulletfont} |
510 | ||
511 | \func{void}{SetBulletFont}{\param{const wxString\& }{font}} | |
512 | ||
513 | Sets the name of the font associated with the bullet symbol. | |
514 | Only valid for attributes with wxTEXT\_ATTR\_BULLET\_SYMBOL. | |
515 | ||
d2d0adc7 JS |
516 | \membersection{wxRichTextAttr::SetBulletName}\label{wxrichtextattrsetbulletname} |
517 | ||
518 | \func{void}{SetBulletName}{\param{const wxString\& }{name}} | |
519 | ||
520 | Sets the standard bullet name, applicable if the bullet style is wxTEXT\_ATTR\_BULLET\_STYLE\_STANDARD. | |
521 | See \helpref{wxRichTextAttr::GetBulletName}{wxrichtextattrgetbulletname} for a list | |
522 | of supported names, and how to expand the range of supported types. | |
523 | ||
5f35b46a JS |
524 | \membersection{wxRichTextAttr::SetBulletNumber}\label{wxrichtextattrsetbulletnumber} |
525 | ||
526 | \func{void}{SetBulletNumber}{\param{int }{n}} | |
527 | ||
528 | Sets the bullet number. | |
529 | ||
530 | \membersection{wxRichTextAttr::SetBulletStyle}\label{wxrichtextattrsetbulletstyle} | |
531 | ||
532 | \func{void}{SetBulletStyle}{\param{int }{style}} | |
533 | ||
534 | Sets the bullet style. The following styles can be passed: | |
535 | ||
536 | {\small | |
537 | \begin{verbatim} | |
d2d0adc7 JS |
538 | #define wxTEXT_ATTR_BULLET_STYLE_NONE 0x00000000 |
539 | #define wxTEXT_ATTR_BULLET_STYLE_ARABIC 0x00000001 | |
540 | #define wxTEXT_ATTR_BULLET_STYLE_LETTERS_UPPER 0x00000002 | |
541 | #define wxTEXT_ATTR_BULLET_STYLE_LETTERS_LOWER 0x00000004 | |
542 | #define wxTEXT_ATTR_BULLET_STYLE_ROMAN_UPPER 0x00000008 | |
543 | #define wxTEXT_ATTR_BULLET_STYLE_ROMAN_LOWER 0x00000010 | |
544 | #define wxTEXT_ATTR_BULLET_STYLE_SYMBOL 0x00000020 | |
545 | #define wxTEXT_ATTR_BULLET_STYLE_BITMAP 0x00000040 | |
546 | #define wxTEXT_ATTR_BULLET_STYLE_PARENTHESES 0x00000080 | |
547 | #define wxTEXT_ATTR_BULLET_STYLE_PERIOD 0x00000100 | |
548 | #define wxTEXT_ATTR_BULLET_STYLE_STANDARD 0x00000200 | |
549 | #define wxTEXT_ATTR_BULLET_STYLE_RIGHT_PARENTHESIS 0x00000400 | |
550 | #define wxTEXT_ATTR_BULLET_STYLE_OUTLINE 0x00000800 | |
551 | #define wxTEXT_ATTR_BULLET_STYLE_ALIGN_LEFT 0x00000000 | |
552 | #define wxTEXT_ATTR_BULLET_STYLE_ALIGN_RIGHT 0x00001000 | |
553 | #define wxTEXT_ATTR_BULLET_STYLE_ALIGN_CENTRE 0x00002000 | |
5f35b46a JS |
554 | \end{verbatim} |
555 | } | |
556 | ||
d2d0adc7 | 557 | \membersection{wxRichTextAttr::SetBulletText}\label{wxrichtextattrsetbullettext} |
5f35b46a | 558 | |
d2d0adc7 | 559 | \func{void}{SetBulletText}{\param{const wxString& }{text}} |
5f35b46a | 560 | |
d2d0adc7 | 561 | Sets the bullet text, which could be a symbol, or (for example) cached outline text. |
5f35b46a JS |
562 | |
563 | \membersection{wxRichTextAttr::SetCharacterStyleName}\label{wxrichtextattrsetcharacterstylename} | |
564 | ||
565 | \func{void}{SetCharacterStyleName}{\param{const wxString\& }{name}} | |
566 | ||
567 | Sets the character style name. | |
568 | ||
569 | \membersection{wxRichTextAttr::SetFlags}\label{wxrichtextattrsetflags} | |
570 | ||
571 | \func{void}{SetFlags}{\param{long }{flags}} | |
572 | ||
573 | Sets the flags determining which styles are being specified. The following | |
574 | flags can be passed in a bitlist: | |
575 | ||
576 | {\small | |
577 | \begin{verbatim} | |
578 | // Standard wxTextAttr constants | |
579 | ||
580 | #define wxTEXT_ATTR_TEXT_COLOUR 0x0001 | |
581 | #define wxTEXT_ATTR_BACKGROUND_COLOUR 0x0002 | |
582 | #define wxTEXT_ATTR_FONT_FACE 0x0004 | |
583 | #define wxTEXT_ATTR_FONT_SIZE 0x0008 | |
584 | #define wxTEXT_ATTR_FONT_WEIGHT 0x0010 | |
585 | #define wxTEXT_ATTR_FONT_ITALIC 0x0020 | |
586 | #define wxTEXT_ATTR_FONT_UNDERLINE 0x0040 | |
587 | #define wxTEXT_ATTR_FONT \ | |
588 | wxTEXT_ATTR_FONT_FACE | wxTEXT_ATTR_FONT_SIZE | wxTEXT_ATTR_FONT_WEIGHT \ | |
589 | | wxTEXT_ATTR_FONT_ITALIC | wxTEXT_ATTR_FONT_UNDERLINE | |
590 | #define wxTEXT_ATTR_ALIGNMENT 0x0080 | |
591 | #define wxTEXT_ATTR_LEFT_INDENT 0x0100 | |
592 | #define wxTEXT_ATTR_RIGHT_INDENT 0x0200 | |
593 | #define wxTEXT_ATTR_TABS 0x0400 | |
594 | ||
595 | // Extra formatting flags not in wxTextAttr | |
596 | ||
597 | #define wxTEXT_ATTR_PARA_SPACING_AFTER 0x00000800 | |
598 | #define wxTEXT_ATTR_PARA_SPACING_BEFORE 0x00001000 | |
599 | #define wxTEXT_ATTR_LINE_SPACING 0x00002000 | |
600 | #define wxTEXT_ATTR_CHARACTER_STYLE_NAME 0x00004000 | |
601 | #define wxTEXT_ATTR_PARAGRAPH_STYLE_NAME 0x00008000 | |
d2d0adc7 JS |
602 | #define wxTEXT_ATTR_LIST_STYLE_NAME 0x00010000 |
603 | #define wxTEXT_ATTR_BULLET_STYLE 0x00020000 | |
604 | #define wxTEXT_ATTR_BULLET_NUMBER 0x00040000 | |
605 | #define wxTEXT_ATTR_BULLET_TEXT 0x00080000 | |
606 | #define wxTEXT_ATTR_BULLET_NAME 0x00100000 | |
607 | #define wxTEXT_ATTR_URL 0x00200000 | |
5f35b46a JS |
608 | \end{verbatim} |
609 | } | |
610 | ||
611 | \membersection{wxRichTextAttr::SetFontFaceName}\label{wxrichtextattrsetfontfacename} | |
612 | ||
613 | \func{void}{SetFontFaceName}{\param{const wxString\& }{faceName}} | |
614 | ||
615 | Sets the paragraph alignment. | |
616 | ||
617 | \membersection{wxRichTextAttr::SetFontSize}\label{wxrichtextattrsetfontsize} | |
618 | ||
619 | \func{void}{SetFontSize}{\param{int }{pointSize}} | |
620 | ||
621 | Sets the font size in points. | |
622 | ||
623 | \membersection{wxRichTextAttr::SetFontStyle}\label{wxrichtextattrsetfontstyle} | |
624 | ||
625 | \func{void}{SetFontStyle}{\param{int }{fontStyle}} | |
626 | ||
627 | Sets the font style (normal, italic or slanted). | |
628 | ||
629 | \membersection{wxRichTextAttr::SetFontUnderlined}\label{wxrichtextattrsetfontunderlined} | |
630 | ||
631 | \func{void}{SetFontUnderlined}{\param{bool }{underlined}} | |
632 | ||
633 | Sets the font underlining. | |
634 | ||
635 | \membersection{wxRichTextAttr::SetFontWeight}\label{wxrichtextattrsetfontweight} | |
636 | ||
637 | \func{void}{SetFontWeight}{\param{int }{fontWeight}} | |
638 | ||
639 | Sets the font weight. | |
640 | ||
641 | \membersection{wxRichTextAttr::SetLeftIndent}\label{wxrichtextattrsetleftindent} | |
642 | ||
643 | \func{void}{SetLeftIndent}{\param{int }{indent}, \param{int }{subIndent = 0}} | |
644 | ||
645 | Sets the left indent and left subindent in tenths of a millimetre. | |
646 | ||
647 | The sub-indent is an offset from the left of the paragraph, and is used for all but the | |
648 | first line in a paragraph. A positive value will cause the first line to appear to the left | |
649 | of the subsequent lines, and a negative value will cause the first line to be indented | |
650 | relative to the subsequent lines. | |
651 | ||
652 | wxRichTextBuffer uses indentation to render a bulleted item. The left indent is the distance between | |
653 | the margin and the bullet. The content of the paragraph, including the first line, starts | |
654 | at leftMargin + leftSubIndent. So the distance between the left edge of the bullet and the | |
655 | left of the actual paragraph is leftSubIndent. | |
656 | ||
657 | \membersection{wxRichTextAttr::SetLineSpacing}\label{wxrichtextattrsetlinespacing} | |
658 | ||
659 | \func{void}{SetLineSpacing}{\param{int }{spacing}} | |
660 | ||
661 | Sets the line spacing. {\it spacing} is a multiple, where 10 means single-spacing, | |
662 | 15 means 1.5 spacing, and 20 means double spacing. The following constants are | |
663 | defined for convenience: | |
664 | ||
665 | {\small | |
666 | \begin{verbatim} | |
667 | #define wxTEXT_ATTR_LINE_SPACING_NORMAL 10 | |
668 | #define wxTEXT_ATTR_LINE_SPACING_HALF 15 | |
669 | #define wxTEXT_ATTR_LINE_SPACING_TWICE 20 | |
670 | \end{verbatim} | |
671 | } | |
672 | ||
d2d0adc7 JS |
673 | \membersection{wxRichTextAttr::SetListStyleName}\label{wxrichtextattrsetliststylename} |
674 | ||
675 | \func{void}{SetListStyleName}{\param{const wxString\& }{name}} | |
676 | ||
677 | Sets the list style name. | |
678 | ||
5f35b46a JS |
679 | \membersection{wxRichTextAttr::SetParagraphSpacingAfter}\label{wxrichtextattrsetparagraphspacingafter} |
680 | ||
681 | \func{void}{SetParagraphSpacingAfter}{\param{int }{spacing}} | |
682 | ||
683 | Sets the spacing after a paragraph, in tenths of a millimetre. | |
684 | ||
685 | \membersection{wxRichTextAttr::SetParagraphSpacingBefore}\label{wxrichtextattrsetparagraphspacingbefore} | |
686 | ||
687 | \func{void}{SetParagraphSpacingBefore}{\param{int }{spacing}} | |
688 | ||
689 | Sets the spacing before a paragraph, in tenths of a millimetre. | |
690 | ||
691 | \membersection{wxRichTextAttr::SetParagraphStyleName}\label{wxrichtextattrsetparagraphstylename} | |
692 | ||
693 | \func{void}{SetParagraphStyleName}{\param{const wxString\& }{name}} | |
694 | ||
695 | Sets the name of the paragraph style. | |
696 | ||
697 | \membersection{wxRichTextAttr::SetRightIndent}\label{wxrichtextattrsetrightindent} | |
698 | ||
699 | \func{void}{SetRightIndent}{\param{int }{indent}} | |
700 | ||
701 | Sets the right indent in tenths of a millimetre. | |
702 | ||
703 | \membersection{wxRichTextAttr::SetTabs}\label{wxrichtextattrsettabs} | |
704 | ||
705 | \func{void}{SetTabs}{\param{const wxArrayInt\& }{tabs}} | |
706 | ||
707 | Sets the tab stops, expressed in tenths of a millimetre. | |
708 | Each stop is measured from the left margin and therefore each value must be larger than the last. | |
709 | ||
710 | \membersection{wxRichTextAttr::SetTextColour}\label{wxrichtextattrsettextcolour} | |
711 | ||
712 | \func{void}{SetTextColour}{\param{const wxColour\& }{colText}} | |
713 | ||
714 | Sets the text foreground colout. | |
715 | ||
d2d0adc7 JS |
716 | \membersection{wxRichTextAttr::SetURL}\label{wxrichtextattrseturl} |
717 | ||
718 | \func{void}{SetURL}{\param{const wxString\& }{url}} | |
719 | ||
720 | Sets the URL for the content. Sets the wxTEXT\_ATTR\_URL style; content with this style | |
721 | causes wxRichTextCtrl to show a hand cursor over it, and wxRichTextCtrl generates | |
722 | a wxTextUrlEvent when the content is clicked. | |
723 | ||
5f35b46a JS |
724 | \membersection{wxRichTextAttr::operator=}\label{wxrichtextattroperatorassign} |
725 | ||
726 | \func{void operator}{operator=}{\param{const wxTextAttrEx\& }{attr}} | |
727 | ||
728 | Assignment from a \helpref{wxTextAttrEx}{wxtextattr} object. | |
729 | ||
730 | \func{void operator}{operator=}{\param{const wxRichTextAttr\& }{attr}} | |
731 | ||
732 | Assignment from a \helpref{wxRichTextAttr}{wxrichtextattr} object. | |
733 | ||
734 | \membersection{wxRichTextAttr::wxTextAttrEx}\label{wxrichtextattrwxtextattrex} | |
735 | ||
736 | \constfunc{operator}{wxTextAttrEx}{\void} | |
737 | ||
738 | Makes a \helpref{wxTextAttrEx}{wxtextattrex} object from this object. | |
62a268cc | 739 |