1 \section{\class{wxRichTextCtrl
}}\label{wxrichtextctrl
}
3 wxRichTextCtrl provides a generic, ground-up implementation of a text control
4 capable of showing multiple styles and images.
6 \wxheading{Derived from
}
10 \wxheading{Include files
}
12 <wx/richtext/richtextctrl.h>
14 \wxheading{Data structures
}
16 \latexignore{\rtfignore{\wxheading{Members
}}}
18 \membersection{wxRichTextCtrl::wxRichTextCtrl
}\label{wxrichtextctrlwxrichtextctrl
}
20 \func{}{wxRichTextCtrl
}{\void}
22 \func{}{wxRichTextCtrl
}{\param{wxWindow*
}{parent
},
\param{wxWindowID
}{id = wxID
\_ANY},
\param{const wxString\&
}{value = wxEmptyString
},
23 \param{const wxPoint\&
}{pos = wxDefaultPosition
},
\param{const wxSize\&
}{size = wxDefaultSize
},
\param{long
}{style = wxRE
\_MULTILINE},
24 \param{const wxValidator\&
}{validator = wxDefaultValidator
},
\param{const wxString\&
}{name = wxTextCtrlNameStr
}}
28 \membersection{wxRichTextCtrl::
\destruct{wxRichTextCtrl
}}\label{wxrichtextctrldtor
}
30 \func{}{\destruct{wxRichTextCtrl
}}{\void}
34 \membersection{wxRichTextCtrl::AddImage
}\label{wxrichtextctrladdimage
}
36 \func{wxRichTextRange
}{AddImage
}{\param{const wxImage\&
}{image
}}
38 Adds an image to the control's buffer.
40 \membersection{wxRichTextCtrl::AddParagraph
}\label{wxrichtextctrladdparagraph
}
42 \func{wxRichTextRange
}{AddParagraph
}{\param{const wxString\&
}{text
}}
44 Adds a new paragraph of text to the end of the buffer.
46 \membersection{wxRichTextCtrl::AppendText
}\label{wxrichtextctrlappendtext
}
48 \func{void
}{AppendText
}{\param{const wxString\&
}{text
}}
50 Sets the insertion point to the end of the buffer and writes the text.
52 \membersection{wxRichTextCtrl::ApplyAlignmentToSelection
}\label{wxrichtextctrlapplyalignmenttoselection
}
54 \func{bool
}{ApplyAlignmentToSelection
}{\param{wxTextAttrAlignment
}{alignment
}}
56 Applies the given alignment to the selection (undoable).
58 For alignment values, see
\helpref{wxTextAttrEx
}{wxtextattrex
}.
60 \membersection{wxRichTextCtrl::ApplyBoldToSelection
}\label{wxrichtextctrlapplyboldtoselection
}
62 \func{bool
}{ApplyBoldToSelection
}{\void}
64 Apples bold to the selection (undoable).
66 \membersection{wxRichTextCtrl::ApplyItalicToSelection
}\label{wxrichtextctrlapplyitalictoselection
}
68 \func{bool
}{ApplyItalicToSelection
}{\void}
70 Applies italic to the selection (undoable).
72 \membersection{wxRichTextCtrl::ApplyStyle
}\label{wxrichtextctrlapplystyle
}
74 \func{bool
}{ApplyStyle
}{\param{wxRichTextStyleDefinition*
}{ def
}}
76 Applies the given style to the selection.
78 \membersection{wxRichTextCtrl::ApplyStyleSheet
}\label{wxrichtextctrlapplystylesheet
}
80 \func{bool
}{ApplyStyleSheet
}{\param{wxRichTextStyleSheet*
}{ sheet $=$ NULL
}}
82 Applies the style sheet to the buffer, matching paragraph styles in the sheet against named styles
83 in the buffer. This might be useful if the styles have changed. If
{\it sheet
} is NULL, the
84 sheet set with SetStyleSheet is used.
86 Currently this applies paragraph styles only.
88 \membersection{wxRichTextCtrl::ApplyUnderlineToSelection
}\label{wxrichtextctrlapplyunderlinetoselection
}
90 \func{bool
}{ApplyUnderlineToSelection
}{\void}
92 Applies underline to the selection (undoable).
94 \membersection{wxRichTextCtrl::BatchingUndo
}\label{wxrichtextctrlbatchingundo
}
96 \constfunc{bool
}{BatchingUndo
}{\void}
98 Returns
\true if undo commands are being batched.
100 \membersection{wxRichTextCtrl::BeginAlignment
}\label{wxrichtextctrlbeginalignment
}
102 \func{bool
}{BeginAlignment
}{\param{wxTextAttrAlignment
}{alignment
}}
104 Begins using alignment
106 For alignment values, see
\helpref{wxTextAttrEx
}{wxtextattrex
}.
108 \membersection{wxRichTextCtrl::BeginBatchUndo
}\label{wxrichtextctrlbeginbatchundo
}
110 \func{bool
}{BeginBatchUndo
}{\param{const wxString\&
}{cmdName
}}
112 Starts batching undo history for commands.
114 \membersection{wxRichTextCtrl::BeginBold
}\label{wxrichtextctrlbeginbold
}
116 \func{bool
}{BeginBold
}{\void}
120 \membersection{wxRichTextCtrl::BeginCharacterStyle
}\label{wxrichtextctrlbegincharacterstyle
}
122 \func{bool
}{BeginCharacterStyle
}{\param{const wxString\&
}{characterStyle
}}
124 Begins using the named character style.
126 \membersection{wxRichTextCtrl::BeginFont
}\label{wxrichtextctrlbeginfont
}
128 \func{bool
}{BeginFont
}{\param{const wxFont\&
}{font
}}
130 Begins using this font.
132 \membersection{wxRichTextCtrl::BeginFontSize
}\label{wxrichtextctrlbeginfontsize
}
134 \func{bool
}{BeginFontSize
}{\param{int
}{pointSize
}}
136 Begins using the given point size.
138 \membersection{wxRichTextCtrl::BeginItalic
}\label{wxrichtextctrlbeginitalic
}
140 \func{bool
}{BeginItalic
}{\void}
144 \membersection{wxRichTextCtrl::BeginLeftIndent
}\label{wxrichtextctrlbeginleftindent
}
146 \func{bool
}{BeginLeftIndent
}{\param{int
}{leftIndent
},
\param{int
}{leftSubIndent =
0}}
148 Begins applying a left indent and subindent in tenths of a millimetre.
150 The sub-indent is an offset from the left of the paragraph, and is used for all but the
151 first line in a paragraph. A positive value will cause the first line to appear to the left
152 of the subsequent lines, and a negative value will cause the first line to be indented
153 relative to the subsequent lines.
155 wxRichTextBuffer uses indentation to render a bulleted item. The left indent is the distance between
156 the margin and the bullet. The content of the paragraph, including the first line, starts
157 at leftMargin + leftSubIndent. So the distance between the left edge of the bullet and the
158 left of the actual paragraph is leftSubIndent.
160 \membersection{wxRichTextCtrl::BeginLineSpacing
}\label{wxrichtextctrlbeginlinespacing
}
162 \func{bool
}{BeginLineSpacing
}{\param{int
}{lineSpacing
}}
164 Begins appling line spacing.
{\it spacing
} is a multiple, where
10 means single-spacing,
165 15 means
1.5 spacing, and
20 means double spacing. The following constants are
166 defined for convenience:
170 #define wxTEXT_ATTR_LINE_SPACING_NORMAL
10
171 #define wxTEXT_ATTR_LINE_SPACING_HALF
15
172 #define wxTEXT_ATTR_LINE_SPACING_TWICE
20
176 \membersection{wxRichTextCtrl::BeginListStyle
}\label{wxrichtextctrlbeginliststyle
}
178 \func{bool
}{BeginListStyle
}{\param{const wxString\&
}{ listStyle
},
\param{int
}{ level=
1},
\param{int
}{ number=
1}}
180 Begins using a specified list style. Optionally, you can also pass a level and a number.
182 \membersection{wxRichTextCtrl::BeginNumberedBullet
}\label{wxrichtextctrlbeginnumberedbullet
}
184 \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}}
186 Begins a numbered bullet. This call will be needed for each item in the list, and the
187 application should take care of incrementing the numbering.
189 {\it bulletNumber
} is a number, usually starting with
1.
191 {\it leftIndent
} and
{\it leftSubIndent
} are values in tenths of a millimetre.
193 {\it bulletStyle
} is a bitlist of the following values:
197 #define wxTEXT_ATTR_BULLET_STYLE_NONE
0x00000000
198 #define wxTEXT_ATTR_BULLET_STYLE_ARABIC
0x00000001
199 #define wxTEXT_ATTR_BULLET_STYLE_LETTERS_UPPER
0x00000002
200 #define wxTEXT_ATTR_BULLET_STYLE_LETTERS_LOWER
0x00000004
201 #define wxTEXT_ATTR_BULLET_STYLE_ROMAN_UPPER
0x00000008
202 #define wxTEXT_ATTR_BULLET_STYLE_ROMAN_LOWER
0x00000010
203 #define wxTEXT_ATTR_BULLET_STYLE_SYMBOL
0x00000020
204 #define wxTEXT_ATTR_BULLET_STYLE_BITMAP
0x00000040
205 #define wxTEXT_ATTR_BULLET_STYLE_PARENTHESES
0x00000080
206 #define wxTEXT_ATTR_BULLET_STYLE_PERIOD
0x00000100
207 #define wxTEXT_ATTR_BULLET_STYLE_STANDARD
0x00000200
208 #define wxTEXT_ATTR_BULLET_STYLE_RIGHT_PARENTHESIS
0x00000400
209 #define wxTEXT_ATTR_BULLET_STYLE_OUTLINE
0x00000800
210 #define wxTEXT_ATTR_BULLET_STYLE_ALIGN_LEFT
0x00000000
211 #define wxTEXT_ATTR_BULLET_STYLE_ALIGN_RIGHT
0x00001000
212 #define wxTEXT_ATTR_BULLET_STYLE_ALIGN_CENTRE
0x00002000
216 wxRichTextBuffer uses indentation to render a bulleted item. The left indent is the distance between
217 the margin and the bullet. The content of the paragraph, including the first line, starts
218 at leftMargin + leftSubIndent. So the distance between the left edge of the bullet and the
219 left of the actual paragraph is leftSubIndent.
221 \membersection{wxRichTextCtrl::BeginParagraphSpacing
}\label{wxrichtextctrlbeginparagraphspacing
}
223 \func{bool
}{BeginParagraphSpacing
}{\param{int
}{before
},
\param{int
}{after
}}
225 Begins paragraph spacing; pass the before-paragraph and after-paragraph spacing in tenths of
228 \membersection{wxRichTextCtrl::BeginParagraphStyle
}\label{wxrichtextctrlbeginparagraphstyle
}
230 \func{bool
}{BeginParagraphStyle
}{\param{const wxString\&
}{paragraphStyle
}}
232 Begins applying the named paragraph style.
234 \membersection{wxRichTextCtrl::BeginRightIndent
}\label{wxrichtextctrlbeginrightindent
}
236 \func{bool
}{BeginRightIndent
}{\param{int
}{rightIndent
}}
238 Begins a right indent, specified in tenths of a millimetre.
240 \membersection{wxRichTextCtrl::BeginStyle
}\label{wxrichtextctrlbeginstyle
}
242 \func{bool
}{BeginStyle
}{\param{const wxTextAttrEx\&
}{style
}}
244 Begins applying a style.
246 \membersection{wxRichTextCtrl::BeginSuppressUndo
}\label{wxrichtextctrlbeginsuppressundo
}
248 \func{bool
}{BeginSuppressUndo
}{\void}
250 Starts suppressing undo history for commands.
252 \membersection{wxRichTextCtrl::BeginSymbolBullet
}\label{wxrichtextctrlbeginsymbolbullet
}
254 \func{bool
}{BeginSymbolBullet
}{\param{wxChar
}{symbol
},
\param{int
}{leftIndent
},
\param{int
}{leftSubIndent
},
\param{int
}{bulletStyle = wxTEXT
\_ATTR\_BULLET\_STYLE\_SYMBOL}}
256 Begins applying a symbol bullet, using a character from the current font. See
\helpref{BeginNumberedBullet
}{wxrichtextctrlbeginnumberedbullet
} for
257 an explanation of how indentation is used to render the bulleted paragraph.
259 \membersection{wxRichTextCtrl::BeginTextColour
}\label{wxrichtextctrlbegintextcolour
}
261 \func{bool
}{BeginTextColour
}{\param{const wxColour\&
}{colour
}}
263 Begins using this colour.
265 \membersection{wxRichTextCtrl::BeginUnderline
}\label{wxrichtextctrlbeginunderline
}
267 \func{bool
}{BeginUnderline
}{\void}
269 Begins using underlining.
271 \membersection{wxRichTextCtrl::BeginURL
}\label{wxrichtextctrlbeginurl
}
273 \func{bool
}{BeginURL
}{\param{const wxString\&
}{ url
},
\param{const wxString\&
}{ characterStyle = wxEmptyString
}}
275 Begins applying wxTEXT
\_ATTR\_URL to the content. Pass a URL and optionally, a character style to apply,
276 since it is common to mark a URL with a familiar style such as blue text with underlining.
278 \membersection{wxRichTextCtrl::CanCopy
}\label{wxrichtextctrlcancopy
}
280 \constfunc{bool
}{CanCopy
}{\void}
282 Returns
\true if selected content can be copied to the clipboard.
284 \membersection{wxRichTextCtrl::CanCut
}\label{wxrichtextctrlcancut
}
286 \constfunc{bool
}{CanCut
}{\void}
288 Returns
\true if selected content can be copied to the clipboard and deleted.
290 \membersection{wxRichTextCtrl::CanDeleteSelection
}\label{wxrichtextctrlcandeleteselection
}
292 \constfunc{bool
}{CanDeleteSelection
}{\void}
294 Returns
\true if selected content can be deleted.
296 \membersection{wxRichTextCtrl::CanPaste
}\label{wxrichtextctrlcanpaste
}
298 \constfunc{bool
}{CanPaste
}{\void}
300 Returns
\true if the clipboard content can be pasted to the buffer.
302 \membersection{wxRichTextCtrl::CanRedo
}\label{wxrichtextctrlcanredo
}
304 \constfunc{bool
}{CanRedo
}{\void}
306 Returns
\true if there is a command in the command history that can be redone.
308 \membersection{wxRichTextCtrl::CanUndo
}\label{wxrichtextctrlcanundo
}
310 \constfunc{bool
}{CanUndo
}{\void}
312 Returns
\true if there is a command in the command history that can be undone.
314 \membersection{wxRichTextCtrl::Clear
}\label{wxrichtextctrlclear
}
316 \func{void
}{Clear
}{\void}
318 Clears the buffer content, leaving a single empty paragraph. Cannot be undone.
320 \membersection{wxRichTextCtrl::ClearListStyle
}\label{wxrichtextctrlclearliststyle
}
322 \func{bool
}{ClearListStyle
}{\param{const wxRichTextRange\&
}{range
},
\param{int
}{flags $=$ wxRICHTEXT
\_SETSTYLE\_WITH\_UNDO}}
324 \func{bool
}{ClearListStyle
}{\param{const wxRichTextRange\&
}{range
},
\param{int
}{flags $=$ wxRICHTEXT
\_SETSTYLE\_WITH\_UNDO}}
326 Clears the list style from the given range, clearing list-related attributes and applying any named paragraph style associated with each paragraph.
328 {\it flags
} is a bit list of the following:
330 \begin{itemize
}\itemsep=
0pt
331 \item wxRICHTEXT
\_SETSTYLE\_WITH\_UNDO: specifies that this command will be undoable.
334 See also
\helpref{wxRichTextCtrl::SetListStyle
}{wxrichtextctrlsetliststyle
},
\helpref{wxRichTextCtrl::PromoteList
}{wxrichtextctrlpromotelist
},
\helpref{wxRichTextCtrl::NumberList
}{wxrichtextctrlnumberlist
}.
336 \membersection{wxRichTextCtrl::Command
}\label{wxrichtextctrlcommand
}
338 \func{void
}{Command
}{\param{wxCommandEvent\&
}{event
}}
340 Sends the event to the control.
342 \membersection{wxRichTextCtrl::Copy
}\label{wxrichtextctrlcopy
}
344 \func{void
}{Copy
}{\void}
346 Copies the selected content (if any) to the clipboard.
348 \membersection{wxRichTextCtrl::Create
}\label{wxrichtextctrlcreate
}
350 \func{bool
}{Create
}{\param{wxWindow*
}{parent
},
\param{wxWindowID
}{id = wxID
\_ANY},
\param{const wxString\&
}{value = wxEmptyString
},
351 \param{const wxPoint\&
}{pos = wxDefaultPosition
},
\param{const wxSize\&
}{size = wxDefaultSize
},
\param{long
}{style = wxRE
\_MULTILINE},
352 \param{const wxValidator\&
}{validator = wxDefaultValidator
},
\param{const wxString\&
}{name = wxTextCtrlNameStr
}}
354 Creates the underlying window.
356 \membersection{wxRichTextCtrl::Cut
}\label{wxrichtextctrlcut
}
358 \func{void
}{Cut
}{\void}
360 Copies the selected content (if any) to the clipboard and deletes the selection.
363 \membersection{wxRichTextCtrl::DeleteSelectedContent
}\label{wxrichtextctrldeleteselectedcontent
}
365 \func{bool
}{DeleteSelectedContent
}{\param{long*
}{newPos = NULL
}}
367 Deletes content if there is a selection, e.g. when pressing a key.
368 Returns the new caret position in
{\it newPos
}, or leaves it if there
369 was no action. This is undoable.
371 \membersection{wxRichTextCtrl::DeleteSelection
}\label{wxrichtextctrldeleteselection
}
373 \func{void
}{DeleteSelection
}{\void}
375 Deletes the content in the selection, if any. This is undoable.
377 \membersection{wxRichTextCtrl::DiscardEdits
}\label{wxrichtextctrldiscardedits
}
379 \func{void
}{DiscardEdits
}{\void}
381 Sets the buffer's modified status to
\false, and clears the buffer's command history.
383 \membersection{wxRichTextCtrl::DoGetBestSize
}\label{wxrichtextctrldogetbestsize
}
385 \constfunc{wxSize
}{DoGetBestSize
}{\void}
387 Currently this simply returns
{\tt wxSize(
10,
10)
}.
389 \membersection{wxRichTextCtrl::EndAlignment
}\label{wxrichtextctrlendalignment
}
391 \func{bool
}{EndAlignment
}{\void}
395 \membersection{wxRichTextCtrl::EndAllStyles
}\label{wxrichtextctrlendallstyles
}
397 \func{bool
}{EndAllStyles
}{\void}
399 Ends application of all styles in the current style stack.
401 \membersection{wxRichTextCtrl::EndBatchUndo
}\label{wxrichtextctrlendbatchundo
}
403 \func{bool
}{EndBatchUndo
}{\void}
405 Ends batching undo command history.
407 \membersection{wxRichTextCtrl::EndBold
}\label{wxrichtextctrlendbold
}
409 \func{bool
}{EndBold
}{\void}
413 \membersection{wxRichTextCtrl::EndCharacterStyle
}\label{wxrichtextctrlendcharacterstyle
}
415 \func{bool
}{EndCharacterStyle
}{\void}
417 Ends application of a named character style.
419 \membersection{wxRichTextCtrl::EndFont
}\label{wxrichtextctrlendfont
}
421 \func{bool
}{EndFont
}{\void}
425 \membersection{wxRichTextCtrl::EndFontSize
}\label{wxrichtextctrlendfontsize
}
427 \func{bool
}{EndFontSize
}{\void}
429 Ends using a point size.
431 \membersection{wxRichTextCtrl::EndItalic
}\label{wxrichtextctrlenditalic
}
433 \func{bool
}{EndItalic
}{\void}
437 \membersection{wxRichTextCtrl::EndLeftIndent
}\label{wxrichtextctrlendleftindent
}
439 \func{bool
}{EndLeftIndent
}{\void}
443 \membersection{wxRichTextCtrl::EndLineSpacing
}\label{wxrichtextctrlendlinespacing
}
445 \func{bool
}{EndLineSpacing
}{\void}
449 \membersection{wxRichTextCtrl::EndListStyle
}\label{wxrichtextctrlendliststyle
}
451 \func{bool
}{EndListStyle
}{\void}
453 Ends using a specified list style.
455 \membersection{wxRichTextCtrl::EndNumberedBullet
}\label{wxrichtextctrlendnumberedbullet
}
457 \func{bool
}{EndNumberedBullet
}{\void}
459 Ends application of a numbered bullet.
461 \membersection{wxRichTextCtrl::EndParagraphSpacing
}\label{wxrichtextctrlendparagraphspacing
}
463 \func{bool
}{EndParagraphSpacing
}{\void}
465 Ends paragraph spacing.
467 \membersection{wxRichTextCtrl::EndParagraphStyle
}\label{wxrichtextctrlendparagraphstyle
}
469 \func{bool
}{EndParagraphStyle
}{\void}
471 Ends application of a named character style.
473 \membersection{wxRichTextCtrl::EndRightIndent
}\label{wxrichtextctrlendrightindent
}
475 \func{bool
}{EndRightIndent
}{\void}
479 \membersection{wxRichTextCtrl::EndStyle
}\label{wxrichtextctrlendstyle
}
481 \func{bool
}{EndStyle
}{\void}
483 Ends the current style.
485 \membersection{wxRichTextCtrl::EndSuppressUndo
}\label{wxrichtextctrlendsuppressundo
}
487 \func{bool
}{EndSuppressUndo
}{\void}
489 Ends suppressing undo command history.
491 \membersection{wxRichTextCtrl::EndSymbolBullet
}\label{wxrichtextctrlendsymbolbullet
}
493 \func{bool
}{EndSymbolBullet
}{\void}
495 Ends applying a symbol bullet.
497 \membersection{wxRichTextCtrl::EndTextColour
}\label{wxrichtextctrlendtextcolour
}
499 \func{bool
}{EndTextColour
}{\void}
501 Ends applying a text colour.
503 \membersection{wxRichTextCtrl::EndUnderline
}\label{wxrichtextctrlendunderline
}
505 \func{bool
}{EndUnderline
}{\void}
507 End applying underlining.
509 \membersection{wxRichTextCtrl::EndURL
}\label{wxrichtextctrlendurl
}
511 \func{bool
}{EndURL
}{\void}
515 \membersection{wxRichTextCtrl::ExtendSelection
}\label{wxrichtextctrlextendselection
}
517 \func{bool
}{ExtendSelection
}{\param{long
}{oldPosition
},
\param{long
}{newPosition
},
\param{int
}{flags
}}
519 Helper function for extending the selection, returning
\true if the selection was
520 changed. Selections are in caret positions.
522 \membersection{wxRichTextCtrl::FindNextWordPosition
}\label{wxrichtextctrlfindnextwordposition
}
524 \constfunc{long
}{FindNextWordPosition
}{\param{int
}{direction =
1}}
526 Helper function for finding the caret position for the next word. Direction
527 is
1 (forward) or -
1 (backwards).
529 \membersection{wxRichTextCtrl::Freeze
}\label{wxrichtextctrlfreeze
}
531 \func{void
}{Freeze
}{\void}
533 Call this function to prevent refresh and allow fast updates, and then
\helpref{Thaw
}{wxrichtextctrlthaw
} to
536 \membersection{wxRichTextCtrl::GetBasicStyle
}\label{wxrichtextctrlgetbasicstyle
}
538 \constfunc{const wxTextAttrEx\&
}{GetBasicStyle
}{\void}
540 Gets the basic (overall) style. This is the style of the whole
541 buffer before further styles are applied, unlike the default style, which
542 only affects the style currently being applied (for example, setting the default
543 style to bold will cause subsequently inserted text to be bold).
545 \membersection{wxRichTextCtrl::GetBuffer
}\label{wxrichtextctrlgetbuffer
}
547 \constfunc{const wxRichTextBuffer\&
}{GetBuffer
}{\void}
549 \func{wxRichTextBuffer\&
}{GetBuffer
}{\void}
551 Returns the buffer associated with the control.
553 \membersection{wxRichTextCtrl::GetCaretPosition
}\label{wxrichtextctrlgetcaretposition
}
555 \constfunc{long
}{GetCaretPosition
}{\void}
557 Returns the current caret position.
559 \membersection{wxRichTextCtrl::GetCaretPositionForIndex
}\label{wxrichtextctrlgetcaretpositionforindex
}
561 \func{bool
}{GetCaretPositionForIndex
}{\param{long
}{position
},
\param{wxRect\&
}{rect
}}
563 Returns the caret height and position for the given character position
565 \membersection{wxRichTextCtrl::GetCommandProcessor
}\label{wxrichtextctrlgetcommandprocessor
}
567 \constfunc{wxCommandProcessor*
}{GetCommandProcessor
}{\void}
569 Gets the command processor associated with the control's buffer.
571 \membersection{wxRichTextCtrl::GetDefaultStyleEx
}\label{wxrichtextctrlgetdefaultstyleex
}
573 \constfunc{const wxTextAttrEx\&
}{GetDefaultStyleEx
}{\void}
575 Returns the current default style, which can be used to change how subsequently inserted
576 text is displayed. When wxTextAttrEx is merged with wxTextAttr, this function
577 will become GetDefaultStyle.
579 \membersection{wxRichTextCtrl::GetDelayedLayoutThreshold
}\label{wxrichtextctrlgetdelayedlayoutthreshold
}
581 \constfunc{long
}{GetDelayedLayoutThreshold
}{\void}
583 Gets the size of the buffer beyond which layout is delayed during resizing.
584 This optimizes sizing for large buffers. The default is
20000.
586 \membersection{wxRichTextCtrl::GetFilename
}\label{wxrichtextctrlgetfilename
}
588 \constfunc{wxString
}{GetFilename
}{\void}
590 Gets the current filename associated with the control.
592 \membersection{wxRichTextCtrl::GetFirstVisiblePosition
}\label{wxrichtextctrlgetfirstvisibleposition
}
594 \constfunc{long
}{GetFirstVisiblePosition
}{\void}
596 Returns the first visible position in the current view.
598 \membersection{wxRichTextCtrl::GetHandlerFlags
}\label{wxrichtextfilehandlergethandlerflags
}
600 \constfunc{int
}{GetHandlerFlags
}{\void}
602 Returns flags that change the behaviour of loading or saving. See the documentation for each
603 handler class to see what flags are relevant for each handler.
605 \membersection{wxRichTextCtrl::GetInsertionPoint
}\label{wxrichtextctrlgetinsertionpoint
}
607 \constfunc{long
}{GetInsertionPoint
}{\void}
609 Returns the current insertion point.
611 \membersection{wxRichTextCtrl::GetLastPosition
}\label{wxrichtextctrlgetlastposition
}
613 \constfunc{wxTextPos
}{GetLastPosition
}{\void}
615 Returns the last position in the buffer.
617 \membersection{wxRichTextCtrl::GetLineLength
}\label{wxrichtextctrlgetlinelength
}
619 \constfunc{int
}{GetLineLength
}{\param{long
}{lineNo
}}
621 Returns the length of the specified line in characters.
623 \membersection{wxRichTextCtrl::GetLineText
}\label{wxrichtextctrlgetlinetext
}
625 \constfunc{wxString
}{GetLineText
}{\param{long
}{lineNo
}}
627 Returns the text for the given line.
629 \membersection{wxRichTextCtrl::GetLogicalPoint
}\label{wxrichtextctrlgetlogicalpoint
}
631 \constfunc{wxPoint
}{GetLogicalPoint
}{\param{const wxPoint\&
}{ptPhysical
}}
633 Transforms physical window position to logical (unscrolled) position.
635 \membersection{wxRichTextCtrl::GetNumberOfLines
}\label{wxrichtextctrlgetnumberoflines
}
637 \constfunc{int
}{GetNumberOfLines
}{\void}
639 Returns the number of lines in the buffer.
641 \membersection{wxRichTextCtrl::GetPhysicalPoint
}\label{wxrichtextctrlgetphysicalpoint
}
643 \constfunc{wxPoint
}{GetPhysicalPoint
}{\param{const wxPoint\&
}{ptLogical
}}
645 Transforms logical (unscrolled) position to physical window position.
647 \membersection{wxRichTextCtrl::GetRange
}\label{wxrichtextctrlgetrange
}
649 \constfunc{wxString
}{GetRange
}{\param{long
}{from
},
\param{long
}{to
}}
651 Gets the text for the given range.
653 The end point of range is specified as the last character position of the span of text, plus one.
655 \membersection{wxRichTextCtrl::GetSelection
}\label{wxrichtextctrlgetselection
}
657 \constfunc{void
}{GetSelection
}{\param{long*
}{from
},
\param{long*
}{to
}}
659 Returns the range of the current selection.
661 The end point of range is specified as the last character position of the span of text, plus one.
663 If the return values
{\it from
} and
{\it to
} are the same, there is no selection.
665 \membersection{wxRichTextCtrl::GetSelectionRange
}\label{wxrichtextctrlgetselectionrange
}
667 \constfunc{const wxRichTextRange\&
}{GetSelectionRange
}{\void}
669 Returns the selection range in character positions. -
1, -
1 means no selection.
671 \membersection{wxRichTextCtrl::GetStringSelection
}\label{wxrichtextctrlgetstringselection
}
673 \constfunc{wxString
}{GetStringSelection
}{\void}
675 Returns the text within the current selection range, if any.
677 \membersection{wxRichTextCtrl::GetStyle
}\label{wxrichtextctrlgetstyle
}
679 \func{bool
}{GetStyle
}{\param{long
}{position
},
\param{wxRichTextAttr\&
}{style
}}
681 \func{bool
}{GetStyle
}{\param{long
}{position
},
\param{wxTextAttrEx\&
}{style
}}
683 \func{bool
}{GetStyle
}{\param{long
}{position
},
\param{wxTextAttr\&
}{style
}}
685 Gets the attributes at the given position. The wxRichTextAttr version is generally more efficient
686 because it does not use wxFont objects.
688 This function gets the combined style - that is, the style you see on the screen as a result
689 of combining base style, paragraph style and character style attributes. To get the character
690 or paragraph style alone, use
\helpref{GetUncombinedStyle
}{wxrichtextctrlgetuncombinedstyle
}.
692 \membersection{wxRichTextCtrl::GetStyleSheet
}\label{wxrichtextctrlgetstylesheet
}
694 \constfunc{wxRichTextStyleSheet*
}{GetStyleSheet
}{\void}
696 Returns the style sheet associated with the control, if any. A style sheet allows named
697 character and paragraph styles to be applied.
699 \membersection{wxRichTextCtrl::GetUncombinedStyle
}\label{wxrichtextctrlgetuncombinedstyle
}
701 \func{bool
}{GetUncombinedStyle
}{\param{long
}{position
},
\param{wxRichTextAttr\&
}{style
}}
703 \func{bool
}{GetUncombinedStyle
}{\param{long
}{position
},
\param{wxTextAttrEx\&
}{style
}}
705 \func{bool
}{GetUncombinedStyle
}{\param{long
}{position
},
\param{wxTextAttr\&
}{style
}}
707 Gets the attributes at the given position. The wxRichTextAttr version is generally more efficient
708 because it does not use wxFont objects.
710 This function gets the
{\it uncombined style
} - that is, the attributes associated with the
711 paragraph or character content, and not necessarily the combined attributes you see on the
712 screen. To get the combined attributes, use
\helpref{GetStyle
}{wxrichtextctrlgetstyle
}.
714 If you specify (any) paragraph attribute in
{\it style
}'s flags, this function will fetch
715 the paragraph attributes. Otherwise, it will return the character attributes.
717 \membersection{wxRichTextCtrl::GetValue
}\label{wxrichtextctrlgetvalue
}
719 \constfunc{wxString
}{GetValue
}{\void}
721 Returns the content of the entire control as a string.
723 \membersection{wxRichTextCtrl::GetVisibleLineForCaretPosition
}\label{wxrichtextctrlgetvisiblelineforcaretposition
}
725 \constfunc{wxRichTextLine*
}{GetVisibleLineForCaretPosition
}{\param{long
}{caretPosition
}}
727 Internal helper function returning the line for the visible caret position. If the caret is
728 shown at the very end of the line, it means the next character is actually
729 on the following line. So this function gets the line we're expecting to find
732 \membersection{wxRichTextCtrl::HasCharacterAttributes
}\label{wxrichtextctrlhascharacterattributes
}
734 \constfunc{bool
}{HasCharacterAttributes
}{\param{const wxRichTextRange\&
}{range
},
\param{const wxTextAttrEx\&
}{style
}}
736 \constfunc{bool
}{HasCharacterAttributes
}{\param{const wxRichTextRange\&
}{range
},
\param{const wxRichTextAttr\&
}{style
}}
738 Test if this whole range has character attributes of the specified kind. If any
739 of the attributes are different within the range, the test fails. You
740 can use this to implement, for example, bold button updating.
{\it style
} must have
741 flags indicating which attributes are of interest.
743 \membersection{wxRichTextCtrl::HasParagraphAttributes
}\label{wxrichtextctrlhasparagraphattributes
}
745 \constfunc{bool
}{HasParagraphAttributes
}{\param{const wxRichTextRange\&
}{range
},
\param{const wxTextAttrEx\&
}{style
}}
747 \constfunc{bool
}{HasParagraphAttributes
}{\param{const wxRichTextRange\&
}{range
},
\param{const wxRichTextAttr\&
}{style
}}
749 Test if this whole range has paragraph attributes of the specified kind. If any
750 of the attributes are different within the range, the test fails. You
751 can use this to implement, for example, centering button updating.
{\it style
} must have
752 flags indicating which attributes are of interest.
754 \membersection{wxRichTextCtrl::HasSelection
}\label{wxrichtextctrlhasselection
}
756 \constfunc{bool
}{HasSelection
}{\void}
758 Returns
\true if there is a selection.
760 \membersection{wxRichTextCtrl::HitTest
}\label{wxrichtextctrlhittest
}
762 \constfunc{wxTextCtrlHitTestResult
}{HitTest
}{\param{const wxPoint\&
}{pt
},
\param{long*
}{pos
}}
764 \constfunc{wxTextCtrlHitTestResult
}{HitTest
}{\param{const wxPoint\&
}{pt
},
\param{wxTextCoord*
}{col
},
\param{wxTextCoord*
}{row
}}
766 Finds the character at the given position in pixels.
768 {\it pt
} is in device coords (not adjusted for the client area origin nor for scrolling).
770 \membersection{wxRichTextCtrl::Init
}\label{wxrichtextctrlinit
}
772 \func{void
}{Init
}{\void}
774 Initialises the members of the control.
776 \membersection{wxRichTextCtrl::InitCommandEvent
}\label{wxrichtextctrlinitcommandevent
}
778 \constfunc{void
}{InitCommandEvent
}{\param{wxCommandEvent\&
}{event
}}
780 Initialises the command event.
782 \membersection{wxRichTextCtrl::IsDefaultStyleShowing
}\label{wxrichtextctrlisdefaultstyleshowing
}
784 \constfunc{bool
}{IsDefaultStyleShowing
}{\void}
786 Returns
\true if the user has recently set the default style without moving the caret,
787 and therefore the UI needs to reflect the default style and not the style at the caret.
789 Below is an example of code that uses this function to determine whether the UI
790 should show that the current style is bold.
793 /// Is all of the selection bold?
794 bool wxRichTextCtrl::IsSelectionBold()
799 wxRichTextRange range = GetInternalSelectionRange();
800 attr.SetFlags(wxTEXT_ATTR_FONT_WEIGHT);
801 attr.SetFontWeight(wxBOLD);
803 return HasCharacterAttributes(range, attr);
807 // If no selection, then we need to combine current style with default style
808 // to see what the effect would be if we started typing.
810 attr.SetFlags(wxTEXT_ATTR_FONT_WEIGHT);
812 long pos = GetAdjustedCaretPosition(GetCaretPosition());
813 if (GetStyle(pos, attr))
815 if (IsDefaultStyleShowing())
816 wxRichTextApplyStyle(attr, GetDefaultStyleEx());
817 return attr.GetFontWeight() == wxBOLD;
824 See also
\helpref{SetAndShowDefaultStyle
}{wxrichtextctrlsetandshowdefaultstyle
}.
826 \membersection{wxRichTextCtrl::IsEditable
}\label{wxrichtextctrliseditable
}
828 \constfunc{bool
}{IsEditable
}{\void}
830 Returns
\true if the control is editable.
832 \membersection{wxRichTextCtrl::IsFrozen
}\label{wxrichtextctrlisfrozen
}
834 \constfunc{bool
}{IsFrozen
}{\void}
836 Returns
\true if Freeze has been called without a Thaw.
838 \membersection{wxRichTextCtrl::IsModified
}\label{wxrichtextctrlismodified
}
840 \constfunc{bool
}{IsModified
}{\void}
842 Returns
\true if the buffer has been modified.
844 \membersection{wxRichTextCtrl::IsMultiLine
}\label{wxrichtextctrlismultiline
}
846 \constfunc{bool
}{IsMultiLine
}{\void}
848 Returns
\true if the control is multiline.
850 \membersection{wxRichTextCtrl::IsPositionVisible
}\label{wxrichtextctrlispositionvisible
}
852 \constfunc{bool
}{IsPositionVisible
}{\param{long
}{pos
}}
854 Returns
\true if the given position is visible on the screen.
856 \membersection{wxRichTextCtrl::IsSelectionAligned
}\label{wxrichtextctrlisselectionaligned
}
858 \constfunc{bool
}{IsSelectionAligned
}{\param{wxTextAttrAlignment
}{alignment
}}
860 Returns
\true if all of the selection is aligned according to the specified flag.
862 \membersection{wxRichTextCtrl::IsSelectionBold
}\label{wxrichtextctrlisselectionbold
}
864 \constfunc{bool
}{IsSelectionBold
}{\void}
866 Returns
\true if all of the selection is bold.
868 \membersection{wxRichTextCtrl::IsSelectionItalics
}\label{wxrichtextctrlisselectionitalics
}
870 \constfunc{bool
}{IsSelectionItalics
}{\void}
872 Returns
\true if all of the selection is italic.
874 \membersection{wxRichTextCtrl::IsSelectionUnderlined
}\label{wxrichtextctrlisselectionunderlined
}
876 \constfunc{bool
}{IsSelectionUnderlined
}{\void}
878 Returns
\true if all of the selection is underlined.
880 \membersection{wxRichTextCtrl::IsSingleLine
}\label{wxrichtextctrlissingleline
}
882 \constfunc{bool
}{IsSingleLine
}{\void}
884 Returns
\true if the control is single-line. Currently wxRichTextCtrl does not
885 support single-line editing.
887 \membersection{wxRichTextCtrl::KeyboardNavigate
}\label{wxrichtextctrlkeyboardnavigate
}
889 \func{bool
}{KeyboardNavigate
}{\param{int
}{keyCode
},
\param{int
}{flags
}}
891 Helper function implementing keyboard navigation.
893 \membersection{wxRichTextCtrl::LayoutContent
}\label{wxrichtextctrllayoutcontent
}
895 \func{bool
}{LayoutContent
}{\param{bool
}{onlyVisibleRect = false
}}
897 Lays out the buffer, which must be done before certain operations, such as
898 setting the caret position. This function should not normally be required by the
901 \membersection{wxRichTextCtrl::LoadFile
}\label{wxrichtextctrlloadfile
}
903 \func{bool
}{LoadFile
}{\param{const wxString\&
}{file
},
\param{int
}{type = wxRICHTEXT
\_TYPE\_ANY}}
905 Loads content into the control's buffer using the given type. If the specified type
906 is wxRICHTEXT
\_TYPE\_ANY, the type is deduced from the filename extension.
908 This function looks for a suitable
\helpref{wxRichTextFileHandler
}{wxrichtextfilehandler
} object.
910 \membersection{wxRichTextCtrl::MarkDirty
}\label{wxrichtextctrlmarkdirty
}
912 \func{void
}{MarkDirty
}{\void}
914 Marks the buffer as modified.
916 \membersection{wxRichTextCtrl::MoveCaret
}\label{wxrichtextctrlmovecaret
}
918 \func{bool
}{MoveCaret
}{\param{long
}{pos
},
\param{bool
}{showAtLineStart = false
}}
920 Move the caret to the given character position.
922 \membersection{wxRichTextCtrl::MoveCaretBack
}\label{wxrichtextctrlmovecaretback
}
924 \func{void
}{MoveCaretBack
}{\param{long
}{oldPosition
}}
926 Move the caret one visual step forward: this may mean setting a flag
927 and keeping the same position if we're going from the end of one line
928 to the start of the next, which may be the exact same caret position.
930 \membersection{wxRichTextCtrl::MoveCaretForward
}\label{wxrichtextctrlmovecaretforward
}
932 \func{void
}{MoveCaretForward
}{\param{long
}{oldPosition
}}
934 Move the caret one visual step forward: this may mean setting a flag
935 and keeping the same position if we're going from the end of one line
936 to the start of the next, which may be the exact same caret position.
938 \membersection{wxRichTextCtrl::MoveDown
}\label{wxrichtextctrlmovedown
}
940 \func{bool
}{MoveDown
}{\param{int
}{noLines =
1},
\param{int
}{flags =
0}}
942 Moves the caret down.
944 \membersection{wxRichTextCtrl::MoveEnd
}\label{wxrichtextctrlmoveend
}
946 \func{bool
}{MoveEnd
}{\param{int
}{flags =
0}}
948 Moves to the end of the buffer.
950 \membersection{wxRichTextCtrl::MoveHome
}\label{wxrichtextctrlmovehome
}
952 \func{bool
}{MoveHome
}{\param{int
}{flags =
0}}
954 Moves to the start of the buffer.
956 \membersection{wxRichTextCtrl::MoveLeft
}\label{wxrichtextctrlmoveleft
}
958 \func{bool
}{MoveLeft
}{\param{int
}{noPositions =
1},
\param{int
}{flags =
0}}
962 \membersection{wxRichTextCtrl::MoveRight
}\label{wxrichtextctrlmoveright
}
964 \func{bool
}{MoveRight
}{\param{int
}{noPositions =
1},
\param{int
}{flags =
0}}
968 \membersection{wxRichTextCtrl::MoveToLineEnd
}\label{wxrichtextctrlmovetolineend
}
970 \func{bool
}{MoveToLineEnd
}{\param{int
}{flags =
0}}
972 Moves to the end of the line.
974 \membersection{wxRichTextCtrl::MoveToLineStart
}\label{wxrichtextctrlmovetolinestart
}
976 \func{bool
}{MoveToLineStart
}{\param{int
}{flags =
0}}
978 Moves to the start of the line.
980 \membersection{wxRichTextCtrl::MoveToParagraphEnd
}\label{wxrichtextctrlmovetoparagraphend
}
982 \func{bool
}{MoveToParagraphEnd
}{\param{int
}{flags =
0}}
984 Moves to the end of the paragraph.
986 \membersection{wxRichTextCtrl::MoveToParagraphStart
}\label{wxrichtextctrlmovetoparagraphstart
}
988 \func{bool
}{MoveToParagraphStart
}{\param{int
}{flags =
0}}
990 Moves to the start of the paragraph.
992 \membersection{wxRichTextCtrl::MoveUp
}\label{wxrichtextctrlmoveup
}
994 \func{bool
}{MoveUp
}{\param{int
}{noLines =
1},
\param{int
}{flags =
0}}
998 \membersection{wxRichTextCtrl::Newline
}\label{wxrichtextctrlnewline
}
1000 \func{bool
}{Newline
}{\void}
1002 Insert a newline (actually paragraph) at the current insertion point.
1004 \membersection{wxRichTextCtrl::NumberList
}\label{wxrichtextctrlnumberlist
}
1006 \func{bool
}{NumberList
}{\param{const wxRichTextRange\&
}{range
},
\param{const wxRichTextListStyleDefinition*
}{style
},
\param{int
}{flags $=$ wxRICHTEXT
\_SETSTYLE\_WITH\_UNDO},
\param{int
}{ startFrom = -
1},
\param{int
}{ listLevel = -
1}}
1008 \func{bool
}{Number
}{\param{const wxRichTextRange\&
}{range
},
\param{const wxString\&
}{styleName
},
\param{int
}{flags $=$ wxRICHTEXT
\_SETSTYLE\_WITH\_UNDO},
\param{int
}{ startFrom = -
1},
\param{int
}{ listLevel = -
1}}
1010 Numbers the paragraphs in the given range. Pass flags to determine how the attributes are set.
1011 Either the style definition or the name of the style definition (in the current sheet) can be passed.
1013 {\it flags
} is a bit list of the following:
1015 \begin{itemize
}\itemsep=
0pt
1016 \item wxRICHTEXT
\_SETSTYLE\_WITH\_UNDO: specifies that this command will be undoable.
1017 \item wxRICHTEXT
\_SETSTYLE\_RENUMBER: specifies that numbering should start from
{\it startFrom
}, otherwise existing attributes are used.
1018 \item wxRICHTEXT
\_SETSTYLE\_SPECIFY\_LEVEL: specifies that
{\it listLevel
} should be used as the level for all paragraphs, otherwise the current indentation will be used.
1021 See also
\helpref{wxRichTextCtrl::SetListStyle
}{wxrichtextctrlsetliststyle
},
\helpref{wxRichTextCtrl::PromoteList
}{wxrichtextctrlpromotelist
},
\helpref{wxRichTextCtrl::ClearListStyle
}{wxrichtextctrlclearliststyle
}.
1023 \membersection{wxRichTextCtrl::OnClear
}\label{wxrichtextctrlonclear
}
1025 \func{void
}{OnClear
}{\param{wxCommandEvent\&
}{event
}}
1027 Standard handler for the wxID
\_CLEAR command.
1029 \membersection{wxRichTextCtrl::OnContextMenu
}\label{wxrichtextctrloncontextmenu
}
1031 \func{void
}{OnContextMenu
}{\param{wxContextMenuEvent\&
}{event
}}
1033 Shows a standard context menu with undo, redo, cut, copy, paste, clear, and select all commands.
1035 \membersection{wxRichTextCtrl::OnCopy
}\label{wxrichtextctrloncopy
}
1037 \func{void
}{OnCopy
}{\param{wxCommandEvent\&
}{event
}}
1039 Standard handler for the wxID
\_COPY command.
1041 \membersection{wxRichTextCtrl::OnCut
}\label{wxrichtextctrloncut
}
1043 \func{void
}{OnCut
}{\param{wxCommandEvent\&
}{event
}}
1045 Standard handler for the wxID
\_CUT command.
1047 \membersection{wxRichTextCtrl::OnDropFiles
}\label{wxrichtextctrlondropfiles
}
1049 \func{void
}{OnDropFiles
}{\param{wxDropFilesEvent\&
}{event
}}
1051 Loads the first dropped file.
1053 \membersection{wxRichTextCtrl::OnPaste
}\label{wxrichtextctrlonpaste
}
1055 \func{void
}{OnPaste
}{\param{wxCommandEvent\&
}{event
}}
1057 Standard handler for the wxID
\_PASTE command.
1059 \membersection{wxRichTextCtrl::OnRedo
}\label{wxrichtextctrlonredo
}
1061 \func{void
}{OnRedo
}{\param{wxCommandEvent\&
}{event
}}
1063 Standard handler for the wxID
\_REDO command.
1065 \membersection{wxRichTextCtrl::OnSelectAll
}\label{wxrichtextctrlonselectall
}
1067 \func{void
}{OnSelectAll
}{\param{wxCommandEvent\&
}{event
}}
1069 Standard handler for the wxID
\_SELECTALL command.
1071 \membersection{wxRichTextCtrl::OnUndo
}\label{wxrichtextctrlonundo
}
1073 \func{void
}{OnUndo
}{\param{wxCommandEvent\&
}{event
}}
1075 Standard handler for the wxID
\_PASTE command.
1077 \membersection{wxRichTextCtrl::OnUpdateClear
}\label{wxrichtextctrlonupdateclear
}
1079 \func{void
}{OnUpdateClear
}{\param{wxUpdateUIEvent\&
}{event
}}
1081 Standard update handler for the wxID
\_CLEAR command.
1083 \membersection{wxRichTextCtrl::OnUpdateCopy
}\label{wxrichtextctrlonupdatecopy
}
1085 \func{void
}{OnUpdateCopy
}{\param{wxUpdateUIEvent\&
}{event
}}
1087 Standard update handler for the wxID
\_COPY command.
1089 \membersection{wxRichTextCtrl::OnUpdateCut
}\label{wxrichtextctrlonupdatecut
}
1091 \func{void
}{OnUpdateCut
}{\param{wxUpdateUIEvent\&
}{event
}}
1093 Standard update handler for the wxID
\_CUT command.
1095 \membersection{wxRichTextCtrl::OnUpdatePaste
}\label{wxrichtextctrlonupdatepaste
}
1097 \func{void
}{OnUpdatePaste
}{\param{wxUpdateUIEvent\&
}{event
}}
1099 Standard update handler for the wxID
\_PASTE command.
1101 \membersection{wxRichTextCtrl::OnUpdateRedo
}\label{wxrichtextctrlonupdateredo
}
1103 \func{void
}{OnUpdateRedo
}{\param{wxUpdateUIEvent\&
}{event
}}
1105 Standard update handler for the wxID
\_REDO command.
1107 \membersection{wxRichTextCtrl::OnUpdateSelectAll
}\label{wxrichtextctrlonupdateselectall
}
1109 \func{void
}{OnUpdateSelectAll
}{\param{wxUpdateUIEvent\&
}{event
}}
1111 Standard update handler for the wxID
\_SELECTALL command.
1113 \membersection{wxRichTextCtrl::OnUpdateUndo
}\label{wxrichtextctrlonupdateundo
}
1115 \func{void
}{OnUpdateUndo
}{\param{wxUpdateUIEvent\&
}{event
}}
1117 Standard update handler for the wxID
\_UNDO command.
1119 \membersection{wxRichTextCtrl::PageDown
}\label{wxrichtextctrlpagedown
}
1121 \func{bool
}{PageDown
}{\param{int
}{noPages =
1},
\param{int
}{flags =
0}}
1123 Moves one or more pages down.
1125 \membersection{wxRichTextCtrl::PageUp
}\label{wxrichtextctrlpageup
}
1127 \func{bool
}{PageUp
}{\param{int
}{noPages =
1},
\param{int
}{flags =
0}}
1129 Moves one or more pages up.
1131 \membersection{wxRichTextCtrl::PaintBackground
}\label{wxrichtextctrlpaintbackground
}
1133 \func{void
}{PaintBackground
}{\param{wxDC\&
}{dc
}}
1135 Paints the background.
1137 \membersection{wxRichTextCtrl::Paste
}\label{wxrichtextctrlpaste
}
1139 \func{void
}{Paste
}{\void}
1141 Pastes content from the clipboard to the buffer.
1143 \membersection{wxRichTextCtrl::PositionCaret
}\label{wxrichtextctrlpositioncaret
}
1145 \func{void
}{PositionCaret
}{\void}
1147 Internal function to position the visible caret according to the current caret position.
1149 \membersection{wxRichTextCtrl::PositionToXY
}\label{wxrichtextctrlpositiontoxy
}
1151 \constfunc{bool
}{PositionToXY
}{\param{long
}{pos
},
\param{long*
}{x
},
\param{long*
}{y
}}
1153 Converts a text position to zero-based column and line numbers.
1155 \membersection{wxRichTextCtrl::PromoteList
}\label{wxrichtextctrlpromotelist
}
1157 \func{bool
}{PromoteList
}{\param{int
}{ promoteBy
},
\param{const wxRichTextRange\&
}{range
},
\param{const wxRichTextListStyleDefinition*
}{style
},
\param{int
}{flags $=$ wxRICHTEXT
\_SETSTYLE\_WITH\_UNDO},
\param{int
}{ listLevel = -
1}}
1159 \func{bool
}{PromoteList
}{\param{int
}{ promoteBy
},
\param{const wxRichTextRange\&
}{range
},
\param{const wxString\&
}{styleName
},
\param{int
}{flags $=$ wxRICHTEXT
\_SETSTYLE\_WITH\_UNDO},
\param{int
}{ listLevel = -
1}}
1161 Promotes or demotes the paragraphs in the given range. A positive
{\it promoteBy
} produces a smaller indent, and a negative number
1162 produces a larger indent. Pass flags to determine how the attributes are set.
1163 Either the style definition or the name of the style definition (in the current sheet) can be passed.
1165 {\it flags
} is a bit list of the following:
1167 \begin{itemize
}\itemsep=
0pt
1168 \item wxRICHTEXT
\_SETSTYLE\_WITH\_UNDO: specifies that this command will be undoable.
1169 \item wxRICHTEXT
\_SETSTYLE\_RENUMBER: specifies that numbering should start from
{\it startFrom
}, otherwise existing attributes are used.
1170 \item wxRICHTEXT
\_SETSTYLE\_SPECIFY\_LEVEL: specifies that
{\it listLevel
} should be used as the level for all paragraphs, otherwise the current indentation will be used.
1173 See also
\helpref{wxRichTextCtrl::SetListStyle
}{wxrichtextctrlsetliststyle
}, See also
\helpref{wxRichTextCtrl::SetListStyle
}{wxrichtextctrlnumberlist
},
\helpref{wxRichTextCtrl::ClearListStyle
}{wxrichtextctrlclearliststyle
}.
1175 \membersection{wxRichTextCtrl::Redo
}\label{wxrichtextctrlredo
}
1177 \func{void
}{Redo
}{\void}
1179 Redoes the current command.
1181 \membersection{wxRichTextCtrl::Remove
}\label{wxrichtextctrlremove
}
1183 \func{void
}{Remove
}{\param{long
}{from
},
\param{long
}{to
}}
1185 Removes the content in the specified range.
1187 \membersection{wxRichTextCtrl::Replace
}\label{wxrichtextctrlreplace
}
1189 \func{void
}{Replace
}{\param{long
}{from
},
\param{long
}{to
},
\param{const wxString\&
}{value
}}
1191 Replaces the content in the specified range with the string specified by
{\it value
}.
1193 \membersection{wxRichTextCtrl::SaveFile
}\label{wxrichtextctrlsavefile
}
1195 \func{bool
}{SaveFile
}{\param{const wxString\&
}{file = wxEmptyString
},
\param{int
}{type = wxRICHTEXT
\_TYPE\_ANY}}
1197 Saves the buffer content using the given type. If the specified type
1198 is wxRICHTEXT
\_TYPE\_ANY, the type is deduced from the filename extension.
1200 This function looks for a suitable
\helpref{wxRichTextFileHandler
}{wxrichtextfilehandler
} object.
1202 \membersection{wxRichTextCtrl::ScrollIntoView
}\label{wxrichtextctrlscrollintoview
}
1204 \func{bool
}{ScrollIntoView
}{\param{long
}{position
},
\param{int
}{keyCode
}}
1206 Scrolls
{\it position
} into view. This function takes a caret position.
1208 \membersection{wxRichTextCtrl::SelectAll
}\label{wxrichtextctrlselectall
}
1210 \func{void
}{SelectAll
}{\void}
1212 Selects all the text in the buffer.
1214 \membersection{wxRichTextCtrl::SelectNone
}\label{wxrichtextctrlselectnone
}
1216 \func{void
}{SelectNone
}{\void}
1218 Cancels any selection.
1220 \membersection{wxRichTextCtrl::SetAndShowDefaultStyle
}\label{wxrichtextctrlsetandshowdefaultstyle
}
1222 \func{void
}{SetAndShowDefaultStyle
}{\param{const wxRichTextAttr\&
}{attr
}}
1224 Sets
{\it attr
} as the default style and tells the control that the UI should reflect
1225 this attribute until the user moves the caret.
1227 See also
\helpref{IsDefaultStyleShowing
}{wxrichtextctrlisdefaultstyleshowing
}.
1229 \membersection{wxRichTextCtrl::SetBasicStyle
}\label{wxrichtextctrlsetbasicstyle
}
1231 \func{void
}{SetBasicStyle
}{\param{const wxRichTextAttr\&
}{style
}}
1233 \func{void
}{SetBasicStyle
}{\param{const wxTextAttrEx\&
}{style
}}
1235 Sets the basic (overall) style. This is the style of the whole
1236 buffer before further styles are applied, unlike the default style, which
1237 only affects the style currently being applied (for example, setting the default
1238 style to bold will cause subsequently inserted text to be bold).
1240 \membersection{wxRichTextCtrl::SetCaretPosition
}\label{wxrichtextctrlsetcaretposition
}
1242 \func{void
}{SetCaretPosition
}{\param{long
}{position
},
\param{bool
}{showAtLineStart = false
}}
1244 The caret position is the character position just before the caret.
1245 A value of -
1 means the caret is at the start of the buffer.
1247 \membersection{wxRichTextCtrl::SetDefaultStyle
}\label{wxrichtextctrlsetdefaultstyle
}
1249 \func{bool
}{SetDefaultStyle
}{\param{const wxTextAttrEx\&
}{style
}}
1251 Sets the current default style, which can be used to change how subsequently inserted
1254 \membersection{wxRichTextCtrl::SetDefaultStyleToCursorStyle
}\label{wxrichtextctrlsetdefaultstyletocursorstyle
}
1256 \func{bool
}{SetDefaultStyleToCursorStyle
}{\void}
1258 Sets the default style to the style under the cursor.
1260 \membersection{wxRichTextCtrl::SetDelayedLayoutThreshold
}\label{wxrichtextctrlsetdelayedlayoutthreshold
}
1262 \func{void
}{SetDelayedLayoutThreshold
}{\param{long
}{threshold
}}
1264 Sets the size of the buffer beyond which layout is delayed during resizing.
1265 This optimizes sizing for large buffers. The default is
20000.
1267 \membersection{wxRichTextCtrl::SetEditable
}\label{wxrichtextctrlseteditable
}
1269 \func{void
}{SetEditable
}{\param{bool
}{editable
}}
1271 Makes the control editable, or not.
1273 \membersection{wxRichTextCtrl::SetFilename
}\label{wxrichtextctrlsetfilename
}
1275 \func{void
}{SetFilename
}{\param{const wxString\&
}{filename
}}
1277 Sets the current filename.
1279 \membersection{wxRichTextCtrl::SetFont
}\label{wxrichtextctrlsetfont
}
1281 \func{bool
}{SetFont
}{\param{const wxFont\&
}{font
}}
1283 Sets the font, and also the basic and default attributes (see
\helpref{SetDefaultStyle
}{wxrichtextctrlsetdefaultstyle
}).
1285 \membersection{wxRichTextCtrl::SetHandlerFlags
}\label{wxrichtextctrlsethandlerflags
}
1287 \func{void
}{SetHandlerFlags
}{\param{int
}{flags
}}
1289 Sets flags that change the behaviour of loading or saving. See the documentation for each
1290 handler class to see what flags are relevant for each handler.
1292 \membersection{wxRichTextCtrl::SetInsertionPoint
}\label{wxrichtextctrlsetinsertionpoint
}
1294 \func{void
}{SetInsertionPoint
}{\param{long
}{pos
}}
1296 Sets the insertion point.
1298 \membersection{wxRichTextCtrl::SetInsertionPointEnd
}\label{wxrichtextctrlsetinsertionpointend
}
1300 \func{void
}{SetInsertionPointEnd
}{\void}
1302 Sets the insertion point to the end of the text control.
1304 \membersection{wxRichTextCtrl::SetListStyle
}\label{wxrichtextctrlsetliststyle
}
1306 \func{bool
}{SetListStyle
}{\param{const wxRichTextRange\&
}{range
},
\param{const wxRichTextListStyleDefinition*
}{style
},
\param{int
}{flags $=$ wxRICHTEXT
\_SETSTYLE\_WITH\_UNDO},
\param{int
}{ startFrom = -
1},
\param{int
}{ listLevel = -
1}}
1308 \func{bool
}{SetListStyle
}{\param{const wxRichTextRange\&
}{range
},
\param{const wxString\&
}{styleName
},
\param{int
}{flags $=$ wxRICHTEXT
\_SETSTYLE\_WITH\_UNDO},
\param{int
}{ startFrom = -
1},
\param{int
}{ listLevel = -
1}}
1310 Sets the list attributes for the given range, passing flags to determine how the attributes are set.
1311 Either the style definition or the name of the style definition (in the current sheet) can be passed.
1313 {\it flags
} is a bit list of the following:
1315 \begin{itemize
}\itemsep=
0pt
1316 \item wxRICHTEXT
\_SETSTYLE\_WITH\_UNDO: specifies that this command will be undoable.
1317 \item wxRICHTEXT
\_SETSTYLE\_RENUMBER: specifies that numbering should start from
{\it startFrom
}, otherwise existing attributes are used.
1318 \item wxRICHTEXT
\_SETSTYLE\_SPECIFY\_LEVEL: specifies that
{\it listLevel
} should be used as the level for all paragraphs, otherwise the current indentation will be used.
1321 See also
\helpref{wxRichTextCtrl::NumberList
}{wxrichtextctrlnumberlist
},
\helpref{wxRichTextCtrl::PromoteList
}{wxrichtextctrlpromotelist
},
\helpref{wxRichTextCtrl::ClearListStyle
}{wxrichtextctrlclearliststyle
}.
1323 \membersection{wxRichTextCtrl::SetSelection
}\label{wxrichtextctrlsetselection
}
1325 \func{void
}{SetSelection
}{\param{long
}{from
},
\param{long
}{to
}}
1327 Sets the selection to the given range.
1329 The end point of range is specified as the last character position of the span of text, plus one.
1330 So, for example, to set the style for a character at position
5, use the range (
5,
6).
1332 \membersection{wxRichTextCtrl::SetSelectionRange
}\label{wxrichtextctrlsetselectionrange
}
1334 \func{void
}{SetSelectionRange
}{\param{const wxRichTextRange\&
}{range
}}
1336 Sets the selection to the given range.
1338 The end point of range is specified as the last character position of the span of text, plus one.
1339 So, for example, to set the style for a character at position
5, use the range (
5,
6).
1341 \membersection{wxRichTextCtrl::SetStyle
}\label{wxrichtextctrlsetstyle
}
1343 \func{bool
}{SetStyle
}{\param{const wxRichTextRange\&
}{range
},
\param{const wxRichTextAttr\&
}{style
}}
1345 \func{bool
}{SetStyle
}{\param{long
}{start
},
\param{long
}{end
},
\param{const wxTextAttrEx\&
}{style
}}
1347 \func{bool
}{SetStyle
}{\param{long
}{start
},
\param{long
}{end
},
\param{const wxTextAttr\&
}{style
}}
1349 Sets the attributes for the given range. The wxRichTextAttr version is more efficient
1350 because it does not use wxFont objects.
1352 The end point of range is specified as the last character position of the span of text, plus one.
1353 So, for example, to set the style for a character at position
5, use the range (
5,
6).
1355 \membersection{wxRichTextCtrl::SetStyleEx
}\label{wxrichtextctrlsetstyleex
}
1357 \func{bool
}{SetStyleEx
}{\param{const wxRichTextRange\&
}{range
},
\param{const wxRichTextAttr\&
}{style
},
\param{int
}{flags $=$ wxRICHTEXT
\_SETSTYLE\_WITH\_UNDO}}
1359 \func{bool
}{SetStyleEx
}{\param{const wxRichTextRange\&
}{range
},
\param{const wxTextAttrEx\&
}{style
},
\param{int
}{flags $=$ wxRICHTEXT
\_SETSTYLE\_WITH\_UNDO}}
1361 \func{bool
}{SetStyleEx
}{\param{long
}{start
},
\param{long
}{end
},
\param{const wxTextAttrEx\&
}{style
},
\param{int
}{flags $=$ wxRICHTEXT
\_SETSTYLE\_WITH\_UNDO}}
1363 Sets the attributes for the given range, passing flags to determine how the attributes are set. The wxRichTextAttr version is more efficient
1364 because it does not use wxFont objects.
1366 The end point of range is specified as the last character position of the span of text, plus one.
1367 So, for example, to set the style for a character at position
5, use the range (
5,
6).
1369 {\it flags
} may contain a bit list of the following values:
1371 \begin{itemize
}\itemsep=
0pt
1372 \item wxRICHTEXT
\_SETSTYLE\_NONE: no style flag.
1373 \item wxRICHTEXT
\_SETSTYLE\_WITH\_UNDO: specifies that this operation should be undoable.
1374 \item wxRICHTEXT
\_SETSTYLE\_OPTIMIZE: specifies that the style should not be applied if the
1375 combined style at this point is already the style in question.
1376 \item wxRICHTEXT
\_SETSTYLE\_PARAGRAPHS\_ONLY: specifies that the style should only be applied to paragraphs,
1377 and not the content. This allows content styling to be preserved independently from that of e.g. a named paragraph style.
1378 \item wxRICHTEXT
\_SETSTYLE\_CHARACTERS\_ONLY: specifies that the style should only be applied to characters,
1379 and not the paragraph. This allows content styling to be preserved independently from that of e.g. a named paragraph style.
1380 \item wxRICHTEXT
\_SETSTYLE\_RESET: resets (clears) the existing style before applying the new style.
1383 \membersection{wxRichTextCtrl::SetStyleSheet
}\label{wxrichtextctrlsetstylesheet
}
1385 \func{void
}{SetStyleSheet
}{\param{wxRichTextStyleSheet*
}{styleSheet
}}
1387 Sets the style sheet associated with the control. A style sheet allows named
1388 character and paragraph styles to be applied.
1390 \membersection{wxRichTextCtrl::SetValue
}\label{wxrichtextctrlsetvalue
}
1392 \func{void
}{SetValue
}{\param{const wxString\&
}{value
}}
1394 Replaces existing content with the given text.
1396 \membersection{wxRichTextCtrl::SetupScrollbars
}\label{wxrichtextctrlsetupscrollbars
}
1398 \func{void
}{SetupScrollbars
}{\param{bool
}{atTop = false
}}
1400 A helper function setting up scrollbars, for example after a resize.
1402 \membersection{wxRichTextCtrl::ShowPosition
}\label{wxrichtextctrlshowposition
}
1404 \func{void
}{ShowPosition
}{\param{long
}{pos
}}
1406 Scrolls the buffer so that the given position is in view.
1408 \membersection{wxRichTextCtrl::SuppressingUndo
}\label{wxrichtextctrlsuppressingundo
}
1410 \constfunc{bool
}{SuppressingUndo
}{\void}
1412 Returns
\true if undo history suppression is on.
1414 \membersection{wxRichTextCtrl::Thaw
}\label{wxrichtextctrlthaw
}
1416 \func{void
}{Thaw
}{\void}
1418 Call this function to end a Freeze and refresh the display.
1420 \membersection{wxRichTextCtrl::Undo
}\label{wxrichtextctrlundo
}
1422 \func{void
}{Undo
}{\void}
1424 Undoes the command at the top of the command history, if there is one.
1426 \membersection{wxRichTextCtrl::WordLeft
}\label{wxrichtextctrlwordleft
}
1428 \func{bool
}{WordLeft
}{\param{int
}{noWords =
1},
\param{int
}{flags =
0}}
1430 Moves a number of words to the left.
1432 \membersection{wxRichTextCtrl::WordRight
}\label{wxrichtextctrlwordright
}
1434 \func{bool
}{WordRight
}{\param{int
}{noWords =
1},
\param{int
}{flags =
0}}
1436 Move a nuber of words to the right.
1438 \membersection{wxRichTextCtrl::WriteImage
}\label{wxrichtextctrlwriteimage
}
1440 \func{bool
}{WriteImage
}{\param{const wxString\&
}{filename
},
\param{int
}{bitmapType
}}
1442 Loads an image from a file and writes it at the current insertion point.
1444 \func{bool
}{WriteImage
}{\param{const wxRichTextImageBlock\&
}{imageBlock
}}
1446 Writes an image block at the current insertion point.
1448 \func{bool
}{WriteImage
}{\param{const wxBitmap\&
}{bitmap
},
\param{int
}{bitmapType = wxBITMAP
\_TYPE\_PNG}}
1450 \func{bool
}{WriteImage
}{\param{const wxImage\&
}{image
},
\param{int
}{bitmapType = wxBITMAP
\_TYPE\_PNG}}
1452 Write a bitmap or image at the current insertion point. Supply an optional type to use
1453 for internal and file storage of the raw data.
1455 \membersection{wxRichTextCtrl::WriteText
}\label{wxrichtextctrlwritetext
}
1457 \func{void
}{WriteText
}{\param{const wxString\&
}{text
}}
1459 Writes text at the current position.
1461 \membersection{wxRichTextCtrl::XYToPosition
}\label{wxrichtextctrlxytoposition
}
1463 \constfunc{long
}{XYToPosition
}{\param{long
}{x
},
\param{long
}{y
}}
1465 Translates from column and line number to position.