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
},
\param{const wxPoint\&
}{pos = wxDefaultPosition
},
\param{const wxSize\&
}{size = wxDefaultSize
},
\param{long
}{style = wxRE
\_MULTILINE}}
26 \membersection{wxRichTextCtrl::
\destruct{wxRichTextCtrl
}}\label{wxrichtextctrldtor
}
28 \func{}{\destruct{wxRichTextCtrl
}}{\void}
32 \membersection{wxRichTextCtrl::AddImage
}\label{wxrichtextctrladdimage
}
34 \func{wxRichTextRange
}{AddImage
}{\param{const wxImage\&
}{image
}}
36 Adds an image to the control's buffer.
38 \membersection{wxRichTextCtrl::AddParagraph
}\label{wxrichtextctrladdparagraph
}
40 \func{wxRichTextRange
}{AddParagraph
}{\param{const wxString\&
}{text
}}
42 Adds a new paragraph of text to the end of the buffer.
44 \membersection{wxRichTextCtrl::AppendText
}\label{wxrichtextctrlappendtext
}
46 \func{void
}{AppendText
}{\param{const wxString\&
}{text
}}
48 Sets the insertion point to the end of the buffer and writes the text.
50 \membersection{wxRichTextCtrl::ApplyAlignmentToSelection
}\label{wxrichtextctrlapplyalignmenttoselection
}
52 \func{bool
}{ApplyAlignmentToSelection
}{\param{wxTextAttrAlignment
}{alignment
}}
54 Applies the given alignment to the selection (undoable).
56 For alignment values, see
\helpref{wxTextAttrEx
}{wxtextattrex
}.
58 \membersection{wxRichTextCtrl::ApplyBoldToSelection
}\label{wxrichtextctrlapplyboldtoselection
}
60 \func{bool
}{ApplyBoldToSelection
}{\void}
62 Apples bold to the selection (undoable).
64 \membersection{wxRichTextCtrl::ApplyItalicToSelection
}\label{wxrichtextctrlapplyitalictoselection
}
66 \func{bool
}{ApplyItalicToSelection
}{\void}
68 Applies italic to the selection (undoable).
70 \membersection{wxRichTextCtrl::ApplyStyle
}\label{wxrichtextctrlapplystyle
}
72 \func{bool
}{ApplyStyle
}{\param{wxRichTextStyleDefinition*
}{ def
}}
74 Applies the given style to the selection.
76 \membersection{wxRichTextCtrl::ApplyStyleSheet
}\label{wxrichtextctrlapplystylesheet
}
78 \func{bool
}{ApplyStyleSheet
}{\param{wxRichTextStyleSheet*
}{ sheet $=$ NULL
}}
80 Applies the style sheet to the buffer, matching paragraph styles in the sheet against named styles
81 in the buffer. This might be useful if the styles have changed. If
{\it sheet
} is NULL, the
82 sheet set with SetStyleSheet is used.
84 Currently this applies paragraph styles only.
86 \membersection{wxRichTextCtrl::ApplyUnderlineToSelection
}\label{wxrichtextctrlapplyunderlinetoselection
}
88 \func{bool
}{ApplyUnderlineToSelection
}{\void}
90 Applies underline to the selection (undoable).
92 \membersection{wxRichTextCtrl::BatchingUndo
}\label{wxrichtextctrlbatchingundo
}
94 \constfunc{bool
}{BatchingUndo
}{\void}
96 Returns
\true if undo commands are being batched.
98 \membersection{wxRichTextCtrl::BeginAlignment
}\label{wxrichtextctrlbeginalignment
}
100 \func{bool
}{BeginAlignment
}{\param{wxTextAttrAlignment
}{alignment
}}
102 Begins using alignment
104 For alignment values, see
\helpref{wxTextAttrEx
}{wxtextattrex
}.
106 \membersection{wxRichTextCtrl::BeginBatchUndo
}\label{wxrichtextctrlbeginbatchundo
}
108 \func{bool
}{BeginBatchUndo
}{\param{const wxString\&
}{cmdName
}}
110 Starts batching undo history for commands.
112 \membersection{wxRichTextCtrl::BeginBold
}\label{wxrichtextctrlbeginbold
}
114 \func{bool
}{BeginBold
}{\void}
118 \membersection{wxRichTextCtrl::BeginCharacterStyle
}\label{wxrichtextctrlbegincharacterstyle
}
120 \func{bool
}{BeginCharacterStyle
}{\param{const wxString\&
}{characterStyle
}}
122 Begins using the named character style.
124 \membersection{wxRichTextCtrl::BeginFont
}\label{wxrichtextctrlbeginfont
}
126 \func{bool
}{BeginFont
}{\param{const wxFont\&
}{font
}}
128 Begins using this font.
130 \membersection{wxRichTextCtrl::BeginFontSize
}\label{wxrichtextctrlbeginfontsize
}
132 \func{bool
}{BeginFontSize
}{\param{int
}{pointSize
}}
134 Begins using the given point size.
136 \membersection{wxRichTextCtrl::BeginItalic
}\label{wxrichtextctrlbeginitalic
}
138 \func{bool
}{BeginItalic
}{\void}
142 \membersection{wxRichTextCtrl::BeginLeftIndent
}\label{wxrichtextctrlbeginleftindent
}
144 \func{bool
}{BeginLeftIndent
}{\param{int
}{leftIndent
},
\param{int
}{leftSubIndent =
0}}
146 Begins applying a left indent and subindent in tenths of a millimetre.
148 The sub-indent is an offset from the left of the paragraph, and is used for all but the
149 first line in a paragraph. A positive value will cause the first line to appear to the left
150 of the subsequent lines, and a negative value will cause the first line to be indented
151 relative to the subsequent lines.
153 wxRichTextBuffer uses indentation to render a bulleted item. The left indent is the distance between
154 the margin and the bullet. The content of the paragraph, including the first line, starts
155 at leftMargin + leftSubIndent. So the distance between the left edge of the bullet and the
156 left of the actual paragraph is leftSubIndent.
158 \membersection{wxRichTextCtrl::BeginLineSpacing
}\label{wxrichtextctrlbeginlinespacing
}
160 \func{bool
}{BeginLineSpacing
}{\param{int
}{lineSpacing
}}
162 Begins appling line spacing.
{\it spacing
} is a multiple, where
10 means single-spacing,
163 15 means
1.5 spacing, and
20 means double spacing. The following constants are
164 defined for convenience:
168 #define wxTEXT_ATTR_LINE_SPACING_NORMAL
10
169 #define wxTEXT_ATTR_LINE_SPACING_HALF
15
170 #define wxTEXT_ATTR_LINE_SPACING_TWICE
20
174 \membersection{wxRichTextCtrl::BeginListStyle
}\label{wxrichtextctrlbeginliststyle
}
176 \func{bool
}{BeginListStyle
}{\param{const wxString\&
}{ listStyle
},
\param{int
}{ level=
1},
\param{int
}{ number=
1}}
178 Begins using a specified list style. Optionally, you can also pass a level and a number.
180 \membersection{wxRichTextCtrl::BeginNumberedBullet
}\label{wxrichtextctrlbeginnumberedbullet
}
182 \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}}
184 Begins a numbered bullet. This call will be needed for each item in the list, and the
185 application should take care of incrementing the numbering.
187 {\it bulletNumber
} is a number, usually starting with
1.
189 {\it leftIndent
} and
{\it leftSubIndent
} are values in tenths of a millimetre.
191 {\it bulletStyle
} is a bitlist of the following values:
195 #define wxTEXT_ATTR_BULLET_STYLE_NONE
0x00000000
196 #define wxTEXT_ATTR_BULLET_STYLE_ARABIC
0x00000001
197 #define wxTEXT_ATTR_BULLET_STYLE_LETTERS_UPPER
0x00000002
198 #define wxTEXT_ATTR_BULLET_STYLE_LETTERS_LOWER
0x00000004
199 #define wxTEXT_ATTR_BULLET_STYLE_ROMAN_UPPER
0x00000008
200 #define wxTEXT_ATTR_BULLET_STYLE_ROMAN_LOWER
0x00000010
201 #define wxTEXT_ATTR_BULLET_STYLE_SYMBOL
0x00000020
202 #define wxTEXT_ATTR_BULLET_STYLE_BITMAP
0x00000040
203 #define wxTEXT_ATTR_BULLET_STYLE_PARENTHESES
0x00000080
204 #define wxTEXT_ATTR_BULLET_STYLE_PERIOD
0x00000100
205 #define wxTEXT_ATTR_BULLET_STYLE_STANDARD
0x00000200
206 #define wxTEXT_ATTR_BULLET_STYLE_RIGHT_PARENTHESIS
0x00000400
207 #define wxTEXT_ATTR_BULLET_STYLE_OUTLINE
0x00000800
208 #define wxTEXT_ATTR_BULLET_STYLE_ALIGN_LEFT
0x00000000
209 #define wxTEXT_ATTR_BULLET_STYLE_ALIGN_RIGHT
0x00001000
210 #define wxTEXT_ATTR_BULLET_STYLE_ALIGN_CENTRE
0x00002000
214 wxRichTextBuffer uses indentation to render a bulleted item. The left indent is the distance between
215 the margin and the bullet. The content of the paragraph, including the first line, starts
216 at leftMargin + leftSubIndent. So the distance between the left edge of the bullet and the
217 left of the actual paragraph is leftSubIndent.
219 \membersection{wxRichTextCtrl::BeginParagraphSpacing
}\label{wxrichtextctrlbeginparagraphspacing
}
221 \func{bool
}{BeginParagraphSpacing
}{\param{int
}{before
},
\param{int
}{after
}}
223 Begins paragraph spacing; pass the before-paragraph and after-paragraph spacing in tenths of
226 \membersection{wxRichTextCtrl::BeginParagraphStyle
}\label{wxrichtextctrlbeginparagraphstyle
}
228 \func{bool
}{BeginParagraphStyle
}{\param{const wxString\&
}{paragraphStyle
}}
230 Begins applying the named paragraph style.
232 \membersection{wxRichTextCtrl::BeginRightIndent
}\label{wxrichtextctrlbeginrightindent
}
234 \func{bool
}{BeginRightIndent
}{\param{int
}{rightIndent
}}
236 Begins a right indent, specified in tenths of a millimetre.
238 \membersection{wxRichTextCtrl::BeginStyle
}\label{wxrichtextctrlbeginstyle
}
240 \func{bool
}{BeginStyle
}{\param{const wxTextAttrEx\&
}{style
}}
242 Begins applying a style.
244 \membersection{wxRichTextCtrl::BeginSuppressUndo
}\label{wxrichtextctrlbeginsuppressundo
}
246 \func{bool
}{BeginSuppressUndo
}{\void}
248 Starts suppressing undo history for commands.
250 \membersection{wxRichTextCtrl::BeginSymbolBullet
}\label{wxrichtextctrlbeginsymbolbullet
}
252 \func{bool
}{BeginSymbolBullet
}{\param{wxChar
}{symbol
},
\param{int
}{leftIndent
},
\param{int
}{leftSubIndent
},
\param{int
}{bulletStyle = wxTEXT
\_ATTR\_BULLET\_STYLE\_SYMBOL}}
254 Begins applying a symbol bullet, using a character from the current font. See
\helpref{BeginNumberedBullet
}{wxrichtextctrlbeginnumberedbullet
} for
255 an explanation of how indentation is used to render the bulleted paragraph.
257 \membersection{wxRichTextCtrl::BeginTextColour
}\label{wxrichtextctrlbegintextcolour
}
259 \func{bool
}{BeginTextColour
}{\param{const wxColour\&
}{colour
}}
261 Begins using this colour.
263 \membersection{wxRichTextCtrl::BeginUnderline
}\label{wxrichtextctrlbeginunderline
}
265 \func{bool
}{BeginUnderline
}{\void}
267 Begins using underlining.
269 \membersection{wxRichTextCtrl::BeginURL
}\label{wxrichtextctrlbeginurl
}
271 \func{bool
}{BeginURL
}{\param{const wxString\&
}{ url
},
\param{const wxString\&
}{ characterStyle = wxEmptyString
}}
273 Begins applying wxTEXT
\_ATTR\_URL to the content. Pass a URL and optionally, a character style to apply,
274 since it is common to mark a URL with a familiar style such as blue text with underlining.
276 \membersection{wxRichTextCtrl::CanCopy
}\label{wxrichtextctrlcancopy
}
278 \constfunc{bool
}{CanCopy
}{\void}
280 Returns
\true if selected content can be copied to the clipboard.
282 \membersection{wxRichTextCtrl::CanCut
}\label{wxrichtextctrlcancut
}
284 \constfunc{bool
}{CanCut
}{\void}
286 Returns
\true if selected content can be copied to the clipboard and deleted.
288 \membersection{wxRichTextCtrl::CanDeleteSelection
}\label{wxrichtextctrlcandeleteselection
}
290 \constfunc{bool
}{CanDeleteSelection
}{\void}
292 Returns
\true if selected content can be deleted.
294 \membersection{wxRichTextCtrl::CanPaste
}\label{wxrichtextctrlcanpaste
}
296 \constfunc{bool
}{CanPaste
}{\void}
298 Returns
\true if the clipboard content can be pasted to the buffer.
300 \membersection{wxRichTextCtrl::CanRedo
}\label{wxrichtextctrlcanredo
}
302 \constfunc{bool
}{CanRedo
}{\void}
304 Returns
\true if there is a command in the command history that can be redone.
306 \membersection{wxRichTextCtrl::CanUndo
}\label{wxrichtextctrlcanundo
}
308 \constfunc{bool
}{CanUndo
}{\void}
310 Returns
\true if there is a command in the command history that can be undone.
312 \membersection{wxRichTextCtrl::Clear
}\label{wxrichtextctrlclear
}
314 \func{void
}{Clear
}{\void}
316 Clears the buffer content, leaving a single empty paragraph. Cannot be undone.
318 \membersection{wxRichTextCtrl::ClearListStyle
}\label{wxrichtextctrlclearliststyle
}
320 \func{bool
}{ClearListStyle
}{\param{const wxRichTextRange\&
}{range
},
\param{int
}{flags $=$ wxRICHTEXT
\_SETSTYLE\_WITH\_UNDO}}
322 \func{bool
}{ClearListStyle
}{\param{const wxRichTextRange\&
}{range
},
\param{int
}{flags $=$ wxRICHTEXT
\_SETSTYLE\_WITH\_UNDO}}
324 Clears the list style from the given range, clearing list-related attributes and applying any named paragraph style associated with each paragraph.
326 {\it flags
} is a bit list of the following:
328 \begin{itemize
}\itemsep=
0pt
329 \item wxRICHTEXT
\_SETSTYLE\_WITH\_UNDO: specifies that this command will be undoable.
332 See also
\helpref{wxRichTextCtrl::SetListStyle
}{wxrichtextctrlsetliststyle
},
\helpref{wxRichTextCtrl::PromoteList
}{wxrichtextctrlpromotelist
},
\helpref{wxRichTextCtrl::NumberList
}{wxrichtextctrlnumberlist
}.
334 \membersection{wxRichTextCtrl::Command
}\label{wxrichtextctrlcommand
}
336 \func{void
}{Command
}{\param{wxCommandEvent\&
}{event
}}
338 Sends the event to the control.
340 \membersection{wxRichTextCtrl::Copy
}\label{wxrichtextctrlcopy
}
342 \func{void
}{Copy
}{\void}
344 Copies the selected content (if any) to the clipboard.
346 \membersection{wxRichTextCtrl::Create
}\label{wxrichtextctrlcreate
}
348 \func{bool
}{Create
}{\param{wxWindow*
}{parent
},
\param{wxWindowID
}{id = wxID
\_ANY},
\param{const wxString\&
}{value = wxEmptyString
},
\param{const wxPoint\&
}{pos = wxDefaultPosition
},
\param{const wxSize\&
}{size = wxDefaultSize
},
\param{long
}{style = wxRE
\_MULTILINE}}
350 Creates the underlying window.
352 \membersection{wxRichTextCtrl::Cut
}\label{wxrichtextctrlcut
}
354 \func{void
}{Cut
}{\void}
356 Copies the selected content (if any) to the clipboard and deletes the selection.
359 \membersection{wxRichTextCtrl::DeleteSelectedContent
}\label{wxrichtextctrldeleteselectedcontent
}
361 \func{bool
}{DeleteSelectedContent
}{\param{long*
}{newPos = NULL
}}
363 Deletes content if there is a selection, e.g. when pressing a key.
364 Returns the new caret position in
{\it newPos
}, or leaves it if there
365 was no action. This is undoable.
367 \membersection{wxRichTextCtrl::DeleteSelection
}\label{wxrichtextctrldeleteselection
}
369 \func{void
}{DeleteSelection
}{\void}
371 Deletes the content in the selection, if any. This is undoable.
373 \membersection{wxRichTextCtrl::DiscardEdits
}\label{wxrichtextctrldiscardedits
}
375 \func{void
}{DiscardEdits
}{\void}
377 Sets the buffer's modified status to
\false, and clears the buffer's command history.
379 \membersection{wxRichTextCtrl::DoGetBestSize
}\label{wxrichtextctrldogetbestsize
}
381 \constfunc{wxSize
}{DoGetBestSize
}{\void}
383 Currently this simply returns
{\tt wxSize(
10,
10)
}.
385 \membersection{wxRichTextCtrl::EndAlignment
}\label{wxrichtextctrlendalignment
}
387 \func{bool
}{EndAlignment
}{\void}
391 \membersection{wxRichTextCtrl::EndAllStyles
}\label{wxrichtextctrlendallstyles
}
393 \func{bool
}{EndAllStyles
}{\void}
395 Ends application of all styles in the current style stack.
397 \membersection{wxRichTextCtrl::EndBatchUndo
}\label{wxrichtextctrlendbatchundo
}
399 \func{bool
}{EndBatchUndo
}{\void}
401 Ends batching undo command history.
403 \membersection{wxRichTextCtrl::EndBold
}\label{wxrichtextctrlendbold
}
405 \func{bool
}{EndBold
}{\void}
409 \membersection{wxRichTextCtrl::EndCharacterStyle
}\label{wxrichtextctrlendcharacterstyle
}
411 \func{bool
}{EndCharacterStyle
}{\void}
413 Ends application of a named character style.
415 \membersection{wxRichTextCtrl::EndFont
}\label{wxrichtextctrlendfont
}
417 \func{bool
}{EndFont
}{\void}
421 \membersection{wxRichTextCtrl::EndFontSize
}\label{wxrichtextctrlendfontsize
}
423 \func{bool
}{EndFontSize
}{\void}
425 Ends using a point size.
427 \membersection{wxRichTextCtrl::EndItalic
}\label{wxrichtextctrlenditalic
}
429 \func{bool
}{EndItalic
}{\void}
433 \membersection{wxRichTextCtrl::EndLeftIndent
}\label{wxrichtextctrlendleftindent
}
435 \func{bool
}{EndLeftIndent
}{\void}
439 \membersection{wxRichTextCtrl::EndLineSpacing
}\label{wxrichtextctrlendlinespacing
}
441 \func{bool
}{EndLineSpacing
}{\void}
445 \membersection{wxRichTextCtrl::EndListStyle
}\label{wxrichtextctrlendliststyle
}
447 \func{bool
}{EndListStyle
}{\void}
449 Ends using a specified list style.
451 \membersection{wxRichTextCtrl::EndNumberedBullet
}\label{wxrichtextctrlendnumberedbullet
}
453 \func{bool
}{EndNumberedBullet
}{\void}
455 Ends application of a numbered bullet.
457 \membersection{wxRichTextCtrl::EndParagraphSpacing
}\label{wxrichtextctrlendparagraphspacing
}
459 \func{bool
}{EndParagraphSpacing
}{\void}
461 Ends paragraph spacing.
463 \membersection{wxRichTextCtrl::EndParagraphStyle
}\label{wxrichtextctrlendparagraphstyle
}
465 \func{bool
}{EndParagraphStyle
}{\void}
467 Ends application of a named character style.
469 \membersection{wxRichTextCtrl::EndRightIndent
}\label{wxrichtextctrlendrightindent
}
471 \func{bool
}{EndRightIndent
}{\void}
475 \membersection{wxRichTextCtrl::EndStyle
}\label{wxrichtextctrlendstyle
}
477 \func{bool
}{EndStyle
}{\void}
479 Ends the current style.
481 \membersection{wxRichTextCtrl::EndSuppressUndo
}\label{wxrichtextctrlendsuppressundo
}
483 \func{bool
}{EndSuppressUndo
}{\void}
485 Ends suppressing undo command history.
487 \membersection{wxRichTextCtrl::EndSymbolBullet
}\label{wxrichtextctrlendsymbolbullet
}
489 \func{bool
}{EndSymbolBullet
}{\void}
491 Ends applying a symbol bullet.
493 \membersection{wxRichTextCtrl::EndTextColour
}\label{wxrichtextctrlendtextcolour
}
495 \func{bool
}{EndTextColour
}{\void}
497 Ends applying a text colour.
499 \membersection{wxRichTextCtrl::EndUnderline
}\label{wxrichtextctrlendunderline
}
501 \func{bool
}{EndUnderline
}{\void}
503 End applying underlining.
505 \membersection{wxRichTextCtrl::EndURL
}\label{wxrichtextctrlendurl
}
507 \func{bool
}{EndURL
}{\void}
511 \membersection{wxRichTextCtrl::ExtendSelection
}\label{wxrichtextctrlextendselection
}
513 \func{bool
}{ExtendSelection
}{\param{long
}{oldPosition
},
\param{long
}{newPosition
},
\param{int
}{flags
}}
515 Helper function for extending the selection, returning
\true if the selection was
516 changed. Selections are in caret positions.
518 \membersection{wxRichTextCtrl::FindNextWordPosition
}\label{wxrichtextctrlfindnextwordposition
}
520 \constfunc{long
}{FindNextWordPosition
}{\param{int
}{direction =
1}}
522 Helper function for finding the caret position for the next word. Direction
523 is
1 (forward) or -
1 (backwards).
525 \membersection{wxRichTextCtrl::Freeze
}\label{wxrichtextctrlfreeze
}
527 \func{void
}{Freeze
}{\void}
529 Call this function to prevent refresh and allow fast updates, and then
\helpref{Thaw
}{wxrichtextctrlthaw
} to
532 \membersection{wxRichTextCtrl::GetBasicStyle
}\label{wxrichtextctrlgetbasicstyle
}
534 \constfunc{const wxTextAttrEx\&
}{GetBasicStyle
}{\void}
536 Gets the basic (overall) style. This is the style of the whole
537 buffer before further styles are applied, unlike the default style, which
538 only affects the style currently being applied (for example, setting the default
539 style to bold will cause subsequently inserted text to be bold).
541 \membersection{wxRichTextCtrl::GetBuffer
}\label{wxrichtextctrlgetbuffer
}
543 \constfunc{const wxRichTextBuffer\&
}{GetBuffer
}{\void}
545 \func{wxRichTextBuffer\&
}{GetBuffer
}{\void}
547 Returns the buffer associated with the control.
549 \membersection{wxRichTextCtrl::GetCaretPosition
}\label{wxrichtextctrlgetcaretposition
}
551 \constfunc{long
}{GetCaretPosition
}{\void}
553 Returns the current caret position.
555 \membersection{wxRichTextCtrl::GetCaretPositionForIndex
}\label{wxrichtextctrlgetcaretpositionforindex
}
557 \func{bool
}{GetCaretPositionForIndex
}{\param{long
}{position
},
\param{wxRect\&
}{rect
}}
559 Returns the caret height and position for the given character position
561 \membersection{wxRichTextCtrl::GetCommandProcessor
}\label{wxrichtextctrlgetcommandprocessor
}
563 \constfunc{wxCommandProcessor*
}{GetCommandProcessor
}{\void}
565 Gets the command processor associated with the control's buffer.
567 \membersection{wxRichTextCtrl::GetDefaultStyleEx
}\label{wxrichtextctrlgetdefaultstyleex
}
569 \constfunc{const wxTextAttrEx\&
}{GetDefaultStyleEx
}{\void}
571 Returns the current default style, which can be used to change how subsequently inserted
572 text is displayed. When wxTextAttrEx is merged with wxTextAttr, this function
573 will become GetDefaultStyle.
575 \membersection{wxRichTextCtrl::GetDelayedLayoutThreshold
}\label{wxrichtextctrlgetdelayedlayoutthreshold
}
577 \constfunc{long
}{GetDelayedLayoutThreshold
}{\void}
579 Gets the size of the buffer beyond which layout is delayed during resizing.
580 This optimizes sizing for large buffers. The default is
20000.
582 \membersection{wxRichTextCtrl::GetFilename
}\label{wxrichtextctrlgetfilename
}
584 \constfunc{wxString
}{GetFilename
}{\void}
586 Gets the current filename associated with the control.
588 \membersection{wxRichTextCtrl::GetFirstVisiblePosition
}\label{wxrichtextctrlgetfirstvisibleposition
}
590 \constfunc{long
}{GetFirstVisiblePosition
}{\void}
592 Returns the first visible position in the current view.
594 \membersection{wxRichTextCtrl::GetInsertionPoint
}\label{wxrichtextctrlgetinsertionpoint
}
596 \constfunc{long
}{GetInsertionPoint
}{\void}
598 Returns the current insertion point.
600 \membersection{wxRichTextCtrl::GetLastPosition
}\label{wxrichtextctrlgetlastposition
}
602 \constfunc{wxTextPos
}{GetLastPosition
}{\void}
604 Returns the last position in the buffer.
606 \membersection{wxRichTextCtrl::GetLineLength
}\label{wxrichtextctrlgetlinelength
}
608 \constfunc{int
}{GetLineLength
}{\param{long
}{lineNo
}}
610 Returns the length of the specified line in characters.
612 \membersection{wxRichTextCtrl::GetLineText
}\label{wxrichtextctrlgetlinetext
}
614 \constfunc{wxString
}{GetLineText
}{\param{long
}{lineNo
}}
616 Returns the text for the given line.
618 \membersection{wxRichTextCtrl::GetLogicalPoint
}\label{wxrichtextctrlgetlogicalpoint
}
620 \constfunc{wxPoint
}{GetLogicalPoint
}{\param{const wxPoint\&
}{ptPhysical
}}
622 Transforms physical window position to logical (unscrolled) position.
624 \membersection{wxRichTextCtrl::GetNumberOfLines
}\label{wxrichtextctrlgetnumberoflines
}
626 \constfunc{int
}{GetNumberOfLines
}{\void}
628 Returns the number of lines in the buffer.
630 \membersection{wxRichTextCtrl::GetPhysicalPoint
}\label{wxrichtextctrlgetphysicalpoint
}
632 \constfunc{wxPoint
}{GetPhysicalPoint
}{\param{const wxPoint\&
}{ptLogical
}}
634 Transforms logical (unscrolled) position to physical window position.
636 \membersection{wxRichTextCtrl::GetRange
}\label{wxrichtextctrlgetrange
}
638 \constfunc{wxString
}{GetRange
}{\param{long
}{from
},
\param{long
}{to
}}
640 Gets the text for the given range.
642 The end point of range is specified as the last character position of the span of text, plus one.
644 \membersection{wxRichTextCtrl::GetSelection
}\label{wxrichtextctrlgetselection
}
646 \constfunc{void
}{GetSelection
}{\param{long*
}{from
},
\param{long*
}{to
}}
648 Returns the range of the current selection.
650 The end point of range is specified as the last character position of the span of text, plus one.
652 If the return values
{\it from
} and
{\it to
} are the same, there is no selection.
654 \membersection{wxRichTextCtrl::GetSelectionRange
}\label{wxrichtextctrlgetselectionrange
}
656 \constfunc{const wxRichTextRange\&
}{GetSelectionRange
}{\void}
658 Returns the selection range in character positions. -
1, -
1 means no selection.
660 \membersection{wxRichTextCtrl::GetStringSelection
}\label{wxrichtextctrlgetstringselection
}
662 \constfunc{wxString
}{GetStringSelection
}{\void}
664 Returns the text within the current selection range, if any.
666 \membersection{wxRichTextCtrl::GetStyle
}\label{wxrichtextctrlgetstyle
}
668 \func{bool
}{GetStyle
}{\param{long
}{position
},
\param{wxRichTextAttr\&
}{style
}}
670 \func{bool
}{GetStyle
}{\param{long
}{position
},
\param{wxTextAttrEx\&
}{style
}}
672 \func{bool
}{GetStyle
}{\param{long
}{position
},
\param{wxTextAttr\&
}{style
}}
674 Gets the attributes at the given position. The wxRichTextAttr version is generally more efficient
675 because it does not use wxFont objects.
677 This function gets the combined style - that is, the style you see on the screen as a result
678 of combining base style, paragraph style and character style attributes. To get the character
679 or paragraph style alone, use
\helpref{GetUncombinedStyle
}{wxrichtextctrlgetuncombinedstyle
}.
681 \membersection{wxRichTextCtrl::GetStyleSheet
}\label{wxrichtextctrlgetstylesheet
}
683 \constfunc{wxRichTextStyleSheet*
}{GetStyleSheet
}{\void}
685 Returns the style sheet associated with the control, if any. A style sheet allows named
686 character and paragraph styles to be applied.
688 \membersection{wxRichTextCtrl::GetUncombinedStyle
}\label{wxrichtextctrlgetuncombinedstyle
}
690 \func{bool
}{GetUncombinedStyle
}{\param{long
}{position
},
\param{wxRichTextAttr\&
}{style
}}
692 \func{bool
}{GetUncombinedStyle
}{\param{long
}{position
},
\param{wxTextAttrEx\&
}{style
}}
694 \func{bool
}{GetUncombinedStyle
}{\param{long
}{position
},
\param{wxTextAttr\&
}{style
}}
696 Gets the attributes at the given position. The wxRichTextAttr version is generally more efficient
697 because it does not use wxFont objects.
699 This function gets the
{\it uncombined style
} - that is, the attributes associated with the
700 paragraph or character content, and not necessarily the combined attributes you see on the
701 screen. To get the combined attributes, use
\helpref{GetStyle
}{wxrichtextctrlgetstyle
}.
703 If you specify (any) paragraph attribute in
{\it style
}'s flags, this function will fetch
704 the paragraph attributes. Otherwise, it will return the character attributes.
706 \membersection{wxRichTextCtrl::GetValue
}\label{wxrichtextctrlgetvalue
}
708 \constfunc{wxString
}{GetValue
}{\void}
710 Returns the content of the entire control as a string.
712 \membersection{wxRichTextCtrl::GetVisibleLineForCaretPosition
}\label{wxrichtextctrlgetvisiblelineforcaretposition
}
714 \constfunc{wxRichTextLine*
}{GetVisibleLineForCaretPosition
}{\param{long
}{caretPosition
}}
716 Internal helper function returning the line for the visible caret position. If the caret is
717 shown at the very end of the line, it means the next character is actually
718 on the following line. So this function gets the line we're expecting to find
721 \membersection{wxRichTextCtrl::HasCharacterAttributes
}\label{wxrichtextctrlhascharacterattributes
}
723 \constfunc{bool
}{HasCharacterAttributes
}{\param{const wxRichTextRange\&
}{range
},
\param{const wxTextAttrEx\&
}{style
}}
725 \constfunc{bool
}{HasCharacterAttributes
}{\param{const wxRichTextRange\&
}{range
},
\param{const wxRichTextAttr\&
}{style
}}
727 Test if this whole range has character attributes of the specified kind. If any
728 of the attributes are different within the range, the test fails. You
729 can use this to implement, for example, bold button updating.
{\it style
} must have
730 flags indicating which attributes are of interest.
732 \membersection{wxRichTextCtrl::HasParagraphAttributes
}\label{wxrichtextctrlhasparagraphattributes
}
734 \constfunc{bool
}{HasParagraphAttributes
}{\param{const wxRichTextRange\&
}{range
},
\param{const wxTextAttrEx\&
}{style
}}
736 \constfunc{bool
}{HasParagraphAttributes
}{\param{const wxRichTextRange\&
}{range
},
\param{const wxRichTextAttr\&
}{style
}}
738 Test if this whole range has paragraph 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, centering button updating.
{\it style
} must have
741 flags indicating which attributes are of interest.
743 \membersection{wxRichTextCtrl::HasSelection
}\label{wxrichtextctrlhasselection
}
745 \constfunc{bool
}{HasSelection
}{\void}
747 Returns
\true if there is a selection.
749 \membersection{wxRichTextCtrl::HitTest
}\label{wxrichtextctrlhittest
}
751 \constfunc{wxTextCtrlHitTestResult
}{HitTest
}{\param{const wxPoint\&
}{pt
},
\param{long*
}{pos
}}
753 \constfunc{wxTextCtrlHitTestResult
}{HitTest
}{\param{const wxPoint\&
}{pt
},
\param{wxTextCoord*
}{col
},
\param{wxTextCoord*
}{row
}}
755 Finds the character at the given position in pixels.
757 {\it pt
} is in device coords (not adjusted for the client area origin nor for scrolling).
759 \membersection{wxRichTextCtrl::Init
}\label{wxrichtextctrlinit
}
761 \func{void
}{Init
}{\void}
763 Initialises the members of the control.
765 \membersection{wxRichTextCtrl::InitCommandEvent
}\label{wxrichtextctrlinitcommandevent
}
767 \constfunc{void
}{InitCommandEvent
}{\param{wxCommandEvent\&
}{event
}}
769 Initialises the command event.
771 \membersection{wxRichTextCtrl::IsDefaultStyleShowing
}\label{wxrichtextctrlisdefaultstyleshowing
}
773 \constfunc{bool
}{IsDefaultStyleShowing
}{\void}
775 Returns
\true if the user has recently set the default style without moving the caret,
776 and therefore the UI needs to reflect the default style and not the style at the caret.
778 Below is an example of code that uses this function to determine whether the UI
779 should show that the current style is bold.
782 /// Is all of the selection bold?
783 bool wxRichTextCtrl::IsSelectionBold()
788 wxRichTextRange range = GetInternalSelectionRange();
789 attr.SetFlags(wxTEXT_ATTR_FONT_WEIGHT);
790 attr.SetFontWeight(wxBOLD);
792 return HasCharacterAttributes(range, attr);
796 // If no selection, then we need to combine current style with default style
797 // to see what the effect would be if we started typing.
799 attr.SetFlags(wxTEXT_ATTR_FONT_WEIGHT);
801 long pos = GetAdjustedCaretPosition(GetCaretPosition());
802 if (GetStyle(pos, attr))
804 if (IsDefaultStyleShowing())
805 wxRichTextApplyStyle(attr, GetDefaultStyleEx());
806 return attr.GetFontWeight() == wxBOLD;
813 See also
\helpref{SetAndShowDefaultStyle
}{wxrichtextctrlsetandshowdefaultstyle
}.
815 \membersection{wxRichTextCtrl::IsEditable
}\label{wxrichtextctrliseditable
}
817 \constfunc{bool
}{IsEditable
}{\void}
819 Returns
\true if the control is editable.
821 \membersection{wxRichTextCtrl::IsFrozen
}\label{wxrichtextctrlisfrozen
}
823 \constfunc{bool
}{IsFrozen
}{\void}
825 Returns
\true if Freeze has been called without a Thaw.
827 \membersection{wxRichTextCtrl::IsModified
}\label{wxrichtextctrlismodified
}
829 \constfunc{bool
}{IsModified
}{\void}
831 Returns
\true if the buffer has been modified.
833 \membersection{wxRichTextCtrl::IsMultiLine
}\label{wxrichtextctrlismultiline
}
835 \constfunc{bool
}{IsMultiLine
}{\void}
837 Returns
\true if the control is multiline.
839 \membersection{wxRichTextCtrl::IsPositionVisible
}\label{wxrichtextctrlispositionvisible
}
841 \constfunc{bool
}{IsPositionVisible
}{\param{long
}{pos
}}
843 Returns
\true if the given position is visible on the screen.
845 \membersection{wxRichTextCtrl::IsSelectionAligned
}\label{wxrichtextctrlisselectionaligned
}
847 \constfunc{bool
}{IsSelectionAligned
}{\param{wxTextAttrAlignment
}{alignment
}}
849 Returns
\true if all of the selection is aligned according to the specified flag.
851 \membersection{wxRichTextCtrl::IsSelectionBold
}\label{wxrichtextctrlisselectionbold
}
853 \constfunc{bool
}{IsSelectionBold
}{\void}
855 Returns
\true if all of the selection is bold.
857 \membersection{wxRichTextCtrl::IsSelectionItalics
}\label{wxrichtextctrlisselectionitalics
}
859 \constfunc{bool
}{IsSelectionItalics
}{\void}
861 Returns
\true if all of the selection is italic.
863 \membersection{wxRichTextCtrl::IsSelectionUnderlined
}\label{wxrichtextctrlisselectionunderlined
}
865 \constfunc{bool
}{IsSelectionUnderlined
}{\void}
867 Returns
\true if all of the selection is underlined.
869 \membersection{wxRichTextCtrl::IsSingleLine
}\label{wxrichtextctrlissingleline
}
871 \constfunc{bool
}{IsSingleLine
}{\void}
873 Returns
\true if the control is single-line. Currently wxRichTextCtrl does not
874 support single-line editing.
876 \membersection{wxRichTextCtrl::KeyboardNavigate
}\label{wxrichtextctrlkeyboardnavigate
}
878 \func{bool
}{KeyboardNavigate
}{\param{int
}{keyCode
},
\param{int
}{flags
}}
880 Helper function implementing keyboard navigation.
882 \membersection{wxRichTextCtrl::LayoutContent
}\label{wxrichtextctrllayoutcontent
}
884 \func{bool
}{LayoutContent
}{\param{bool
}{onlyVisibleRect = false
}}
886 Lays out the buffer, which must be done before certain operations, such as
887 setting the caret position. This function should not normally be required by the
890 \membersection{wxRichTextCtrl::LoadFile
}\label{wxrichtextctrlloadfile
}
892 \func{bool
}{LoadFile
}{\param{const wxString\&
}{file
},
\param{int
}{type = wxRICHTEXT
\_TYPE\_ANY}}
894 Loads content into the control's buffer using the given type. If the specified type
895 is wxRICHTEXT
\_TYPE\_ANY, the type is deduced from the filename extension.
897 This function looks for a suitable
\helpref{wxRichTextFileHandler
}{wxrichtextfilehandler
} object.
899 \membersection{wxRichTextCtrl::MarkDirty
}\label{wxrichtextctrlmarkdirty
}
901 \func{void
}{MarkDirty
}{\void}
903 Marks the buffer as modified.
905 \membersection{wxRichTextCtrl::MoveCaret
}\label{wxrichtextctrlmovecaret
}
907 \func{bool
}{MoveCaret
}{\param{long
}{pos
},
\param{bool
}{showAtLineStart = false
}}
909 Move the caret to the given character position.
911 \membersection{wxRichTextCtrl::MoveCaretBack
}\label{wxrichtextctrlmovecaretback
}
913 \func{void
}{MoveCaretBack
}{\param{long
}{oldPosition
}}
915 Move the caret one visual step forward: this may mean setting a flag
916 and keeping the same position if we're going from the end of one line
917 to the start of the next, which may be the exact same caret position.
919 \membersection{wxRichTextCtrl::MoveCaretForward
}\label{wxrichtextctrlmovecaretforward
}
921 \func{void
}{MoveCaretForward
}{\param{long
}{oldPosition
}}
923 Move the caret one visual step forward: this may mean setting a flag
924 and keeping the same position if we're going from the end of one line
925 to the start of the next, which may be the exact same caret position.
927 \membersection{wxRichTextCtrl::MoveDown
}\label{wxrichtextctrlmovedown
}
929 \func{bool
}{MoveDown
}{\param{int
}{noLines =
1},
\param{int
}{flags =
0}}
931 Moves the caret down.
933 \membersection{wxRichTextCtrl::MoveEnd
}\label{wxrichtextctrlmoveend
}
935 \func{bool
}{MoveEnd
}{\param{int
}{flags =
0}}
937 Moves to the end of the buffer.
939 \membersection{wxRichTextCtrl::MoveHome
}\label{wxrichtextctrlmovehome
}
941 \func{bool
}{MoveHome
}{\param{int
}{flags =
0}}
943 Moves to the start of the buffer.
945 \membersection{wxRichTextCtrl::MoveLeft
}\label{wxrichtextctrlmoveleft
}
947 \func{bool
}{MoveLeft
}{\param{int
}{noPositions =
1},
\param{int
}{flags =
0}}
951 \membersection{wxRichTextCtrl::MoveRight
}\label{wxrichtextctrlmoveright
}
953 \func{bool
}{MoveRight
}{\param{int
}{noPositions =
1},
\param{int
}{flags =
0}}
957 \membersection{wxRichTextCtrl::MoveToLineEnd
}\label{wxrichtextctrlmovetolineend
}
959 \func{bool
}{MoveToLineEnd
}{\param{int
}{flags =
0}}
961 Moves to the end of the line.
963 \membersection{wxRichTextCtrl::MoveToLineStart
}\label{wxrichtextctrlmovetolinestart
}
965 \func{bool
}{MoveToLineStart
}{\param{int
}{flags =
0}}
967 Moves to the start of the line.
969 \membersection{wxRichTextCtrl::MoveToParagraphEnd
}\label{wxrichtextctrlmovetoparagraphend
}
971 \func{bool
}{MoveToParagraphEnd
}{\param{int
}{flags =
0}}
973 Moves to the end of the paragraph.
975 \membersection{wxRichTextCtrl::MoveToParagraphStart
}\label{wxrichtextctrlmovetoparagraphstart
}
977 \func{bool
}{MoveToParagraphStart
}{\param{int
}{flags =
0}}
979 Moves to the start of the paragraph.
981 \membersection{wxRichTextCtrl::MoveUp
}\label{wxrichtextctrlmoveup
}
983 \func{bool
}{MoveUp
}{\param{int
}{noLines =
1},
\param{int
}{flags =
0}}
987 \membersection{wxRichTextCtrl::Newline
}\label{wxrichtextctrlnewline
}
989 \func{bool
}{Newline
}{\void}
991 Insert a newline (actually paragraph) at the current insertion point.
993 \membersection{wxRichTextCtrl::NumberList
}\label{wxrichtextctrlnumberlist
}
995 \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}}
997 \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}}
999 Numbers the paragraphs in the given range. Pass flags to determine how the attributes are set.
1000 Either the style definition or the name of the style definition (in the current sheet) can be passed.
1002 {\it flags
} is a bit list of the following:
1004 \begin{itemize
}\itemsep=
0pt
1005 \item wxRICHTEXT
\_SETSTYLE\_WITH\_UNDO: specifies that this command will be undoable.
1006 \item wxRICHTEXT
\_SETSTYLE\_RENUMBER: specifies that numbering should start from
{\it startFrom
}, otherwise existing attributes are used.
1007 \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.
1010 See also
\helpref{wxRichTextCtrl::SetListStyle
}{wxrichtextctrlsetliststyle
},
\helpref{wxRichTextCtrl::PromoteList
}{wxrichtextctrlpromotelist
},
\helpref{wxRichTextCtrl::ClearListStyle
}{wxrichtextctrlclearliststyle
}.
1012 \membersection{wxRichTextCtrl::OnClear
}\label{wxrichtextctrlonclear
}
1014 \func{void
}{OnClear
}{\param{wxCommandEvent\&
}{event
}}
1016 Standard handler for the wxID
\_CLEAR command.
1018 \membersection{wxRichTextCtrl::OnContextMenu
}\label{wxrichtextctrloncontextmenu
}
1020 \func{void
}{OnContextMenu
}{\param{wxContextMenuEvent\&
}{event
}}
1022 Shows a standard context menu with undo, redo, cut, copy, paste, clear, and select all commands.
1024 \membersection{wxRichTextCtrl::OnCopy
}\label{wxrichtextctrloncopy
}
1026 \func{void
}{OnCopy
}{\param{wxCommandEvent\&
}{event
}}
1028 Standard handler for the wxID
\_COPY command.
1030 \membersection{wxRichTextCtrl::OnCut
}\label{wxrichtextctrloncut
}
1032 \func{void
}{OnCut
}{\param{wxCommandEvent\&
}{event
}}
1034 Standard handler for the wxID
\_CUT command.
1036 \membersection{wxRichTextCtrl::OnDropFiles
}\label{wxrichtextctrlondropfiles
}
1038 \func{void
}{OnDropFiles
}{\param{wxDropFilesEvent\&
}{event
}}
1040 Loads the first dropped file.
1042 \membersection{wxRichTextCtrl::OnPaste
}\label{wxrichtextctrlonpaste
}
1044 \func{void
}{OnPaste
}{\param{wxCommandEvent\&
}{event
}}
1046 Standard handler for the wxID
\_PASTE command.
1048 \membersection{wxRichTextCtrl::OnRedo
}\label{wxrichtextctrlonredo
}
1050 \func{void
}{OnRedo
}{\param{wxCommandEvent\&
}{event
}}
1052 Standard handler for the wxID
\_REDO command.
1054 \membersection{wxRichTextCtrl::OnSelectAll
}\label{wxrichtextctrlonselectall
}
1056 \func{void
}{OnSelectAll
}{\param{wxCommandEvent\&
}{event
}}
1058 Standard handler for the wxID
\_SELECTALL command.
1060 \membersection{wxRichTextCtrl::OnUndo
}\label{wxrichtextctrlonundo
}
1062 \func{void
}{OnUndo
}{\param{wxCommandEvent\&
}{event
}}
1064 Standard handler for the wxID
\_PASTE command.
1066 \membersection{wxRichTextCtrl::OnUpdateClear
}\label{wxrichtextctrlonupdateclear
}
1068 \func{void
}{OnUpdateClear
}{\param{wxUpdateUIEvent\&
}{event
}}
1070 Standard update handler for the wxID
\_CLEAR command.
1072 \membersection{wxRichTextCtrl::OnUpdateCopy
}\label{wxrichtextctrlonupdatecopy
}
1074 \func{void
}{OnUpdateCopy
}{\param{wxUpdateUIEvent\&
}{event
}}
1076 Standard update handler for the wxID
\_COPY command.
1078 \membersection{wxRichTextCtrl::OnUpdateCut
}\label{wxrichtextctrlonupdatecut
}
1080 \func{void
}{OnUpdateCut
}{\param{wxUpdateUIEvent\&
}{event
}}
1082 Standard update handler for the wxID
\_CUT command.
1084 \membersection{wxRichTextCtrl::OnUpdatePaste
}\label{wxrichtextctrlonupdatepaste
}
1086 \func{void
}{OnUpdatePaste
}{\param{wxUpdateUIEvent\&
}{event
}}
1088 Standard update handler for the wxID
\_PASTE command.
1090 \membersection{wxRichTextCtrl::OnUpdateRedo
}\label{wxrichtextctrlonupdateredo
}
1092 \func{void
}{OnUpdateRedo
}{\param{wxUpdateUIEvent\&
}{event
}}
1094 Standard update handler for the wxID
\_REDO command.
1096 \membersection{wxRichTextCtrl::OnUpdateSelectAll
}\label{wxrichtextctrlonupdateselectall
}
1098 \func{void
}{OnUpdateSelectAll
}{\param{wxUpdateUIEvent\&
}{event
}}
1100 Standard update handler for the wxID
\_SELECTALL command.
1102 \membersection{wxRichTextCtrl::OnUpdateUndo
}\label{wxrichtextctrlonupdateundo
}
1104 \func{void
}{OnUpdateUndo
}{\param{wxUpdateUIEvent\&
}{event
}}
1106 Standard update handler for the wxID
\_UNDO command.
1108 \membersection{wxRichTextCtrl::PageDown
}\label{wxrichtextctrlpagedown
}
1110 \func{bool
}{PageDown
}{\param{int
}{noPages =
1},
\param{int
}{flags =
0}}
1112 Moves one or more pages down.
1114 \membersection{wxRichTextCtrl::PageUp
}\label{wxrichtextctrlpageup
}
1116 \func{bool
}{PageUp
}{\param{int
}{noPages =
1},
\param{int
}{flags =
0}}
1118 Moves one or more pages up.
1120 \membersection{wxRichTextCtrl::PaintBackground
}\label{wxrichtextctrlpaintbackground
}
1122 \func{void
}{PaintBackground
}{\param{wxDC\&
}{dc
}}
1124 Paints the background.
1126 \membersection{wxRichTextCtrl::Paste
}\label{wxrichtextctrlpaste
}
1128 \func{void
}{Paste
}{\void}
1130 Pastes content from the clipboard to the buffer.
1132 \membersection{wxRichTextCtrl::PositionCaret
}\label{wxrichtextctrlpositioncaret
}
1134 \func{void
}{PositionCaret
}{\void}
1136 Internal function to position the visible caret according to the current caret position.
1138 \membersection{wxRichTextCtrl::PositionToXY
}\label{wxrichtextctrlpositiontoxy
}
1140 \constfunc{bool
}{PositionToXY
}{\param{long
}{pos
},
\param{long*
}{x
},
\param{long*
}{y
}}
1142 Converts a text position to zero-based column and line numbers.
1144 \membersection{wxRichTextCtrl::PromoteList
}\label{wxrichtextctrlpromotelist
}
1146 \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}}
1148 \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}}
1150 Promotes or demotes the paragraphs in the given range. A positive
{\it promoteBy
} produces a smaller indent, and a negative number
1151 produces a larger indent. Pass flags to determine how the attributes are set.
1152 Either the style definition or the name of the style definition (in the current sheet) can be passed.
1154 {\it flags
} is a bit list of the following:
1156 \begin{itemize
}\itemsep=
0pt
1157 \item wxRICHTEXT
\_SETSTYLE\_WITH\_UNDO: specifies that this command will be undoable.
1158 \item wxRICHTEXT
\_SETSTYLE\_RENUMBER: specifies that numbering should start from
{\it startFrom
}, otherwise existing attributes are used.
1159 \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.
1162 See also
\helpref{wxRichTextCtrl::SetListStyle
}{wxrichtextctrlsetliststyle
}, See also
\helpref{wxRichTextCtrl::SetListStyle
}{wxrichtextctrlnumberlist
},
\helpref{wxRichTextCtrl::ClearListStyle
}{wxrichtextctrlclearliststyle
}.
1164 \membersection{wxRichTextCtrl::Redo
}\label{wxrichtextctrlredo
}
1166 \func{void
}{Redo
}{\void}
1168 Redoes the current command.
1170 \membersection{wxRichTextCtrl::Remove
}\label{wxrichtextctrlremove
}
1172 \func{void
}{Remove
}{\param{long
}{from
},
\param{long
}{to
}}
1174 Removes the content in the specified range.
1176 \membersection{wxRichTextCtrl::Replace
}\label{wxrichtextctrlreplace
}
1178 \func{void
}{Replace
}{\param{long
}{from
},
\param{long
}{to
},
\param{const wxString\&
}{value
}}
1180 Replaces the content in the specified range with the string specified by
{\it value
}.
1182 \membersection{wxRichTextCtrl::SaveFile
}\label{wxrichtextctrlsavefile
}
1184 \func{bool
}{SaveFile
}{\param{const wxString\&
}{file = wxEmptyString
},
\param{int
}{type = wxRICHTEXT
\_TYPE\_ANY}}
1186 Saves the buffer content using the given type. If the specified type
1187 is wxRICHTEXT
\_TYPE\_ANY, the type is deduced from the filename extension.
1189 This function looks for a suitable
\helpref{wxRichTextFileHandler
}{wxrichtextfilehandler
} object.
1191 \membersection{wxRichTextCtrl::ScrollIntoView
}\label{wxrichtextctrlscrollintoview
}
1193 \func{bool
}{ScrollIntoView
}{\param{long
}{position
},
\param{int
}{keyCode
}}
1195 Scrolls
{\it position
} into view. This function takes a caret position.
1197 \membersection{wxRichTextCtrl::SelectAll
}\label{wxrichtextctrlselectall
}
1199 \func{void
}{SelectAll
}{\void}
1201 Selects all the text in the buffer.
1203 \membersection{wxRichTextCtrl::SelectNone
}\label{wxrichtextctrlselectnone
}
1205 \func{void
}{SelectNone
}{\void}
1207 Cancels any selection.
1209 \membersection{wxRichTextCtrl::SetAndShowDefaultStyle
}\label{wxrichtextctrlsetandshowdefaultstyle
}
1211 \func{void
}{SetAndShowDefaultStyle
}{\param{const wxRichTextAttr\&
}{attr
}}
1213 Sets
{\it attr
} as the default style and tells the control that the UI should reflect
1214 this attribute until the user moves the caret.
1216 See also
\helpref{IsDefaultStyleShowing
}{wxrichtextctrlisdefaultstyleshowing
}.
1218 \membersection{wxRichTextCtrl::SetBasicStyle
}\label{wxrichtextctrlsetbasicstyle
}
1220 \func{void
}{SetBasicStyle
}{\param{const wxRichTextAttr\&
}{style
}}
1222 \func{void
}{SetBasicStyle
}{\param{const wxTextAttrEx\&
}{style
}}
1224 Sets the basic (overall) style. This is the style of the whole
1225 buffer before further styles are applied, unlike the default style, which
1226 only affects the style currently being applied (for example, setting the default
1227 style to bold will cause subsequently inserted text to be bold).
1229 \membersection{wxRichTextCtrl::SetCaretPosition
}\label{wxrichtextctrlsetcaretposition
}
1231 \func{void
}{SetCaretPosition
}{\param{long
}{position
},
\param{bool
}{showAtLineStart = false
}}
1233 The caret position is the character position just before the caret.
1234 A value of -
1 means the caret is at the start of the buffer.
1236 \membersection{wxRichTextCtrl::SetDefaultStyle
}\label{wxrichtextctrlsetdefaultstyle
}
1238 \func{bool
}{SetDefaultStyle
}{\param{const wxTextAttrEx\&
}{style
}}
1240 Sets the current default style, which can be used to change how subsequently inserted
1243 \membersection{wxRichTextCtrl::SetDefaultStyleToCursorStyle
}\label{wxrichtextctrlsetdefaultstyletocursorstyle
}
1245 \func{bool
}{SetDefaultStyleToCursorStyle
}{\void}
1247 Sets the default style to the style under the cursor.
1249 \membersection{wxRichTextCtrl::SetDelayedLayoutThreshold
}\label{wxrichtextctrlsetdelayedlayoutthreshold
}
1251 \func{void
}{SetDelayedLayoutThreshold
}{\param{long
}{threshold
}}
1253 Sets the size of the buffer beyond which layout is delayed during resizing.
1254 This optimizes sizing for large buffers. The default is
20000.
1256 \membersection{wxRichTextCtrl::SetEditable
}\label{wxrichtextctrlseteditable
}
1258 \func{void
}{SetEditable
}{\param{bool
}{editable
}}
1260 Makes the control editable, or not.
1262 \membersection{wxRichTextCtrl::SetFilename
}\label{wxrichtextctrlsetfilename
}
1264 \func{void
}{SetFilename
}{\param{const wxString\&
}{filename
}}
1266 Sets the current filename.
1268 \membersection{wxRichTextCtrl::SetFont
}\label{wxrichtextctrlsetfont
}
1270 \func{bool
}{SetFont
}{\param{const wxFont\&
}{font
}}
1272 Sets the font, and also the basic and default attributes (see
\helpref{SetDefaultStyle
}{wxrichtextctrlsetdefaultstyle
}).
1274 \membersection{wxRichTextCtrl::SetInsertionPoint
}\label{wxrichtextctrlsetinsertionpoint
}
1276 \func{void
}{SetInsertionPoint
}{\param{long
}{pos
}}
1278 Sets the insertion point.
1280 \membersection{wxRichTextCtrl::SetInsertionPointEnd
}\label{wxrichtextctrlsetinsertionpointend
}
1282 \func{void
}{SetInsertionPointEnd
}{\void}
1284 Sets the insertion point to the end of the text control.
1286 \membersection{wxRichTextCtrl::SetListStyle
}\label{wxrichtextctrlsetliststyle
}
1288 \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}}
1290 \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}}
1292 Sets the list attributes for the given range, passing flags to determine how the attributes are set.
1293 Either the style definition or the name of the style definition (in the current sheet) can be passed.
1295 {\it flags
} is a bit list of the following:
1297 \begin{itemize
}\itemsep=
0pt
1298 \item wxRICHTEXT
\_SETSTYLE\_WITH\_UNDO: specifies that this command will be undoable.
1299 \item wxRICHTEXT
\_SETSTYLE\_RENUMBER: specifies that numbering should start from
{\it startFrom
}, otherwise existing attributes are used.
1300 \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.
1303 See also
\helpref{wxRichTextCtrl::NumberList
}{wxrichtextctrlnumberlist
},
\helpref{wxRichTextCtrl::PromoteList
}{wxrichtextctrlpromotelist
},
\helpref{wxRichTextCtrl::ClearListStyle
}{wxrichtextctrlclearliststyle
}.
1305 \membersection{wxRichTextCtrl::SetSelection
}\label{wxrichtextctrlsetselection
}
1307 \func{void
}{SetSelection
}{\param{long
}{from
},
\param{long
}{to
}}
1309 Sets the selection to the given range.
1311 The end point of range is specified as the last character position of the span of text, plus one.
1312 So, for example, to set the style for a character at position
5, use the range (
5,
6).
1314 \membersection{wxRichTextCtrl::SetSelectionRange
}\label{wxrichtextctrlsetselectionrange
}
1316 \func{void
}{SetSelectionRange
}{\param{const wxRichTextRange\&
}{range
}}
1318 Sets the selection to the given range.
1320 The end point of range is specified as the last character position of the span of text, plus one.
1321 So, for example, to set the style for a character at position
5, use the range (
5,
6).
1323 \membersection{wxRichTextCtrl::SetStyle
}\label{wxrichtextctrlsetstyle
}
1325 \func{bool
}{SetStyle
}{\param{const wxRichTextRange\&
}{range
},
\param{const wxRichTextAttr\&
}{style
}}
1327 \func{bool
}{SetStyle
}{\param{long
}{start
},
\param{long
}{end
},
\param{const wxTextAttrEx\&
}{style
}}
1329 \func{bool
}{SetStyle
}{\param{long
}{start
},
\param{long
}{end
},
\param{const wxTextAttr\&
}{style
}}
1331 Sets the attributes for the given range. The wxRichTextAttr version is more efficient
1332 because it does not use wxFont objects.
1334 The end point of range is specified as the last character position of the span of text, plus one.
1335 So, for example, to set the style for a character at position
5, use the range (
5,
6).
1337 \membersection{wxRichTextCtrl::SetStyleEx
}\label{wxrichtextctrlsetstyleex
}
1339 \func{bool
}{SetStyleEx
}{\param{const wxRichTextRange\&
}{range
},
\param{const wxRichTextAttr\&
}{style
},
\param{int
}{flags $=$ wxRICHTEXT
\_SETSTYLE\_WITH\_UNDO}}
1341 \func{bool
}{SetStyleEx
}{\param{const wxRichTextRange\&
}{range
},
\param{const wxTextAttrEx\&
}{style
},
\param{int
}{flags $=$ wxRICHTEXT
\_SETSTYLE\_WITH\_UNDO}}
1343 \func{bool
}{SetStyleEx
}{\param{long
}{start
},
\param{long
}{end
},
\param{const wxTextAttrEx\&
}{style
},
\param{int
}{flags $=$ wxRICHTEXT
\_SETSTYLE\_WITH\_UNDO}}
1345 Sets the attributes for the given range, passing flags to determine how the attributes are set. The wxRichTextAttr version is more efficient
1346 because it does not use wxFont objects.
1348 The end point of range is specified as the last character position of the span of text, plus one.
1349 So, for example, to set the style for a character at position
5, use the range (
5,
6).
1351 {\it flags
} may contain a bit list of the following values:
1353 \begin{itemize
}\itemsep=
0pt
1354 \item wxRICHTEXT
\_SETSTYLE\_NONE: no style flag.
1355 \item wxRICHTEXT
\_SETSTYLE\_WITH\_UNDO: specifies that this operation should be undoable.
1356 \item wxRICHTEXT
\_SETSTYLE\_OPTIMIZE: specifies that the style should not be applied if the
1357 combined style at this point is already the style in question.
1358 \item define wxRICHTEXT
\_SETSTYLE\_PARAGRAPHS\_ONLY: specifies that the style should only be applied to paragraphs,
1359 and not the content. This allows content styling to be preserved independently from that of e.g. a named paragraph style.
1360 \item wxRICHTEXT
\_SETSTYLE\_CHARACTERS\_ONLY: specifies that the style should only be applied to characters,
1361 and not the paragraph. This allows content styling to be preserved independently from that of e.g. a named paragraph style.
1364 \membersection{wxRichTextCtrl::SetStyleSheet
}\label{wxrichtextctrlsetstylesheet
}
1366 \func{void
}{SetStyleSheet
}{\param{wxRichTextStyleSheet*
}{styleSheet
}}
1368 Sets the style sheet associated with the control. A style sheet allows named
1369 character and paragraph styles to be applied.
1371 \membersection{wxRichTextCtrl::SetValue
}\label{wxrichtextctrlsetvalue
}
1373 \func{void
}{SetValue
}{\param{const wxString\&
}{value
}}
1375 Replaces existing content with the given text.
1377 \membersection{wxRichTextCtrl::SetupScrollbars
}\label{wxrichtextctrlsetupscrollbars
}
1379 \func{void
}{SetupScrollbars
}{\param{bool
}{atTop = false
}}
1381 A helper function setting up scrollbars, for example after a resize.
1383 \membersection{wxRichTextCtrl::ShowPosition
}\label{wxrichtextctrlshowposition
}
1385 \func{void
}{ShowPosition
}{\param{long
}{pos
}}
1387 Scrolls the buffer so that the given position is in view.
1389 \membersection{wxRichTextCtrl::SuppressingUndo
}\label{wxrichtextctrlsuppressingundo
}
1391 \constfunc{bool
}{SuppressingUndo
}{\void}
1393 Returns
\true if undo history suppression is on.
1395 \membersection{wxRichTextCtrl::Thaw
}\label{wxrichtextctrlthaw
}
1397 \func{void
}{Thaw
}{\void}
1399 Call this function to end a Freeze and refresh the display.
1401 \membersection{wxRichTextCtrl::Undo
}\label{wxrichtextctrlundo
}
1403 \func{void
}{Undo
}{\void}
1405 Undoes the command at the top of the command history, if there is one.
1407 \membersection{wxRichTextCtrl::WordLeft
}\label{wxrichtextctrlwordleft
}
1409 \func{bool
}{WordLeft
}{\param{int
}{noWords =
1},
\param{int
}{flags =
0}}
1411 Moves a number of words to the left.
1413 \membersection{wxRichTextCtrl::WordRight
}\label{wxrichtextctrlwordright
}
1415 \func{bool
}{WordRight
}{\param{int
}{noWords =
1},
\param{int
}{flags =
0}}
1417 Move a nuber of words to the right.
1419 \membersection{wxRichTextCtrl::WriteImage
}\label{wxrichtextctrlwriteimage
}
1421 \func{bool
}{WriteImage
}{\param{const wxString\&
}{filename
},
\param{int
}{bitmapType
}}
1423 Loads an image from a file and writes it at the current insertion point.
1425 \func{bool
}{WriteImage
}{\param{const wxRichTextImageBlock\&
}{imageBlock
}}
1427 Writes an image block at the current insertion point.
1429 \func{bool
}{WriteImage
}{\param{const wxBitmap\&
}{bitmap
},
\param{int
}{bitmapType = wxBITMAP
\_TYPE\_PNG}}
1431 \func{bool
}{WriteImage
}{\param{const wxImage\&
}{image
},
\param{int
}{bitmapType = wxBITMAP
\_TYPE\_PNG}}
1433 Write a bitmap or image at the current insertion point. Supply an optional type to use
1434 for internal and file storage of the raw data.
1436 \membersection{wxRichTextCtrl::WriteText
}\label{wxrichtextctrlwritetext
}
1438 \func{void
}{WriteText
}{\param{const wxString\&
}{text
}}
1440 Writes text at the current position.
1442 \membersection{wxRichTextCtrl::XYToPosition
}\label{wxrichtextctrlxytoposition
}
1444 \constfunc{long
}{XYToPosition
}{\param{long
}{x
},
\param{long
}{y
}}
1446 Translates from column and line number to position.