]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/richtextbuffer.tex
corrected EVT_NOTIFY[_RANGE] docs (bug 1439078)
[wxWidgets.git] / docs / latex / wx / richtextbuffer.tex
CommitLineData
5f35b46a
JS
1\section{\class{wxRichTextBuffer}}\label{wxrichtextbuffer}
2
3This class represents the whole buffer associated with a \helpref{wxRichTextCtrl}{wxrichtextctrl}.
4
5\wxheading{Derived from}
6
7wxRichTextParagraphLayoutBox
8
9\wxheading{Include files}
10
11<wx/richtext/richtextbuffer.h>
12
13\wxheading{Data structures}
14
15\wxheading{See also}
16
17\helpref{wxTextAttr}{wxtextattr}, \helpref{wxTextAttrEx}{wxtextattrex}, \helpref{wxRichTextAttr}{wxrichtextattr}, \helpref{wxRichTextCtrl}{wxrichtextctrl}
18
19\latexignore{\rtfignore{\wxheading{Members}}}
20
21\membersection{wxRichTextBuffer::wxRichTextBuffer}\label{wxrichtextbufferwxrichtextbuffer}
22
23\func{}{wxRichTextBuffer}{\param{const wxRichTextBuffer\& }{obj}}
24
25Copy constructor.
26
27\func{}{wxRichTextBuffer}{\void}
28
29Default constructors.
30
31\membersection{wxRichTextBuffer::\destruct{wxRichTextBuffer}}\label{wxrichtextbufferdtor}
32
33\func{}{\destruct{wxRichTextBuffer}}{\void}
34
35Destructor.
36
37\membersection{wxRichTextBuffer::AddHandler}\label{wxrichtextbufferaddhandler}
38
39\func{void}{AddHandler}{\param{wxRichTextFileHandler* }{handler}}
40
41Adds a file handler.
42
43\membersection{wxRichTextBuffer::AddParagraph}\label{wxrichtextbufferaddparagraph}
44
45\func{wxRichTextRange}{AddParagraph}{\param{const wxString\& }{text}}
46
47Adds a paragraph of text.
48
49\membersection{wxRichTextBuffer::BatchingUndo}\label{wxrichtextbufferbatchingundo}
50
51\constfunc{bool}{BatchingUndo}{\void}
52
53Returns \true if the buffer is currently collapsing commands into a single notional command.
54
55\membersection{wxRichTextBuffer::BeginAlignment}\label{wxrichtextbufferbeginalignment}
56
57\func{bool}{BeginAlignment}{\param{wxTextAttrAlignment }{alignment}}
58
59Begins using alignment.
60
61\membersection{wxRichTextBuffer::BeginBatchUndo}\label{wxrichtextbufferbeginbatchundo}
62
63\func{bool}{BeginBatchUndo}{\param{const wxString\& }{cmdName}}
64
65Begins collapsing undo/redo commands. Note that this may not work properly
66if combining commands that delete or insert content, changing ranges for
67subsequent actions.
68
69{\it cmdName} should be the name of the combined command that will appear
70next to Undo and Redo in the edit menu.
71
72\membersection{wxRichTextBuffer::BeginBold}\label{wxrichtextbufferbeginbold}
73
74\func{bool}{BeginBold}{\void}
75
76Begin applying bold.
77
78\membersection{wxRichTextBuffer::BeginCharacterStyle}\label{wxrichtextbufferbegincharacterstyle}
79
80\func{bool}{BeginCharacterStyle}{\param{const wxString\& }{characterStyle}}
81
82Begins applying the named character style.
83
84\membersection{wxRichTextBuffer::BeginFont}\label{wxrichtextbufferbeginfont}
85
86\func{bool}{BeginFont}{\param{const wxFont\& }{font}}
87
88Begins using this font.
89
90\membersection{wxRichTextBuffer::BeginFontSize}\label{wxrichtextbufferbeginfontsize}
91
92\func{bool}{BeginFontSize}{\param{int }{pointSize}}
93
94Begins using the given point size.
95
96\membersection{wxRichTextBuffer::BeginItalic}\label{wxrichtextbufferbeginitalic}
97
98\func{bool}{BeginItalic}{\void}
99
100Begins using italic.
101
102\membersection{wxRichTextBuffer::BeginLeftIndent}\label{wxrichtextbufferbeginleftindent}
103
104\func{bool}{BeginLeftIndent}{\param{int }{leftIndent}, \param{int }{leftSubIndent = 0}}
105
106Begin using {\it leftIndent} for the left indent, and optionally {\it leftSubIndent} for
107the sub-indent. Both are expressed in tenths of a millimetre.
108
109The sub-indent is an offset from the left of the paragraph, and is used for all but the
110first line in a paragraph. A positive value will cause the first line to appear to the left
111of the subsequent lines, and a negative value will cause the first line to be indented
112relative to the subsequent lines.
113
114\membersection{wxRichTextBuffer::BeginLineSpacing}\label{wxrichtextbufferbeginlinespacing}
115
116\func{bool}{BeginLineSpacing}{\param{int }{lineSpacing}}
117
118Begins line spacing using the specified value. {\it spacing} is a multiple, where 10 means single-spacing,
11915 means 1.5 spacing, and 20 means double spacing. The following constants are
120defined for convenience:
121
122{\small
123\begin{verbatim}
124#define wxTEXT_ATTR_LINE_SPACING_NORMAL 10
125#define wxTEXT_ATTR_LINE_SPACING_HALF 15
126#define wxTEXT_ATTR_LINE_SPACING_TWICE 20
127\end{verbatim}
128}
129
130\membersection{wxRichTextBuffer::BeginNumberedBullet}\label{wxrichtextbufferbeginnumberedbullet}
131
132\func{bool}{BeginNumberedBullet}{\param{int }{bulletNumber}, \param{int }{leftIndent}, \param{int }{leftSubIndent}, \param{int }{bulletStyle = wxTEXT\_ATTR\_BULLET\_STYLE\_ARABIC|wxTEXT\_ATTR\_BULLET\_STYLE\_PERIOD}}
133
134Begins a numbered bullet. This call will be needed for each item in the list, and the
135application should take care of incrementing the numbering.
136
137{\it bulletNumber} is a number, usually starting with 1.
138
139{\it leftIndent} and {\it leftSubIndent} are values in tenths of a millimetre.
140
141{\it bulletStyle} is a bitlist of the following values:
142
143{\small
144\begin{verbatim}
145#define wxTEXT_ATTR_BULLET_STYLE_NONE 0x0000
146#define wxTEXT_ATTR_BULLET_STYLE_ARABIC 0x0001
147#define wxTEXT_ATTR_BULLET_STYLE_LETTERS_UPPER 0x0002
148#define wxTEXT_ATTR_BULLET_STYLE_LETTERS_LOWER 0x0004
149#define wxTEXT_ATTR_BULLET_STYLE_ROMAN_UPPER 0x0008
150#define wxTEXT_ATTR_BULLET_STYLE_ROMAN_LOWER 0x0010
151#define wxTEXT_ATTR_BULLET_STYLE_SYMBOL 0x0020
152#define wxTEXT_ATTR_BULLET_STYLE_BITMAP 0x0040
153#define wxTEXT_ATTR_BULLET_STYLE_PARENTHESES 0x0080
154#define wxTEXT_ATTR_BULLET_STYLE_PERIOD 0x0100
155\end{verbatim}
156}
157
158wxRichTextBuffer uses indentation to render a bulleted item. The left indent is the distance between
159the margin and the bullet. The content of the paragraph, including the first line, starts
160at leftMargin + leftSubIndent. So the distance between the left edge of the bullet and the
161left of the actual paragraph is leftSubIndent.
162
163\membersection{wxRichTextBuffer::BeginParagraphSpacing}\label{wxrichtextbufferbeginparagraphspacing}
164
165\func{bool}{BeginParagraphSpacing}{\param{int }{before}, \param{int }{after}}
166
167Begins paragraph spacing; pass the before-paragraph and after-paragraph spacing in tenths of
168a millimetre.
169
170\membersection{wxRichTextBuffer::BeginParagraphStyle}\label{wxrichtextbufferbeginparagraphstyle}
171
172\func{bool}{BeginParagraphStyle}{\param{const wxString\& }{paragraphStyle}}
173
174Begins applying the named paragraph style.
175
176\membersection{wxRichTextBuffer::BeginRightIndent}\label{wxrichtextbufferbeginrightindent}
177
178\func{bool}{BeginRightIndent}{\param{int }{rightIndent}}
179
180Begins a right indent, specified in tenths of a millimetre.
181
182\membersection{wxRichTextBuffer::BeginStyle}\label{wxrichtextbufferbeginstyle}
183
184\func{bool}{BeginStyle}{\param{const wxTextAttrEx\& }{style}}
185
186Begins using a specified style.
187
188\membersection{wxRichTextBuffer::BeginSuppressUndo}\label{wxrichtextbufferbeginsuppressundo}
189
190\func{bool}{BeginSuppressUndo}{\void}
191
192Begins suppressing undo/redo commands. The way undo is suppressed may be implemented
193differently by each command. If not dealt with by a command implementation, then
194it will be implemented automatically by not storing the command in the undo history
195when the action is submitted to the command processor.
196
197\membersection{wxRichTextBuffer::BeginSymbolBullet}\label{wxrichtextbufferbeginsymbolbullet}
198
199\func{bool}{BeginSymbolBullet}{\param{wxChar }{symbol}, \param{int }{leftIndent}, \param{int }{leftSubIndent}, \param{int }{bulletStyle = wxTEXT\_ATTR\_BULLET\_STYLE\_SYMBOL}}
200
201Begins applying a symbol bullet, using a character from the current font. See \helpref{BeginNumberedBullet}{wxrichtextbufferbeginnumberedbullet} for
202an explanation of how indentation is used to render the bulleted paragraph.
203
204\membersection{wxRichTextBuffer::BeginTextColour}\label{wxrichtextbufferbegintextcolour}
205
206\func{bool}{BeginTextColour}{\param{const wxColour\& }{colour}}
207
208Begins using the specified text foreground colour.
209
210\membersection{wxRichTextBuffer::BeginUnderline}\label{wxrichtextbufferbeginunderline}
211
212\func{bool}{BeginUnderline}{\void}
213
214Begins using underline.
215
216\membersection{wxRichTextBuffer::CanPasteFromClipboard}\label{wxrichtextbuffercanpastefromclipboard}
217
218\constfunc{bool}{CanPasteFromClipboard}{\void}
219
220Returns \true if content can be pasted from the clipboard.
221
222\membersection{wxRichTextBuffer::CleanUpHandlers}\label{wxrichtextbuffercleanuphandlers}
223
224\func{void}{CleanUpHandlers}{\void}
225
226Cleans up the file handlers.
227
228\membersection{wxRichTextBuffer::Clear}\label{wxrichtextbufferclear}
229
230\func{void}{Clear}{\void}
231
232Clears the buffer and resets the command processor.
233
234\membersection{wxRichTextBuffer::ClearStyleStack}\label{wxrichtextbufferclearstylestack}
235
236\func{void}{ClearStyleStack}{\void}
237
238Clears the style stack.
239
240\membersection{wxRichTextBuffer::Clone}\label{wxrichtextbufferclone}
241
242\constfunc{wxRichTextObject*}{Clone}{\void}
243
244Clones the object.
245
246\membersection{wxRichTextBuffer::Copy}\label{wxrichtextbuffercopy}
247
248\func{void}{Copy}{\param{const wxRichTextBuffer\& }{obj}}
249
250Copies the given buffer.
251
252\membersection{wxRichTextBuffer::CopyToClipboard}\label{wxrichtextbuffercopytoclipboard}
253
254\func{bool}{CopyToClipboard}{\param{const wxRichTextRange\& }{range}}
255
256Copy the given range to the clipboard.
257
258\membersection{wxRichTextBuffer::DeleteRangeWithUndo}\label{wxrichtextbufferdeleterangewithundo}
259
260\func{bool}{DeleteRangeWithUndo}{\param{const wxRichTextRange\& }{range}, \param{long }{initialCaretPosition}, \param{long }{newCaretPositon}, \param{wxRichTextCtrl* }{ctrl}}
261
262Submits a command to delete the given range.
263
264\membersection{wxRichTextBuffer::Dump}\label{wxrichtextbufferdump}
265
266\func{void}{Dump}{\void}
267
268\func{void}{Dump}{\param{wxTextOutputStream\& }{stream}}
269
270Dumps the contents of the buffer for debugging purposes.
271
272\membersection{wxRichTextBuffer::EndAlignment}\label{wxrichtextbufferendalignment}
273
274\func{bool}{EndAlignment}{\void}
275
276Ends alignment.
277
278\membersection{wxRichTextBuffer::EndAllStyles}\label{wxrichtextbufferendallstyles}
279
280\func{bool}{EndAllStyles}{\void}
281
282Ends all styles that have been started with a Begin... command.
283
284\membersection{wxRichTextBuffer::EndBatchUndo}\label{wxrichtextbufferendbatchundo}
285
286\func{bool}{EndBatchUndo}{\void}
287
288Ends collapsing undo/redo commands, and submits the combined command.
289
290\membersection{wxRichTextBuffer::EndBold}\label{wxrichtextbufferendbold}
291
292\func{bool}{EndBold}{\void}
293
294Ends using bold.
295
296\membersection{wxRichTextBuffer::EndCharacterStyle}\label{wxrichtextbufferendcharacterstyle}
297
298\func{bool}{EndCharacterStyle}{\void}
299
300Ends using the named character style.
301
302\membersection{wxRichTextBuffer::EndFont}\label{wxrichtextbufferendfont}
303
304\func{bool}{EndFont}{\void}
305
306Ends using a font.
307
308\membersection{wxRichTextBuffer::EndFontSize}\label{wxrichtextbufferendfontsize}
309
310\func{bool}{EndFontSize}{\void}
311
312Ends using a point size.
313
314\membersection{wxRichTextBuffer::EndItalic}\label{wxrichtextbufferenditalic}
315
316\func{bool}{EndItalic}{\void}
317
318Ends using italic.
319
320\membersection{wxRichTextBuffer::EndLeftIndent}\label{wxrichtextbufferendleftindent}
321
322\func{bool}{EndLeftIndent}{\void}
323
324Ends using a left indent.
325
326\membersection{wxRichTextBuffer::EndLineSpacing}\label{wxrichtextbufferendlinespacing}
327
328\func{bool}{EndLineSpacing}{\void}
329
330Ends using a line spacing.
331
332\membersection{wxRichTextBuffer::EndNumberedBullet}\label{wxrichtextbufferendnumberedbullet}
333
334\func{bool}{EndNumberedBullet}{\void}
335
336Ends a numbered bullet.
337
338\membersection{wxRichTextBuffer::EndParagraphSpacing}\label{wxrichtextbufferendparagraphspacing}
339
340\func{bool}{EndParagraphSpacing}{\void}
341
342Ends paragraph spacing.
343
344\membersection{wxRichTextBuffer::EndParagraphStyle}\label{wxrichtextbufferendparagraphstyle}
345
346\func{bool}{EndParagraphStyle}{\void}
347
348Ends applying a named character style.
349
350\membersection{wxRichTextBuffer::EndRightIndent}\label{wxrichtextbufferendrightindent}
351
352\func{bool}{EndRightIndent}{\void}
353
354Ends using a right indent.
355
356\membersection{wxRichTextBuffer::EndStyle}\label{wxrichtextbufferendstyle}
357
358\func{bool}{EndStyle}{\void}
359
360Ends the current style.
361
362\membersection{wxRichTextBuffer::EndSuppressUndo}\label{wxrichtextbufferendsuppressundo}
363
364\func{bool}{EndSuppressUndo}{\void}
365
366Ends suppressing undo/redo commands.
367
368\membersection{wxRichTextBuffer::EndSymbolBullet}\label{wxrichtextbufferendsymbolbullet}
369
370\func{bool}{EndSymbolBullet}{\void}
371
372Ends using a symbol bullet.
373
374\membersection{wxRichTextBuffer::EndTextColour}\label{wxrichtextbufferendtextcolour}
375
376\func{bool}{EndTextColour}{\void}
377
378Ends using a text foreground colour.
379
380\membersection{wxRichTextBuffer::EndUnderline}\label{wxrichtextbufferendunderline}
381
382\func{bool}{EndUnderline}{\void}
383
384Ends using underline.
385
386\membersection{wxRichTextBuffer::FindHandler}\label{wxrichtextbufferfindhandler}
387
388\func{wxRichTextFileHandler*}{FindHandler}{\param{int }{imageType}}
389
390Finds a handler by type.
391
392\func{wxRichTextFileHandler*}{FindHandler}{\param{const wxString\& }{extension}, \param{int }{imageType}}
393
394Finds a handler by extension and type.
395
396\func{wxRichTextFileHandler*}{FindHandler}{\param{const wxString\& }{name}}
397
398Finds a handler by name.
399
400\membersection{wxRichTextBuffer::FindHandlerFilenameOrType}\label{wxrichtextbufferfindhandlerfilenameortype}
401
402\func{wxRichTextFileHandler*}{FindHandlerFilenameOrType}{\param{const wxString\& }{filename}, \param{int }{imageType}}
403
404Finds a handler by filename or, if supplied, type.
405
62a268cc
JS
406\membersection{wxRichTextBuffer::GetBasicStyle}\label{wxrichtextbuffergetbasicstyle}
407
408\constfunc{const wxTextAttrEx\&}{GetBasicStyle}{\void}
409
410Gets the basic (overall) style. This is the style of the whole
411buffer before further styles are applied, unlike the default style, which
412only affects the style currently being applied (for example, setting the default
413style to bold will cause subsequently inserted text to be bold).
414
5f35b46a
JS
415\membersection{wxRichTextBuffer::GetBatchedCommand}\label{wxrichtextbuffergetbatchedcommand}
416
417\constfunc{wxRichTextCommand*}{GetBatchedCommand}{\void}
418
419Gets the collapsed command.
420
421\membersection{wxRichTextBuffer::GetCommandProcessor}\label{wxrichtextbuffergetcommandprocessor}
422
423\constfunc{wxCommandProcessor*}{GetCommandProcessor}{\void}
424
425Gets the command processor. A text buffer always creates its own command processor when it is
426initialized.
427
62a268cc
JS
428\membersection{wxRichTextBuffer::GetDefaultStyle}\label{wxrichtextbuffergetdefaultstyle}
429
430\constfunc{const wxTextAttrEx\&}{GetDefaultStyle}{\void}
431
432Returns the current default style, affecting the style currently being applied (for example, setting the default
433style to bold will cause subsequently inserted text to be bold).
434
5f35b46a
JS
435\membersection{wxRichTextBuffer::GetExtWildcard}\label{wxrichtextbuffergetextwildcard}
436
437\func{wxString}{GetExtWildcard}{\param{bool }{combine = false}, \param{bool }{save = false}, \param{wxArrayInt* }{types = NULL}}
438
439Gets a wildcard incorporating all visible handlers. If {\it types} is present,
440it will be filled with the file type corresponding to each filter. This can be
441used to determine the type to pass to \helpref{LoadFile}{wxrichtextbuffergetextwildcard} given a selected filter.
442
443\membersection{wxRichTextBuffer::GetHandlers}\label{wxrichtextbuffergethandlers}
444
445\func{wxList\&}{GetHandlers}{\void}
446
447Returns the list of file handlers.
448
62a268cc
JS
449\membersection{wxRichTextBuffer::GetStyle}\label{wxrichtextbuffergetstyle}
450
451\func{bool}{GetStyle}{\param{long }{position}, \param{wxRichTextAttr\& }{style}}
452
453\func{bool}{GetStyle}{\param{long }{position}, \param{wxTextAttrEx\& }{style}}
454
455Gets the attributes at the given position.
456
457This function gets the combined style - that is, the style you see on the screen as a result
458of combining base style, paragraph style and character style attributes. To get the character
459or paragraph style alone, use \helpref{GetUncombinedStyle}{wxrichtextbuffergetuncombinedstyle}.
460
461\membersection{wxRichTextBuffer::GetStyleForRange}\label{wxrichtextbuffergetstyleforrange}
462
463\func{bool}{GetStyleForRange}{\param{const wxRichTextRange\&}{ range}, \param{wxTextAttrEx\& }{style}}
464
465This function gets a style representing the common, combined attributes in the given range.
466Attributes which have different values within the specified range will not be included the style
467flags.
468
469The function is used to get the attributes to display in the formatting dialog: the user
470can edit the attributes common to the selection, and optionally specify the values of further
471attributes to be applied uniformly.
472
473To apply the edited attributes, you can use \helpref{SetStyle}{wxrichtextbuffersetstyle} specifying
474the wxRICHTEXT\_SETSTYLE\_OPTIMIZE flag, which will only apply attributes that are different
475from the {\it combined} attributes within the range. So, the user edits the effective, displayed attributes
476for the range, but his choice won't be applied unnecessarily to content. As an example,
477say the style for a paragraph specifies bold, but the paragraph text doesn't specify a weight. The
478combined style is bold, and this is what the user will see on-screen and in the formatting
479dialog. The user now specifies red text, in addition to bold. When applying with
480SetStyle, the content font weight attributes won't be changed to bold because this is already specified
481by the paragraph. However the text colour attributes {\it will} be changed to
482show red.
483
5f35b46a
JS
484\membersection{wxRichTextBuffer::GetStyleSheet}\label{wxrichtextbuffergetstylesheet}
485
486\constfunc{wxRichTextStyleSheet*}{GetStyleSheet}{\void}
487
488Returns the current style sheet associated with the buffer, if any.
489
490\membersection{wxRichTextBuffer::GetStyleStackSize}\label{wxrichtextbuffergetstylestacksize}
491
492\constfunc{size\_t}{GetStyleStackSize}{\void}
493
494Get the size of the style stack, for example to check correct nesting.
495
62a268cc
JS
496\membersection{wxRichTextBuffer::GetUncombinedStyle}\label{wxrichtextbuffergetuncombinedstyle}
497
498\func{bool}{GetUncombinedStyle}{\param{long }{position}, \param{wxRichTextAttr\& }{style}}
499
500\func{bool}{GetUncombinedStyle}{\param{long }{position}, \param{wxTextAttrEx\& }{style}}
501
502Gets the attributes at the given position.
503
504This function gets the {\it uncombined style} - that is, the attributes associated with the
505paragraph or character content, and not necessarily the combined attributes you see on the
506screen. To get the combined attributes, use \helpref{GetStyle}{wxrichtextbuffergetstyle}.
507
508If you specify (any) paragraph attribute in {\it style}'s flags, this function will fetch
509the paragraph attributes. Otherwise, it will return the character attributes.
510
5f35b46a
JS
511\membersection{wxRichTextBuffer::HitTest}\label{wxrichtextbufferhittest}
512
513\func{int}{HitTest}{\param{wxDC\& }{dc}, \param{const wxPoint\& }{pt}, \param{long\& }{textPosition}}
514
515Finds the text position for the given position, putting the position in {\it textPosition} if
516one is found. {\it pt} is in logical units (a zero y position is
517at the beginning of the buffer).
518
519The function returns one of the following values:
520
521{\small
522\begin{verbatim}
523// The point was not on this object
524#define wxRICHTEXT_HITTEST_NONE 0x01
525// The point was before the position returned from HitTest
526#define wxRICHTEXT_HITTEST_BEFORE 0x02
527// The point was after the position returned from HitTest
528#define wxRICHTEXT_HITTEST_AFTER 0x04
529// The point was on the position returned from HitTest
530#define wxRICHTEXT_HITTEST_ON 0x08
531\end{verbatim}
532}
533
534\membersection{wxRichTextBuffer::Init}\label{wxrichtextbufferinit}
535
536\func{void}{Init}{\void}
537
538Initialisation.
539
540\membersection{wxRichTextBuffer::InitStandardHandlers}\label{wxrichtextbufferinitstandardhandlers}
541
542\func{void}{InitStandardHandlers}{\void}
543
544Initialises the standard handlers. Currently, only the plain text loading/saving handler
545is initialised by default.
546
547\membersection{wxRichTextBuffer::InsertHandler}\label{wxrichtextbufferinserthandler}
548
549\func{void}{InsertHandler}{\param{wxRichTextFileHandler* }{handler}}
550
551Inserts a handler at the front of the list.
552
553\membersection{wxRichTextBuffer::InsertImageWithUndo}\label{wxrichtextbufferinsertimagewithundo}
554
555\func{bool}{InsertImageWithUndo}{\param{long }{pos}, \param{const wxRichTextImageBlock\& }{imageBlock}, \param{wxRichTextCtrl* }{ctrl}}
556
557Submits a command to insert the given image.
558
559\membersection{wxRichTextBuffer::InsertNewlineWithUndo}\label{wxrichtextbufferinsertnewlinewithundo}
560
561\func{bool}{InsertNewlineWithUndo}{\param{long }{pos}, \param{wxRichTextCtrl* }{ctrl}}
562
563Submits a command to insert a newline.
564
565\membersection{wxRichTextBuffer::InsertTextWithUndo}\label{wxrichtextbufferinserttextwithundo}
566
567\func{bool}{InsertTextWithUndo}{\param{long }{pos}, \param{const wxString\& }{text}, \param{wxRichTextCtrl* }{ctrl}}
568
569Submits a command to insert the given text.
570
571\membersection{wxRichTextBuffer::IsModified}\label{wxrichtextbufferismodified}
572
573\constfunc{bool}{IsModified}{\void}
574
575Returns \true if the buffer has been modified.
576
577\membersection{wxRichTextBuffer::LoadFile}\label{wxrichtextbufferloadfile}
578
579\func{bool}{LoadFile}{\param{wxInputStream\& }{stream}, \param{int }{type = wxRICHTEXT\_TYPE\_ANY}}
580
581Loads content from a stream.
582
583\func{bool}{LoadFile}{\param{const wxString\& }{filename}, \param{int }{type = wxRICHTEXT\_TYPE\_ANY}}
584
585Loads content from a file.
586
587\membersection{wxRichTextBuffer::Modify}\label{wxrichtextbuffermodify}
588
589\func{void}{Modify}{\param{bool }{modify = true}}
590
591Marks the buffer as modified or unmodified.
592
593\membersection{wxRichTextBuffer::PasteFromClipboard}\label{wxrichtextbufferpastefromclipboard}
594
595\func{bool}{PasteFromClipboard}{\param{long }{position}}
596
597Pastes the clipboard content to the buffer at the given position.
598
599\membersection{wxRichTextBuffer::RemoveHandler}\label{wxrichtextbufferremovehandler}
600
601\func{bool}{RemoveHandler}{\param{const wxString\& }{name}}
602
603Removes a handler.
604
605\membersection{wxRichTextBuffer::Reset}\label{wxrichtextbufferreset}
606
607\func{void}{Reset}{\void}
608
609The same as \helpref{Clear}{wxrichtextbufferclear}, plus an empty paragraph is added.
610
611\membersection{wxRichTextBuffer::SaveFile}\label{wxrichtextbuffersavefile}
612
613\func{bool}{SaveFile}{\param{wxOutputStream\& }{stream}, \param{int }{type = wxRICHTEXT\_TYPE\_ANY}}
614
615Saves content to a stream.
616
617\func{bool}{SaveFile}{\param{const wxString\& }{filename}, \param{int }{type = wxRICHTEXT\_TYPE\_ANY}}
618
619Saves content to a file.
620
62a268cc
JS
621\membersection{wxRichTextBuffer::SetBasicStyle}\label{wxrichtextbuffersetbasicstyle}
622
623\func{void}{SetBasicStyle}{\param{const wxRichTextAttr\& }{style}}
624
625\func{void}{SetBasicStyle}{\param{const wxTextAttrEx\& }{style}}
626
627Sets the basic (overall) style. This is the style of the whole
628buffer before further styles are applied, unlike the default style, which
629only affects the style currently being applied (for example, setting the default
630style to bold will cause subsequently inserted text to be bold).
631
632\membersection{wxRichTextBuffer::SetDefaultStyle}\label{wxrichtextbuffersetdefaultstyle}
633
634\func{void}{SetDefaultStyle}{\param{const wxTextAttrEx\& }{style}}
635
636Sets the default style, affecting the style currently being applied (for example, setting the default
637style to bold will cause subsequently inserted text to be bold).
638
639This is not cumulative - setting the default style will replace the previous default style.
640
641\membersection{wxRichTextBuffer::SetStyle}\label{wxrichtextbuffersetstyle}
642
643\func{bool}{SetStyle}{\param{const wxRichTextRange\& }{range}, \param{const wxRichTextAttr\& }{style}, \param{int }{flags $=$ wxRICHTEXT\_SETSTYLE\_WITH\_UNDO}}
644
645\func{bool}{SetStyle}{\param{const wxRichTextRange\& }{range}, \param{const wxTextAttrEx\& }{style}, \param{int }{flags $=$ wxRICHTEXT\_SETSTYLE\_WITH\_UNDO}}
646
647Sets the attributes for the given range, passing flags to determine how the attributes are set.
648
649The end point of range is specified as the last character position of the span of text.
650So, for example, to set the style for a character at position 5, use the range (5,5).
651This differs from the wxRichTextCtrl API, where you would specify (5,6).
652
653{\it flags} may contain a bit list of the following values:
654
655\begin{verbatim}
656#define wxRICHTEXT_SETSTYLE_NONE 0x00
657
658// Specifies that this operation should be undoable
659#define wxRICHTEXT_SETSTYLE_WITH_UNDO 0x01
660
661// Specifies that the style should not be applied if the
662// combined style at this point is already the style in question.
663#define wxRICHTEXT_SETSTYLE_OPTIMIZE 0x02
664
665// Specifies that the style should only be applied to paragraphs,
666// and not the content. This allows content styling to be
667// preserved independently from that of e.g. a named paragraph style.
668#define wxRICHTEXT_SETSTYLE_PARAGRAPHS_ONLY 0x04
669
670// Specifies that the style should only be applied to characters,
671// and not the paragraph. This allows content styling to be
672// preserved independently from that of e.g. a named paragraph style.
673#define wxRICHTEXT_SETSTYLE_CHARACTERS_ONLY 0x08
674\end{verbatim}
675
5f35b46a
JS
676\membersection{wxRichTextBuffer::SetStyleSheet}\label{wxrichtextbuffersetstylesheet}
677
678\func{void}{SetStyleSheet}{\param{wxRichTextStyleSheet* }{styleSheet}}
679
680Sets the current style sheet, if any. This will allow the application to use
681named character and paragraph styles found in the style sheet.
682
683\membersection{wxRichTextBuffer::SubmitAction}\label{wxrichtextbuffersubmitaction}
684
685\func{bool}{SubmitAction}{\param{wxRichTextAction* }{action}}
686
687Submit an action immediately, or delay it according to whether collapsing is on.
688
689\membersection{wxRichTextBuffer::SuppressingUndo}\label{wxrichtextbuffersuppressingundo}
690
691\constfunc{bool}{SuppressingUndo}{\void}
692
693Returns \true if undo suppression is currently on.
694