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
0x0000
196 #define wxTEXT_ATTR_BULLET_STYLE_ARABIC
0x0001
197 #define wxTEXT_ATTR_BULLET_STYLE_LETTERS_UPPER
0x0002
198 #define wxTEXT_ATTR_BULLET_STYLE_LETTERS_LOWER
0x0004
199 #define wxTEXT_ATTR_BULLET_STYLE_ROMAN_UPPER
0x0008
200 #define wxTEXT_ATTR_BULLET_STYLE_ROMAN_LOWER
0x0010
201 #define wxTEXT_ATTR_BULLET_STYLE_SYMBOL
0x0020
202 #define wxTEXT_ATTR_BULLET_STYLE_BITMAP
0x0040
203 #define wxTEXT_ATTR_BULLET_STYLE_PARENTHESES
0x0080
204 #define wxTEXT_ATTR_BULLET_STYLE_PERIOD
0x0100
208 wxRichTextBuffer uses indentation to render a bulleted item. The left indent is the distance between
209 the margin and the bullet. The content of the paragraph, including the first line, starts
210 at leftMargin + leftSubIndent. So the distance between the left edge of the bullet and the
211 left of the actual paragraph is leftSubIndent.
213 \membersection{wxRichTextCtrl::BeginParagraphSpacing
}\label{wxrichtextctrlbeginparagraphspacing
}
215 \func{bool
}{BeginParagraphSpacing
}{\param{int
}{before
},
\param{int
}{after
}}
217 Begins paragraph spacing; pass the before-paragraph and after-paragraph spacing in tenths of
220 \membersection{wxRichTextCtrl::BeginParagraphStyle
}\label{wxrichtextctrlbeginparagraphstyle
}
222 \func{bool
}{BeginParagraphStyle
}{\param{const wxString\&
}{paragraphStyle
}}
224 Begins applying the named paragraph style.
226 \membersection{wxRichTextCtrl::BeginRightIndent
}\label{wxrichtextctrlbeginrightindent
}
228 \func{bool
}{BeginRightIndent
}{\param{int
}{rightIndent
}}
230 Begins a right indent, specified in tenths of a millimetre.
232 \membersection{wxRichTextCtrl::BeginStyle
}\label{wxrichtextctrlbeginstyle
}
234 \func{bool
}{BeginStyle
}{\param{const wxTextAttrEx\&
}{style
}}
236 Begins applying a style.
238 \membersection{wxRichTextCtrl::BeginSuppressUndo
}\label{wxrichtextctrlbeginsuppressundo
}
240 \func{bool
}{BeginSuppressUndo
}{\void}
242 Starts suppressing undo history for commands.
244 \membersection{wxRichTextCtrl::BeginSymbolBullet
}\label{wxrichtextctrlbeginsymbolbullet
}
246 \func{bool
}{BeginSymbolBullet
}{\param{wxChar
}{symbol
},
\param{int
}{leftIndent
},
\param{int
}{leftSubIndent
},
\param{int
}{bulletStyle = wxTEXT
\_ATTR\_BULLET\_STYLE\_SYMBOL}}
248 Begins applying a symbol bullet, using a character from the current font. See
\helpref{BeginNumberedBullet
}{wxrichtextctrlbeginnumberedbullet
} for
249 an explanation of how indentation is used to render the bulleted paragraph.
251 \membersection{wxRichTextCtrl::BeginTextColour
}\label{wxrichtextctrlbegintextcolour
}
253 \func{bool
}{BeginTextColour
}{\param{const wxColour\&
}{colour
}}
255 Begins using this colour.
257 \membersection{wxRichTextCtrl::BeginUnderline
}\label{wxrichtextctrlbeginunderline
}
259 \func{bool
}{BeginUnderline
}{\void}
261 Begins using underlining.
263 \membersection{wxRichTextCtrl::BeginURL
}\label{wxrichtextctrlbeginurl
}
265 \func{bool
}{BeginURL
}{\param{const wxString\&
}{ url
},
\param{const wxString\&
}{ characterStyle = wxEmptyString
}}
267 Begins applying wxTEXT
\_ATTR\_URL to the content. Pass a URL and optionally, a character style to apply,
268 since it is common to mark a URL with a familiar style such as blue text with underlining.
270 \membersection{wxRichTextCtrl::CanCopy
}\label{wxrichtextctrlcancopy
}
272 \constfunc{bool
}{CanCopy
}{\void}
274 Returns
\true if selected content can be copied to the clipboard.
276 \membersection{wxRichTextCtrl::CanCut
}\label{wxrichtextctrlcancut
}
278 \constfunc{bool
}{CanCut
}{\void}
280 Returns
\true if selected content can be copied to the clipboard and deleted.
282 \membersection{wxRichTextCtrl::CanDeleteSelection
}\label{wxrichtextctrlcandeleteselection
}
284 \constfunc{bool
}{CanDeleteSelection
}{\void}
286 Returns
\true if selected content can be deleted.
288 \membersection{wxRichTextCtrl::CanPaste
}\label{wxrichtextctrlcanpaste
}
290 \constfunc{bool
}{CanPaste
}{\void}
292 Returns
\true if the clipboard content can be pasted to the buffer.
294 \membersection{wxRichTextCtrl::CanRedo
}\label{wxrichtextctrlcanredo
}
296 \constfunc{bool
}{CanRedo
}{\void}
298 Returns
\true if there is a command in the command history that can be redone.
300 \membersection{wxRichTextCtrl::CanUndo
}\label{wxrichtextctrlcanundo
}
302 \constfunc{bool
}{CanUndo
}{\void}
304 Returns
\true if there is a command in the command history that can be undone.
306 \membersection{wxRichTextCtrl::Clear
}\label{wxrichtextctrlclear
}
308 \func{void
}{Clear
}{\void}
310 Clears the buffer content, leaving a single empty paragraph. Cannot be undone.
312 \membersection{wxRichTextCtrl::Command
}\label{wxrichtextctrlcommand
}
314 \func{void
}{Command
}{\param{wxCommandEvent\&
}{event
}}
316 Sends the event to the control.
318 \membersection{wxRichTextCtrl::Copy
}\label{wxrichtextctrlcopy
}
320 \func{void
}{Copy
}{\void}
322 Copies the selected content (if any) to the clipboard.
324 \membersection{wxRichTextCtrl::Create
}\label{wxrichtextctrlcreate
}
326 \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}}
328 Creates the underlying window.
330 \membersection{wxRichTextCtrl::Cut
}\label{wxrichtextctrlcut
}
332 \func{void
}{Cut
}{\void}
334 Copies the selected content (if any) to the clipboard and deletes the selection.
337 \membersection{wxRichTextCtrl::DeleteSelectedContent
}\label{wxrichtextctrldeleteselectedcontent
}
339 \func{bool
}{DeleteSelectedContent
}{\param{long*
}{newPos = NULL
}}
341 Deletes content if there is a selection, e.g. when pressing a key.
342 Returns the new caret position in
{\it newPos
}, or leaves it if there
343 was no action. This is undoable.
345 \membersection{wxRichTextCtrl::DeleteSelection
}\label{wxrichtextctrldeleteselection
}
347 \func{void
}{DeleteSelection
}{\void}
349 Deletes the content in the selection, if any. This is undoable.
351 \membersection{wxRichTextCtrl::DiscardEdits
}\label{wxrichtextctrldiscardedits
}
353 \func{void
}{DiscardEdits
}{\void}
355 Sets the buffer's modified status to
\false, and clears the buffer's command history.
357 \membersection{wxRichTextCtrl::DoGetBestSize
}\label{wxrichtextctrldogetbestsize
}
359 \constfunc{wxSize
}{DoGetBestSize
}{\void}
361 Currently this simply returns
{\tt wxSize(
10,
10)
}.
363 \membersection{wxRichTextCtrl::EndAlignment
}\label{wxrichtextctrlendalignment
}
365 \func{bool
}{EndAlignment
}{\void}
369 \membersection{wxRichTextCtrl::EndAllStyles
}\label{wxrichtextctrlendallstyles
}
371 \func{bool
}{EndAllStyles
}{\void}
373 Ends application of all styles in the current style stack.
375 \membersection{wxRichTextCtrl::EndBatchUndo
}\label{wxrichtextctrlendbatchundo
}
377 \func{bool
}{EndBatchUndo
}{\void}
379 Ends batching undo command history.
381 \membersection{wxRichTextCtrl::EndBold
}\label{wxrichtextctrlendbold
}
383 \func{bool
}{EndBold
}{\void}
387 \membersection{wxRichTextCtrl::EndCharacterStyle
}\label{wxrichtextctrlendcharacterstyle
}
389 \func{bool
}{EndCharacterStyle
}{\void}
391 Ends application of a named character style.
393 \membersection{wxRichTextCtrl::EndFont
}\label{wxrichtextctrlendfont
}
395 \func{bool
}{EndFont
}{\void}
399 \membersection{wxRichTextCtrl::EndFontSize
}\label{wxrichtextctrlendfontsize
}
401 \func{bool
}{EndFontSize
}{\void}
403 Ends using a point size.
405 \membersection{wxRichTextCtrl::EndItalic
}\label{wxrichtextctrlenditalic
}
407 \func{bool
}{EndItalic
}{\void}
411 \membersection{wxRichTextCtrl::EndLeftIndent
}\label{wxrichtextctrlendleftindent
}
413 \func{bool
}{EndLeftIndent
}{\void}
417 \membersection{wxRichTextCtrl::EndLineSpacing
}\label{wxrichtextctrlendlinespacing
}
419 \func{bool
}{EndLineSpacing
}{\void}
423 \membersection{wxRichTextCtrl::EndListStyle
}\label{wxrichtextctrlendliststyle
}
425 \func{bool
}{EndListStyle
}{\void}
427 Ends using a specified list style.
429 \membersection{wxRichTextCtrl::EndNumberedBullet
}\label{wxrichtextctrlendnumberedbullet
}
431 \func{bool
}{EndNumberedBullet
}{\void}
433 Ends application of a numbered bullet.
435 \membersection{wxRichTextCtrl::EndParagraphSpacing
}\label{wxrichtextctrlendparagraphspacing
}
437 \func{bool
}{EndParagraphSpacing
}{\void}
439 Ends paragraph spacing.
441 \membersection{wxRichTextCtrl::EndParagraphStyle
}\label{wxrichtextctrlendparagraphstyle
}
443 \func{bool
}{EndParagraphStyle
}{\void}
445 Ends application of a named character style.
447 \membersection{wxRichTextCtrl::EndRightIndent
}\label{wxrichtextctrlendrightindent
}
449 \func{bool
}{EndRightIndent
}{\void}
453 \membersection{wxRichTextCtrl::EndStyle
}\label{wxrichtextctrlendstyle
}
455 \func{bool
}{EndStyle
}{\void}
457 Ends the current style.
459 \membersection{wxRichTextCtrl::EndSuppressUndo
}\label{wxrichtextctrlendsuppressundo
}
461 \func{bool
}{EndSuppressUndo
}{\void}
463 Ends suppressing undo command history.
465 \membersection{wxRichTextCtrl::EndSymbolBullet
}\label{wxrichtextctrlendsymbolbullet
}
467 \func{bool
}{EndSymbolBullet
}{\void}
469 Ends applying a symbol bullet.
471 \membersection{wxRichTextCtrl::EndTextColour
}\label{wxrichtextctrlendtextcolour
}
473 \func{bool
}{EndTextColour
}{\void}
475 Ends applying a text colour.
477 \membersection{wxRichTextCtrl::EndUnderline
}\label{wxrichtextctrlendunderline
}
479 \func{bool
}{EndUnderline
}{\void}
481 End applying underlining.
483 \membersection{wxRichTextCtrl::EndURL
}\label{wxrichtextctrlendurl
}
485 \func{bool
}{EndURL
}{\void}
489 \membersection{wxRichTextCtrl::ExtendSelection
}\label{wxrichtextctrlextendselection
}
491 \func{bool
}{ExtendSelection
}{\param{long
}{oldPosition
},
\param{long
}{newPosition
},
\param{int
}{flags
}}
493 Helper function for extending the selection, returning
\true if the selection was
494 changed. Selections are in caret positions.
496 \membersection{wxRichTextCtrl::FindNextWordPosition
}\label{wxrichtextctrlfindnextwordposition
}
498 \constfunc{long
}{FindNextWordPosition
}{\param{int
}{direction =
1}}
500 Helper function for finding the caret position for the next word. Direction
501 is
1 (forward) or -
1 (backwards).
503 \membersection{wxRichTextCtrl::Freeze
}\label{wxrichtextctrlfreeze
}
505 \func{void
}{Freeze
}{\void}
507 Call this function to prevent refresh and allow fast updates, and then
\helpref{Thaw
}{wxrichtextctrlthaw
} to
510 \membersection{wxRichTextCtrl::GetBasicStyle
}\label{wxrichtextctrlgetbasicstyle
}
512 \constfunc{const wxTextAttrEx\&
}{GetBasicStyle
}{\void}
514 Gets the basic (overall) style. This is the style of the whole
515 buffer before further styles are applied, unlike the default style, which
516 only affects the style currently being applied (for example, setting the default
517 style to bold will cause subsequently inserted text to be bold).
519 \membersection{wxRichTextCtrl::GetBuffer
}\label{wxrichtextctrlgetbuffer
}
521 \constfunc{const wxRichTextBuffer\&
}{GetBuffer
}{\void}
523 \func{wxRichTextBuffer\&
}{GetBuffer
}{\void}
525 Returns the buffer associated with the control.
527 \membersection{wxRichTextCtrl::GetCaretPosition
}\label{wxrichtextctrlgetcaretposition
}
529 \constfunc{long
}{GetCaretPosition
}{\void}
531 Returns the current caret position.
533 \membersection{wxRichTextCtrl::GetCaretPositionForIndex
}\label{wxrichtextctrlgetcaretpositionforindex
}
535 \func{bool
}{GetCaretPositionForIndex
}{\param{long
}{position
},
\param{wxRect\&
}{rect
}}
537 Returns the caret height and position for the given character position
539 \membersection{wxRichTextCtrl::GetCommandProcessor
}\label{wxrichtextctrlgetcommandprocessor
}
541 \constfunc{wxCommandProcessor*
}{GetCommandProcessor
}{\void}
543 Gets the command processor associated with the control's buffer.
545 \membersection{wxRichTextCtrl::GetDefaultStyleEx
}\label{wxrichtextctrlgetdefaultstyleex
}
547 \constfunc{const wxTextAttrEx\&
}{GetDefaultStyleEx
}{\void}
549 Returns the current default style, which can be used to change how subsequently inserted
550 text is displayed. When wxTextAttrEx is merged with wxTextAttr, this function
551 will become GetDefaultStyle.
553 \membersection{wxRichTextCtrl::GetDelayedLayoutThreshold
}\label{wxrichtextctrlgetdelayedlayoutthreshold
}
555 \constfunc{long
}{GetDelayedLayoutThreshold
}{\void}
557 Gets the size of the buffer beyond which layout is delayed during resizing.
558 This optimizes sizing for large buffers. The default is
20000.
560 \membersection{wxRichTextCtrl::GetFilename
}\label{wxrichtextctrlgetfilename
}
562 \constfunc{wxString
}{GetFilename
}{\void}
564 Gets the current filename associated with the control.
566 \membersection{wxRichTextCtrl::GetFirstVisiblePosition
}\label{wxrichtextctrlgetfirstvisibleposition
}
568 \constfunc{long
}{GetFirstVisiblePosition
}{\void}
570 Returns the first visible position in the current view.
572 \membersection{wxRichTextCtrl::GetInsertionPoint
}\label{wxrichtextctrlgetinsertionpoint
}
574 \constfunc{long
}{GetInsertionPoint
}{\void}
576 Returns the current insertion point.
578 \membersection{wxRichTextCtrl::GetLastPosition
}\label{wxrichtextctrlgetlastposition
}
580 \constfunc{wxTextPos
}{GetLastPosition
}{\void}
582 Returns the last position in the buffer.
584 \membersection{wxRichTextCtrl::GetLineLength
}\label{wxrichtextctrlgetlinelength
}
586 \constfunc{int
}{GetLineLength
}{\param{long
}{lineNo
}}
588 Returns the length of the specified line in characters.
590 \membersection{wxRichTextCtrl::GetLineText
}\label{wxrichtextctrlgetlinetext
}
592 \constfunc{wxString
}{GetLineText
}{\param{long
}{lineNo
}}
594 Returns the text for the given line.
596 \membersection{wxRichTextCtrl::GetLogicalPoint
}\label{wxrichtextctrlgetlogicalpoint
}
598 \constfunc{wxPoint
}{GetLogicalPoint
}{\param{const wxPoint\&
}{ptPhysical
}}
600 Transforms physical window position to logical (unscrolled) position.
602 \membersection{wxRichTextCtrl::GetNumberOfLines
}\label{wxrichtextctrlgetnumberoflines
}
604 \constfunc{int
}{GetNumberOfLines
}{\void}
606 Returns the number of lines in the buffer.
608 \membersection{wxRichTextCtrl::GetPhysicalPoint
}\label{wxrichtextctrlgetphysicalpoint
}
610 \constfunc{wxPoint
}{GetPhysicalPoint
}{\param{const wxPoint\&
}{ptLogical
}}
612 Transforms logical (unscrolled) position to physical window position.
614 \membersection{wxRichTextCtrl::GetRange
}\label{wxrichtextctrlgetrange
}
616 \constfunc{wxString
}{GetRange
}{\param{long
}{from
},
\param{long
}{to
}}
618 Gets the text for the given range.
620 The end point of range is specified as the last character position of the span of text, plus one.
622 \membersection{wxRichTextCtrl::GetSelection
}\label{wxrichtextctrlgetselection
}
624 \constfunc{void
}{GetSelection
}{\param{long*
}{from
},
\param{long*
}{to
}}
626 Returns the range of the current selection.
628 The end point of range is specified as the last character position of the span of text, plus one.
630 If the return values
{\it from
} and
{\it to
} are the same, there is no selection.
632 \membersection{wxRichTextCtrl::GetSelectionRange
}\label{wxrichtextctrlgetselectionrange
}
634 \constfunc{const wxRichTextRange\&
}{GetSelectionRange
}{\void}
636 Returns the selection range in character positions. -
1, -
1 means no selection.
638 \membersection{wxRichTextCtrl::GetStringSelection
}\label{wxrichtextctrlgetstringselection
}
640 \constfunc{wxString
}{GetStringSelection
}{\void}
642 Returns the text within the current selection range, if any.
644 \membersection{wxRichTextCtrl::GetStyle
}\label{wxrichtextctrlgetstyle
}
646 \func{bool
}{GetStyle
}{\param{long
}{position
},
\param{wxRichTextAttr\&
}{style
}}
648 \func{bool
}{GetStyle
}{\param{long
}{position
},
\param{wxTextAttrEx\&
}{style
}}
650 \func{bool
}{GetStyle
}{\param{long
}{position
},
\param{wxTextAttr\&
}{style
}}
652 Gets the attributes at the given position. The wxRichTextAttr version is generally more efficient
653 because it does not use wxFont objects.
655 This function gets the combined style - that is, the style you see on the screen as a result
656 of combining base style, paragraph style and character style attributes. To get the character
657 or paragraph style alone, use
\helpref{GetUncombinedStyle
}{wxrichtextctrlgetuncombinedstyle
}.
659 \membersection{wxRichTextCtrl::GetStyleSheet
}\label{wxrichtextctrlgetstylesheet
}
661 \constfunc{wxRichTextStyleSheet*
}{GetStyleSheet
}{\void}
663 Returns the style sheet associated with the control, if any. A style sheet allows named
664 character and paragraph styles to be applied.
666 \membersection{wxRichTextCtrl::GetUncombinedStyle
}\label{wxrichtextctrlgetuncombinedstyle
}
668 \func{bool
}{GetUncombinedStyle
}{\param{long
}{position
},
\param{wxRichTextAttr\&
}{style
}}
670 \func{bool
}{GetUncombinedStyle
}{\param{long
}{position
},
\param{wxTextAttrEx\&
}{style
}}
672 \func{bool
}{GetUncombinedStyle
}{\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
{\it uncombined style
} - that is, the attributes associated with the
678 paragraph or character content, and not necessarily the combined attributes you see on the
679 screen. To get the combined attributes, use
\helpref{GetStyle
}{wxrichtextctrlgetstyle
}.
681 If you specify (any) paragraph attribute in
{\it style
}'s flags, this function will fetch
682 the paragraph attributes. Otherwise, it will return the character attributes.
684 \membersection{wxRichTextCtrl::GetValue
}\label{wxrichtextctrlgetvalue
}
686 \constfunc{wxString
}{GetValue
}{\void}
688 Returns the content of the entire control as a string.
690 \membersection{wxRichTextCtrl::GetVisibleLineForCaretPosition
}\label{wxrichtextctrlgetvisiblelineforcaretposition
}
692 \constfunc{wxRichTextLine*
}{GetVisibleLineForCaretPosition
}{\param{long
}{caretPosition
}}
694 Internal helper function returning the line for the visible caret position. If the caret is
695 shown at the very end of the line, it means the next character is actually
696 on the following line. So this function gets the line we're expecting to find
699 \membersection{wxRichTextCtrl::HasCharacterAttributes
}\label{wxrichtextctrlhascharacterattributes
}
701 \constfunc{bool
}{HasCharacterAttributes
}{\param{const wxRichTextRange\&
}{range
},
\param{const wxTextAttrEx\&
}{style
}}
703 \constfunc{bool
}{HasCharacterAttributes
}{\param{const wxRichTextRange\&
}{range
},
\param{const wxRichTextAttr\&
}{style
}}
705 Test if this whole range has character attributes of the specified kind. If any
706 of the attributes are different within the range, the test fails. You
707 can use this to implement, for example, bold button updating.
{\it style
} must have
708 flags indicating which attributes are of interest.
710 \membersection{wxRichTextCtrl::HasParagraphAttributes
}\label{wxrichtextctrlhasparagraphattributes
}
712 \constfunc{bool
}{HasParagraphAttributes
}{\param{const wxRichTextRange\&
}{range
},
\param{const wxTextAttrEx\&
}{style
}}
714 \constfunc{bool
}{HasParagraphAttributes
}{\param{const wxRichTextRange\&
}{range
},
\param{const wxRichTextAttr\&
}{style
}}
716 Test if this whole range has paragraph attributes of the specified kind. If any
717 of the attributes are different within the range, the test fails. You
718 can use this to implement, for example, centering button updating.
{\it style
} must have
719 flags indicating which attributes are of interest.
721 \membersection{wxRichTextCtrl::HasSelection
}\label{wxrichtextctrlhasselection
}
723 \constfunc{bool
}{HasSelection
}{\void}
725 Returns
\true if there is a selection.
727 \membersection{wxRichTextCtrl::HitTest
}\label{wxrichtextctrlhittest
}
729 \constfunc{wxTextCtrlHitTestResult
}{HitTest
}{\param{const wxPoint\&
}{pt
},
\param{long*
}{pos
}}
731 \constfunc{wxTextCtrlHitTestResult
}{HitTest
}{\param{const wxPoint\&
}{pt
},
\param{wxTextCoord*
}{col
},
\param{wxTextCoord*
}{row
}}
733 Finds the character at the given position in pixels.
735 {\it pt
} is in device coords (not adjusted for the client area origin nor for scrolling).
737 \membersection{wxRichTextCtrl::Init
}\label{wxrichtextctrlinit
}
739 \func{void
}{Init
}{\void}
741 Initialises the members of the control.
743 \membersection{wxRichTextCtrl::InitCommandEvent
}\label{wxrichtextctrlinitcommandevent
}
745 \constfunc{void
}{InitCommandEvent
}{\param{wxCommandEvent\&
}{event
}}
747 Initialises the command event.
749 \membersection{wxRichTextCtrl::IsDefaultStyleShowing
}\label{wxrichtextctrlisdefaultstyleshowing
}
751 \constfunc{bool
}{IsDefaultStyleShowing
}{\void}
753 Returns
\true if the user has recently set the default style without moving the caret,
754 and therefore the UI needs to reflect the default style and not the style at the caret.
756 Below is an example of code that uses this function to determine whether the UI
757 should show that the current style is bold.
760 /// Is all of the selection bold?
761 bool wxRichTextCtrl::IsSelectionBold()
766 wxRichTextRange range = GetInternalSelectionRange();
767 attr.SetFlags(wxTEXT_ATTR_FONT_WEIGHT);
768 attr.SetFontWeight(wxBOLD);
770 return HasCharacterAttributes(range, attr);
774 // If no selection, then we need to combine current style with default style
775 // to see what the effect would be if we started typing.
777 attr.SetFlags(wxTEXT_ATTR_FONT_WEIGHT);
779 long pos = GetAdjustedCaretPosition(GetCaretPosition());
780 if (GetStyle(pos, attr))
782 if (IsDefaultStyleShowing())
783 wxRichTextApplyStyle(attr, GetDefaultStyleEx());
784 return attr.GetFontWeight() == wxBOLD;
791 See also
\helpref{SetAndShowDefaultStyle
}{wxrichtextctrlsetandshowdefaultstyle
}.
793 \membersection{wxRichTextCtrl::IsEditable
}\label{wxrichtextctrliseditable
}
795 \constfunc{bool
}{IsEditable
}{\void}
797 Returns
\true if the control is editable.
799 \membersection{wxRichTextCtrl::IsFrozen
}\label{wxrichtextctrlisfrozen
}
801 \constfunc{bool
}{IsFrozen
}{\void}
803 Returns
\true if Freeze has been called without a Thaw.
805 \membersection{wxRichTextCtrl::IsModified
}\label{wxrichtextctrlismodified
}
807 \constfunc{bool
}{IsModified
}{\void}
809 Returns
\true if the buffer has been modified.
811 \membersection{wxRichTextCtrl::IsMultiLine
}\label{wxrichtextctrlismultiline
}
813 \constfunc{bool
}{IsMultiLine
}{\void}
815 Returns
\true if the control is multiline.
817 \membersection{wxRichTextCtrl::IsPositionVisible
}\label{wxrichtextctrlispositionvisible
}
819 \constfunc{bool
}{IsPositionVisible
}{\param{long
}{pos
}}
821 Returns
\true if the given position is visible on the screen.
823 \membersection{wxRichTextCtrl::IsSelectionAligned
}\label{wxrichtextctrlisselectionaligned
}
825 \constfunc{bool
}{IsSelectionAligned
}{\param{wxTextAttrAlignment
}{alignment
}}
827 Returns
\true if all of the selection is aligned according to the specified flag.
829 \membersection{wxRichTextCtrl::IsSelectionBold
}\label{wxrichtextctrlisselectionbold
}
831 \constfunc{bool
}{IsSelectionBold
}{\void}
833 Returns
\true if all of the selection is bold.
835 \membersection{wxRichTextCtrl::IsSelectionItalics
}\label{wxrichtextctrlisselectionitalics
}
837 \constfunc{bool
}{IsSelectionItalics
}{\void}
839 Returns
\true if all of the selection is italic.
841 \membersection{wxRichTextCtrl::IsSelectionUnderlined
}\label{wxrichtextctrlisselectionunderlined
}
843 \constfunc{bool
}{IsSelectionUnderlined
}{\void}
845 Returns
\true if all of the selection is underlined.
847 \membersection{wxRichTextCtrl::IsSingleLine
}\label{wxrichtextctrlissingleline
}
849 \constfunc{bool
}{IsSingleLine
}{\void}
851 Returns
\true if the control is single-line. Currently wxRichTextCtrl does not
852 support single-line editing.
854 \membersection{wxRichTextCtrl::KeyboardNavigate
}\label{wxrichtextctrlkeyboardnavigate
}
856 \func{bool
}{KeyboardNavigate
}{\param{int
}{keyCode
},
\param{int
}{flags
}}
858 Helper function implementing keyboard navigation.
860 \membersection{wxRichTextCtrl::LayoutContent
}\label{wxrichtextctrllayoutcontent
}
862 \func{bool
}{LayoutContent
}{\param{bool
}{onlyVisibleRect = false
}}
864 Lays out the buffer, which must be done before certain operations, such as
865 setting the caret position. This function should not normally be required by the
868 \membersection{wxRichTextCtrl::LoadFile
}\label{wxrichtextctrlloadfile
}
870 \func{bool
}{LoadFile
}{\param{const wxString\&
}{file
},
\param{int
}{type = wxRICHTEXT
\_TYPE\_ANY}}
872 Loads content into the control's buffer using the given type. If the specified type
873 is wxRICHTEXT
\_TYPE\_ANY, the type is deduced from the filename extension.
875 This function looks for a suitable
\helpref{wxRichTextFileHandler
}{wxrichtextfilehandler
} object.
877 \membersection{wxRichTextCtrl::MarkDirty
}\label{wxrichtextctrlmarkdirty
}
879 \func{void
}{MarkDirty
}{\void}
881 Marks the buffer as modified.
883 \membersection{wxRichTextCtrl::MoveCaret
}\label{wxrichtextctrlmovecaret
}
885 \func{bool
}{MoveCaret
}{\param{long
}{pos
},
\param{bool
}{showAtLineStart = false
}}
887 Move the caret to the given character position.
889 \membersection{wxRichTextCtrl::MoveCaretBack
}\label{wxrichtextctrlmovecaretback
}
891 \func{void
}{MoveCaretBack
}{\param{long
}{oldPosition
}}
893 Move the caret one visual step forward: this may mean setting a flag
894 and keeping the same position if we're going from the end of one line
895 to the start of the next, which may be the exact same caret position.
897 \membersection{wxRichTextCtrl::MoveCaretForward
}\label{wxrichtextctrlmovecaretforward
}
899 \func{void
}{MoveCaretForward
}{\param{long
}{oldPosition
}}
901 Move the caret one visual step forward: this may mean setting a flag
902 and keeping the same position if we're going from the end of one line
903 to the start of the next, which may be the exact same caret position.
905 \membersection{wxRichTextCtrl::MoveDown
}\label{wxrichtextctrlmovedown
}
907 \func{bool
}{MoveDown
}{\param{int
}{noLines =
1},
\param{int
}{flags =
0}}
909 Moves the caret down.
911 \membersection{wxRichTextCtrl::MoveEnd
}\label{wxrichtextctrlmoveend
}
913 \func{bool
}{MoveEnd
}{\param{int
}{flags =
0}}
915 Moves to the end of the buffer.
917 \membersection{wxRichTextCtrl::MoveHome
}\label{wxrichtextctrlmovehome
}
919 \func{bool
}{MoveHome
}{\param{int
}{flags =
0}}
921 Moves to the start of the buffer.
923 \membersection{wxRichTextCtrl::MoveLeft
}\label{wxrichtextctrlmoveleft
}
925 \func{bool
}{MoveLeft
}{\param{int
}{noPositions =
1},
\param{int
}{flags =
0}}
929 \membersection{wxRichTextCtrl::MoveRight
}\label{wxrichtextctrlmoveright
}
931 \func{bool
}{MoveRight
}{\param{int
}{noPositions =
1},
\param{int
}{flags =
0}}
935 \membersection{wxRichTextCtrl::MoveToLineEnd
}\label{wxrichtextctrlmovetolineend
}
937 \func{bool
}{MoveToLineEnd
}{\param{int
}{flags =
0}}
939 Moves to the end of the line.
941 \membersection{wxRichTextCtrl::MoveToLineStart
}\label{wxrichtextctrlmovetolinestart
}
943 \func{bool
}{MoveToLineStart
}{\param{int
}{flags =
0}}
945 Moves to the start of the line.
947 \membersection{wxRichTextCtrl::MoveToParagraphEnd
}\label{wxrichtextctrlmovetoparagraphend
}
949 \func{bool
}{MoveToParagraphEnd
}{\param{int
}{flags =
0}}
951 Moves to the end of the paragraph.
953 \membersection{wxRichTextCtrl::MoveToParagraphStart
}\label{wxrichtextctrlmovetoparagraphstart
}
955 \func{bool
}{MoveToParagraphStart
}{\param{int
}{flags =
0}}
957 Moves to the start of the paragraph.
959 \membersection{wxRichTextCtrl::MoveUp
}\label{wxrichtextctrlmoveup
}
961 \func{bool
}{MoveUp
}{\param{int
}{noLines =
1},
\param{int
}{flags =
0}}
965 \membersection{wxRichTextCtrl::Newline
}\label{wxrichtextctrlnewline
}
967 \func{bool
}{Newline
}{\void}
969 Insert a newline (actually paragraph) at the current insertion point.
971 \membersection{wxRichTextCtrl::OnClear
}\label{wxrichtextctrlonclear
}
973 \func{void
}{OnClear
}{\param{wxCommandEvent\&
}{event
}}
975 Standard handler for the wxID
\_CLEAR command.
977 \membersection{wxRichTextCtrl::OnContextMenu
}\label{wxrichtextctrloncontextmenu
}
979 \func{void
}{OnContextMenu
}{\param{wxContextMenuEvent\&
}{event
}}
981 Shows a standard context menu with undo, redo, cut, copy, paste, clear, and select all commands.
983 \membersection{wxRichTextCtrl::OnCopy
}\label{wxrichtextctrloncopy
}
985 \func{void
}{OnCopy
}{\param{wxCommandEvent\&
}{event
}}
987 Standard handler for the wxID
\_COPY command.
989 \membersection{wxRichTextCtrl::OnCut
}\label{wxrichtextctrloncut
}
991 \func{void
}{OnCut
}{\param{wxCommandEvent\&
}{event
}}
993 Standard handler for the wxID
\_CUT command.
995 \membersection{wxRichTextCtrl::OnDropFiles
}\label{wxrichtextctrlondropfiles
}
997 \func{void
}{OnDropFiles
}{\param{wxDropFilesEvent\&
}{event
}}
999 Loads the first dropped file.
1001 \membersection{wxRichTextCtrl::OnPaste
}\label{wxrichtextctrlonpaste
}
1003 \func{void
}{OnPaste
}{\param{wxCommandEvent\&
}{event
}}
1005 Standard handler for the wxID
\_PASTE command.
1007 \membersection{wxRichTextCtrl::OnRedo
}\label{wxrichtextctrlonredo
}
1009 \func{void
}{OnRedo
}{\param{wxCommandEvent\&
}{event
}}
1011 Standard handler for the wxID
\_REDO command.
1013 \membersection{wxRichTextCtrl::OnSelectAll
}\label{wxrichtextctrlonselectall
}
1015 \func{void
}{OnSelectAll
}{\param{wxCommandEvent\&
}{event
}}
1017 Standard handler for the wxID
\_SELECTALL command.
1019 \membersection{wxRichTextCtrl::OnUndo
}\label{wxrichtextctrlonundo
}
1021 \func{void
}{OnUndo
}{\param{wxCommandEvent\&
}{event
}}
1023 Standard handler for the wxID
\_PASTE command.
1025 \membersection{wxRichTextCtrl::OnUpdateClear
}\label{wxrichtextctrlonupdateclear
}
1027 \func{void
}{OnUpdateClear
}{\param{wxUpdateUIEvent\&
}{event
}}
1029 Standard update handler for the wxID
\_CLEAR command.
1031 \membersection{wxRichTextCtrl::OnUpdateCopy
}\label{wxrichtextctrlonupdatecopy
}
1033 \func{void
}{OnUpdateCopy
}{\param{wxUpdateUIEvent\&
}{event
}}
1035 Standard update handler for the wxID
\_COPY command.
1037 \membersection{wxRichTextCtrl::OnUpdateCut
}\label{wxrichtextctrlonupdatecut
}
1039 \func{void
}{OnUpdateCut
}{\param{wxUpdateUIEvent\&
}{event
}}
1041 Standard update handler for the wxID
\_CUT command.
1043 \membersection{wxRichTextCtrl::OnUpdatePaste
}\label{wxrichtextctrlonupdatepaste
}
1045 \func{void
}{OnUpdatePaste
}{\param{wxUpdateUIEvent\&
}{event
}}
1047 Standard update handler for the wxID
\_PASTE command.
1049 \membersection{wxRichTextCtrl::OnUpdateRedo
}\label{wxrichtextctrlonupdateredo
}
1051 \func{void
}{OnUpdateRedo
}{\param{wxUpdateUIEvent\&
}{event
}}
1053 Standard update handler for the wxID
\_REDO command.
1055 \membersection{wxRichTextCtrl::OnUpdateSelectAll
}\label{wxrichtextctrlonupdateselectall
}
1057 \func{void
}{OnUpdateSelectAll
}{\param{wxUpdateUIEvent\&
}{event
}}
1059 Standard update handler for the wxID
\_SELECTALL command.
1061 \membersection{wxRichTextCtrl::OnUpdateUndo
}\label{wxrichtextctrlonupdateundo
}
1063 \func{void
}{OnUpdateUndo
}{\param{wxUpdateUIEvent\&
}{event
}}
1065 Standard update handler for the wxID
\_UNDO command.
1067 \membersection{wxRichTextCtrl::PageDown
}\label{wxrichtextctrlpagedown
}
1069 \func{bool
}{PageDown
}{\param{int
}{noPages =
1},
\param{int
}{flags =
0}}
1071 Moves one or more pages down.
1073 \membersection{wxRichTextCtrl::PageUp
}\label{wxrichtextctrlpageup
}
1075 \func{bool
}{PageUp
}{\param{int
}{noPages =
1},
\param{int
}{flags =
0}}
1077 Moves one or more pages up.
1079 \membersection{wxRichTextCtrl::PaintBackground
}\label{wxrichtextctrlpaintbackground
}
1081 \func{void
}{PaintBackground
}{\param{wxDC\&
}{dc
}}
1083 Paints the background.
1085 \membersection{wxRichTextCtrl::Paste
}\label{wxrichtextctrlpaste
}
1087 \func{void
}{Paste
}{\void}
1089 Pastes content from the clipboard to the buffer.
1091 \membersection{wxRichTextCtrl::PositionCaret
}\label{wxrichtextctrlpositioncaret
}
1093 \func{void
}{PositionCaret
}{\void}
1095 Internal function to position the visible caret according to the current caret position.
1097 \membersection{wxRichTextCtrl::PositionToXY
}\label{wxrichtextctrlpositiontoxy
}
1099 \constfunc{bool
}{PositionToXY
}{\param{long
}{pos
},
\param{long*
}{x
},
\param{long*
}{y
}}
1101 Converts a text position to zero-based column and line numbers.
1103 \membersection{wxRichTextCtrl::Redo
}\label{wxrichtextctrlredo
}
1105 \func{void
}{Redo
}{\void}
1107 Redoes the current command.
1109 \membersection{wxRichTextCtrl::Remove
}\label{wxrichtextctrlremove
}
1111 \func{void
}{Remove
}{\param{long
}{from
},
\param{long
}{to
}}
1113 Removes the content in the specified range.
1115 \membersection{wxRichTextCtrl::Replace
}\label{wxrichtextctrlreplace
}
1117 \func{void
}{Replace
}{\param{long
}{from
},
\param{long
}{to
},
\param{const wxString\&
}{value
}}
1119 Replaces the content in the specified range with the string specified by
{\it value
}.
1121 \membersection{wxRichTextCtrl::SaveFile
}\label{wxrichtextctrlsavefile
}
1123 \func{bool
}{SaveFile
}{\param{const wxString\&
}{file = wxEmptyString
},
\param{int
}{type = wxRICHTEXT
\_TYPE\_ANY}}
1125 Saves the buffer content using the given type. If the specified type
1126 is wxRICHTEXT
\_TYPE\_ANY, the type is deduced from the filename extension.
1128 This function looks for a suitable
\helpref{wxRichTextFileHandler
}{wxrichtextfilehandler
} object.
1130 \membersection{wxRichTextCtrl::ScrollIntoView
}\label{wxrichtextctrlscrollintoview
}
1132 \func{bool
}{ScrollIntoView
}{\param{long
}{position
},
\param{int
}{keyCode
}}
1134 Scrolls
{\it position
} into view. This function takes a caret position.
1136 \membersection{wxRichTextCtrl::SelectAll
}\label{wxrichtextctrlselectall
}
1138 \func{void
}{SelectAll
}{\void}
1140 Selects all the text in the buffer.
1142 \membersection{wxRichTextCtrl::SelectNone
}\label{wxrichtextctrlselectnone
}
1144 \func{void
}{SelectNone
}{\void}
1146 Cancels any selection.
1148 \membersection{wxRichTextCtrl::SetAndShowDefaultStyle
}\label{wxrichtextctrlsetandshowdefaultstyle
}
1150 \func{void
}{SetAndShowDefaultStyle
}{\param{const wxRichTextAttr\&
}{attr
}}
1152 Sets
{\it attr
} as the default style and tells the control that the UI should reflect
1153 this attribute until the user moves the caret.
1155 See also
\helpref{IsDefaultStyleShowing
}{wxrichtextctrlisdefaultstyleshowing
}.
1157 \membersection{wxRichTextCtrl::SetBasicStyle
}\label{wxrichtextctrlsetbasicstyle
}
1159 \func{void
}{SetBasicStyle
}{\param{const wxRichTextAttr\&
}{style
}}
1161 \func{void
}{SetBasicStyle
}{\param{const wxTextAttrEx\&
}{style
}}
1163 Sets the basic (overall) style. This is the style of the whole
1164 buffer before further styles are applied, unlike the default style, which
1165 only affects the style currently being applied (for example, setting the default
1166 style to bold will cause subsequently inserted text to be bold).
1168 \membersection{wxRichTextCtrl::SetCaretPosition
}\label{wxrichtextctrlsetcaretposition
}
1170 \func{void
}{SetCaretPosition
}{\param{long
}{position
},
\param{bool
}{showAtLineStart = false
}}
1172 The caret position is the character position just before the caret.
1173 A value of -
1 means the caret is at the start of the buffer.
1175 \membersection{wxRichTextCtrl::SetDefaultStyle
}\label{wxrichtextctrlsetdefaultstyle
}
1177 \func{bool
}{SetDefaultStyle
}{\param{const wxTextAttrEx\&
}{style
}}
1179 Sets the current default style, which can be used to change how subsequently inserted
1182 \membersection{wxRichTextCtrl::SetDefaultStyleToCursorStyle
}\label{wxrichtextctrlsetdefaultstyletocursorstyle
}
1184 \func{bool
}{SetDefaultStyleToCursorStyle
}{\void}
1186 Sets the default style to the style under the cursor.
1188 \membersection{wxRichTextCtrl::SetDelayedLayoutThreshold
}\label{wxrichtextctrlsetdelayedlayoutthreshold
}
1190 \func{void
}{SetDelayedLayoutThreshold
}{\param{long
}{threshold
}}
1192 Sets the size of the buffer beyond which layout is delayed during resizing.
1193 This optimizes sizing for large buffers. The default is
20000.
1195 \membersection{wxRichTextCtrl::SetEditable
}\label{wxrichtextctrlseteditable
}
1197 \func{void
}{SetEditable
}{\param{bool
}{editable
}}
1199 Makes the control editable, or not.
1201 \membersection{wxRichTextCtrl::SetFilename
}\label{wxrichtextctrlsetfilename
}
1203 \func{void
}{SetFilename
}{\param{const wxString\&
}{filename
}}
1205 Sets the current filename.
1207 \membersection{wxRichTextCtrl::SetFont
}\label{wxrichtextctrlsetfont
}
1209 \func{bool
}{SetFont
}{\param{const wxFont\&
}{font
}}
1211 Sets the font, and also the basic and default attributes (see
\helpref{SetDefaultStyle
}{wxrichtextctrlsetdefaultstyle
}).
1213 \membersection{wxRichTextCtrl::SetInsertionPoint
}\label{wxrichtextctrlsetinsertionpoint
}
1215 \func{void
}{SetInsertionPoint
}{\param{long
}{pos
}}
1217 Sets the insertion point.
1219 \membersection{wxRichTextCtrl::SetInsertionPointEnd
}\label{wxrichtextctrlsetinsertionpointend
}
1221 \func{void
}{SetInsertionPointEnd
}{\void}
1223 Sets the insertion point to the end of the text control.
1225 \membersection{wxRichTextCtrl::SetSelection
}\label{wxrichtextctrlsetselection
}
1227 \func{void
}{SetSelection
}{\param{long
}{from
},
\param{long
}{to
}}
1229 Sets the selection to the given range.
1231 The end point of range is specified as the last character position of the span of text, plus one.
1232 So, for example, to set the style for a character at position
5, use the range (
5,
6).
1234 \membersection{wxRichTextCtrl::SetSelectionRange
}\label{wxrichtextctrlsetselectionrange
}
1236 \func{void
}{SetSelectionRange
}{\param{const wxRichTextRange\&
}{range
}}
1238 Sets the selection to the given range.
1240 The end point of range is specified as the last character position of the span of text, plus one.
1241 So, for example, to set the style for a character at position
5, use the range (
5,
6).
1243 \membersection{wxRichTextCtrl::SetStyle
}\label{wxrichtextctrlsetstyle
}
1245 \func{bool
}{SetStyle
}{\param{const wxRichTextRange\&
}{range
},
\param{const wxRichTextAttr\&
}{style
}}
1247 \func{bool
}{SetStyle
}{\param{long
}{start
},
\param{long
}{end
},
\param{const wxTextAttrEx\&
}{style
}}
1249 \func{bool
}{SetStyle
}{\param{long
}{start
},
\param{long
}{end
},
\param{const wxTextAttr\&
}{style
}}
1251 Sets the attributes for the given range. The wxRichTextAttr version is more efficient
1252 because it does not use wxFont objects.
1254 The end point of range is specified as the last character position of the span of text, plus one.
1255 So, for example, to set the style for a character at position
5, use the range (
5,
6).
1257 \membersection{wxRichTextCtrl::SetStyleEx
}\label{wxrichtextctrlsetstyleex
}
1259 \func{bool
}{SetStyleEx
}{\param{const wxRichTextRange\&
}{range
},
\param{const wxRichTextAttr\&
}{style
},
\param{int
}{flags $=$ wxRICHTEXT
\_SETSTYLE\_WITH\_UNDO}}
1261 \func{bool
}{SetStyleEx
}{\param{const wxRichTextRange\&
}{range
},
\param{const wxTextAttrEx\&
}{style
},
\param{int
}{flags $=$ wxRICHTEXT
\_SETSTYLE\_WITH\_UNDO}}
1263 \func{bool
}{SetStyleEx
}{\param{long
}{start
},
\param{long
}{end
},
\param{const wxTextAttrEx\&
}{style
},
\param{int
}{flags $=$ wxRICHTEXT
\_SETSTYLE\_WITH\_UNDO}}
1265 Sets the attributes for the given range, passing flags to determine how the attributes are set. The wxRichTextAttr version is more efficient
1266 because it does not use wxFont objects.
1268 The end point of range is specified as the last character position of the span of text, plus one.
1269 So, for example, to set the style for a character at position
5, use the range (
5,
6).
1271 {\it flags
} may contain a bit list of the following values:
1274 #define wxRICHTEXT_SETSTYLE_NONE
0x00
1276 // Specifies that this operation should be undoable
1277 #define wxRICHTEXT_SETSTYLE_WITH_UNDO
0x01
1279 // Specifies that the style should not be applied if the
1280 // combined style at this point is already the style in question.
1281 #define wxRICHTEXT_SETSTYLE_OPTIMIZE
0x02
1283 // Specifies that the style should only be applied to paragraphs,
1284 // and not the content. This allows content styling to be
1285 // preserved independently from that of e.g. a named paragraph style.
1286 #define wxRICHTEXT_SETSTYLE_PARAGRAPHS_ONLY
0x04
1288 // Specifies that the style should only be applied to characters,
1289 // and not the paragraph. This allows content styling to be
1290 // preserved independently from that of e.g. a named paragraph style.
1291 #define wxRICHTEXT_SETSTYLE_CHARACTERS_ONLY
0x08
1294 \membersection{wxRichTextCtrl::SetStyleSheet
}\label{wxrichtextctrlsetstylesheet
}
1296 \func{void
}{SetStyleSheet
}{\param{wxRichTextStyleSheet*
}{styleSheet
}}
1298 Sets the style sheet associated with the control. A style sheet allows named
1299 character and paragraph styles to be applied.
1301 \membersection{wxRichTextCtrl::SetValue
}\label{wxrichtextctrlsetvalue
}
1303 \func{void
}{SetValue
}{\param{const wxString\&
}{value
}}
1305 Replaces existing content with the given text.
1307 \membersection{wxRichTextCtrl::SetupScrollbars
}\label{wxrichtextctrlsetupscrollbars
}
1309 \func{void
}{SetupScrollbars
}{\param{bool
}{atTop = false
}}
1311 A helper function setting up scrollbars, for example after a resize.
1313 \membersection{wxRichTextCtrl::ShowPosition
}\label{wxrichtextctrlshowposition
}
1315 \func{void
}{ShowPosition
}{\param{long
}{pos
}}
1317 Scrolls the buffer so that the given position is in view.
1319 \membersection{wxRichTextCtrl::SuppressingUndo
}\label{wxrichtextctrlsuppressingundo
}
1321 \constfunc{bool
}{SuppressingUndo
}{\void}
1323 Returns
\true if undo history suppression is on.
1325 \membersection{wxRichTextCtrl::Thaw
}\label{wxrichtextctrlthaw
}
1327 \func{void
}{Thaw
}{\void}
1329 Call this function to end a Freeze and refresh the display.
1331 \membersection{wxRichTextCtrl::Undo
}\label{wxrichtextctrlundo
}
1333 \func{void
}{Undo
}{\void}
1335 Undoes the command at the top of the command history, if there is one.
1337 \membersection{wxRichTextCtrl::WordLeft
}\label{wxrichtextctrlwordleft
}
1339 \func{bool
}{WordLeft
}{\param{int
}{noWords =
1},
\param{int
}{flags =
0}}
1341 Moves a number of words to the left.
1343 \membersection{wxRichTextCtrl::WordRight
}\label{wxrichtextctrlwordright
}
1345 \func{bool
}{WordRight
}{\param{int
}{noWords =
1},
\param{int
}{flags =
0}}
1347 Move a nuber of words to the right.
1349 \membersection{wxRichTextCtrl::WriteImage
}\label{wxrichtextctrlwriteimage
}
1351 \func{bool
}{WriteImage
}{\param{const wxString\&
}{filename
},
\param{int
}{bitmapType
}}
1353 Loads an image from a file and writes it at the current insertion point.
1355 \func{bool
}{WriteImage
}{\param{const wxRichTextImageBlock\&
}{imageBlock
}}
1357 Writes an image block at the current insertion point.
1359 \func{bool
}{WriteImage
}{\param{const wxBitmap\&
}{bitmap
},
\param{int
}{bitmapType = wxBITMAP
\_TYPE\_PNG}}
1361 \func{bool
}{WriteImage
}{\param{const wxImage\&
}{image
},
\param{int
}{bitmapType = wxBITMAP
\_TYPE\_PNG}}
1363 Write a bitmap or image at the current insertion point. Supply an optional type to use
1364 for internal and file storage of the raw data.
1366 \membersection{wxRichTextCtrl::WriteText
}\label{wxrichtextctrlwritetext
}
1368 \func{void
}{WriteText
}{\param{const wxString\&
}{text
}}
1370 Writes text at the current position.
1372 \membersection{wxRichTextCtrl::XYToPosition
}\label{wxrichtextctrlxytoposition
}
1374 \constfunc{long
}{XYToPosition
}{\param{long
}{x
},
\param{long
}{y
}}
1376 Translates from column and line number to position.