1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/richtext/richtextctrl.h
3 // Purpose: A rich edit control
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
20 #define wxRE_READONLY 0x0010
21 #define wxRE_MULTILINE 0x0020
22 #define wxRE_CENTRE_CARET 0x8000
23 #define wxRE_CENTER_CARET wxRE_CENTRE_CARET
29 #define wxRICHTEXT_SHIFT_DOWN 0x01
30 #define wxRICHTEXT_CTRL_DOWN 0x02
31 #define wxRICHTEXT_ALT_DOWN 0x04
37 // Don't draw guide lines around boxes and tables
38 #define wxRICHTEXT_EX_NO_GUIDELINES 0x00000100
45 #define wxRICHTEXT_DEFAULT_OVERALL_SIZE wxSize(-1, -1)
46 #define wxRICHTEXT_DEFAULT_IMAGE_SIZE wxSize(80, 80)
47 #define wxRICHTEXT_DEFAULT_SPACING 3
48 #define wxRICHTEXT_DEFAULT_MARGIN 3
49 #define wxRICHTEXT_DEFAULT_UNFOCUSSED_BACKGROUND wxColour(175, 175, 175)
50 #define wxRICHTEXT_DEFAULT_FOCUSSED_BACKGROUND wxColour(140, 140, 140)
51 #define wxRICHTEXT_DEFAULT_UNSELECTED_BACKGROUND wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE)
52 #define wxRICHTEXT_DEFAULT_TYPE_COLOUR wxColour(0, 0, 200)
53 #define wxRICHTEXT_DEFAULT_FOCUS_RECT_COLOUR wxColour(100, 80, 80)
54 #define wxRICHTEXT_DEFAULT_CARET_WIDTH 2
55 // Minimum buffer size before delayed layout kicks in
56 #define wxRICHTEXT_DEFAULT_DELAYED_LAYOUT_THRESHOLD 20000
57 // Milliseconds before layout occurs after resize
58 #define wxRICHTEXT_DEFAULT_LAYOUT_INTERVAL 50
62 #define wxID_RICHTEXT_PROPERTIES1 (wxID_HIGHEST + 1)
63 #define wxID_RICHTEXT_PROPERTIES2 (wxID_HIGHEST + 2)
64 #define wxID_RICHTEXT_PROPERTIES3 (wxID_HIGHEST + 3)
67 Normal selection occurs initially and as user drags within one container.
68 Common ancestor selection occurs when the user starts dragging across containers
69 that have a common ancestor, for example the cells in a table.
72 enum wxRichTextCtrlSelectionState
74 wxRichTextCtrlSelectionState_Normal
,
75 wxRichTextCtrlSelectionState_CommonAncestor
79 @class wxRichTextContextMenuPropertiesInfo
81 wxRichTextContextMenuPropertiesInfo keeps track of objects that appear in the context menu,
82 whose properties are available to be edited.
85 class wxRichTextContextMenuPropertiesInfo
91 wxRichTextContextMenuPropertiesInfo() { Init(); }
103 bool AddItem(const wxString
& label
, wxRichTextObject
* obj
);
106 Returns the number of menu items that were added.
108 int AddMenuItems(wxMenu
* menu
, int startCmd
= wxID_RICHTEXT_PROPERTIES1
) const;
111 Adds appropriate menu items for the current container and clicked on object
112 (and container's parent, if appropriate).
114 int AddItems(wxRichTextCtrl
* ctrl
, wxRichTextObject
* container
, wxRichTextObject
* obj
);
119 void Clear() { m_objects
.Clear(); m_labels
.Clear(); }
124 Returns the nth label.
126 wxString
GetLabel(int n
) const { return m_labels
[n
]; }
129 Returns the nth object.
131 wxRichTextObject
* GetObject(int n
) const { return m_objects
[n
]; }
134 Returns the array of objects.
136 wxRichTextObjectPtrArray
& GetObjects() { return m_objects
; }
139 Returns the array of objects.
141 const wxRichTextObjectPtrArray
& GetObjects() const { return m_objects
; }
144 Returns the array of labels.
146 wxArrayString
& GetLabels() { return m_labels
; }
149 Returns the array of labels.
151 const wxArrayString
& GetLabels() const { return m_labels
; }
154 Returns the number of items.
156 int GetCount() const { return m_objects
.GetCount(); }
158 wxRichTextObjectPtrArray m_objects
;
159 wxArrayString m_labels
;
163 @class wxRichTextCtrl
165 wxRichTextCtrl provides a generic, ground-up implementation of a text control
166 capable of showing multiple styles and images.
168 wxRichTextCtrl sends notification events: see wxRichTextEvent.
170 It also sends the standard wxTextCtrl events @c wxEVT_TEXT_ENTER and
171 @c wxEVT_TEXT, and wxTextUrlEvent when URL content is clicked.
173 For more information, see the @ref overview_richtextctrl.
176 @style{wxRE_CENTRE_CARET}
177 The control will try to keep the caret line centred vertically while editing.
178 wxRE_CENTER_CARET is a synonym for this style.
179 @style{wxRE_MULTILINE}
180 The control will be multiline (mandatory).
181 @style{wxRE_READONLY}
182 The control will not be editable.
187 @appearance{richtextctrl}
191 class wxRichTextCtrl
: public wxControl
,
192 public wxTextCtrlIface
,
193 public wxScrollHelper
204 Constructor, creating and showing a rich text control.
207 Parent window. Must not be @NULL.
209 Window identifier. The value @c wxID_ANY indicates a default value.
223 @see Create(), wxValidator
225 wxRichTextCtrl( wxWindow
* parent
, wxWindowID id
= -1, const wxString
& value
= wxEmptyString
, const wxPoint
& pos
= wxDefaultPosition
, const wxSize
& size
= wxDefaultSize
,
226 long style
= wxRE_MULTILINE
, const wxValidator
& validator
= wxDefaultValidator
, const wxString
& name
= wxTextCtrlNameStr
);
231 virtual ~wxRichTextCtrl( );
236 Creates the underlying window.
238 bool Create( wxWindow
* parent
, wxWindowID id
= -1, const wxString
& value
= wxEmptyString
, const wxPoint
& pos
= wxDefaultPosition
, const wxSize
& size
= wxDefaultSize
,
239 long style
= wxRE_MULTILINE
, const wxValidator
& validator
= wxDefaultValidator
, const wxString
& name
= wxTextCtrlNameStr
);
242 Initialises the members of the control.
249 Gets the text for the given range.
250 The end point of range is specified as the last character position of
251 the span of text, plus one.
253 virtual wxString
GetRange(long from
, long to
) const;
256 Returns the length of the specified line in characters.
258 virtual int GetLineLength(long lineNo
) const ;
261 Returns the text for the given line.
263 virtual wxString
GetLineText(long lineNo
) const ;
266 Returns the number of lines in the buffer.
268 virtual int GetNumberOfLines() const ;
271 Returns @true if the buffer has been modified.
273 virtual bool IsModified() const ;
276 Returns @true if the control is editable.
278 virtual bool IsEditable() const ;
281 Returns @true if the control is single-line.
282 Currently wxRichTextCtrl does not support single-line editing.
284 bool IsSingleLine() const { return !HasFlag(wxRE_MULTILINE
); }
287 Returns @true if the control is multiline.
289 bool IsMultiLine() const { return !IsSingleLine(); }
293 Returns the range of the current selection.
294 The end point of range is specified as the last character position of the span
296 If the return values @a from and @a to are the same, there is no selection.
298 virtual void GetSelection(long* from
, long* to
) const;
299 const wxRichTextSelection
& GetSelection() const { return m_selection
; }
300 wxRichTextSelection
& GetSelection() { return m_selection
; }
304 Returns the text within the current selection range, if any.
306 virtual wxString
GetStringSelection() const;
309 Gets the current filename associated with the control.
311 wxString
GetFilename() const { return m_filename
; }
314 Sets the current filename.
316 void SetFilename(const wxString
& filename
) { m_filename
= filename
; }
319 Sets the size of the buffer beyond which layout is delayed during resizing.
320 This optimizes sizing for large buffers. The default is 20000.
322 void SetDelayedLayoutThreshold(long threshold
) { m_delayedLayoutThreshold
= threshold
; }
325 Gets the size of the buffer beyond which layout is delayed during resizing.
326 This optimizes sizing for large buffers. The default is 20000.
328 long GetDelayedLayoutThreshold() const { return m_delayedLayoutThreshold
; }
332 bool GetFullLayoutRequired() const { return m_fullLayoutRequired
; }
336 void SetFullLayoutRequired(bool b
) { m_fullLayoutRequired
= b
; }
340 wxLongLong
GetFullLayoutTime() const { return m_fullLayoutTime
; }
344 void SetFullLayoutTime(wxLongLong t
) { m_fullLayoutTime
= t
; }
348 long GetFullLayoutSavedPosition() const { return m_fullLayoutSavedPosition
; }
352 void SetFullLayoutSavedPosition(long p
) { m_fullLayoutSavedPosition
= p
; }
354 // Force any pending layout due to large buffer
357 void ForceDelayedLayout();
360 Sets the text (normal) cursor.
362 void SetTextCursor(const wxCursor
& cursor
) { m_textCursor
= cursor
; }
365 Returns the text (normal) cursor.
367 wxCursor
GetTextCursor() const { return m_textCursor
; }
370 Sets the cursor to be used over URLs.
372 void SetURLCursor(const wxCursor
& cursor
) { m_urlCursor
= cursor
; }
375 Returns the cursor to be used over URLs.
377 wxCursor
GetURLCursor() const { return m_urlCursor
; }
380 Returns @true if we are showing the caret position at the start of a line
381 instead of at the end of the previous one.
383 bool GetCaretAtLineStart() const { return m_caretAtLineStart
; }
386 Sets a flag to remember that we are showing the caret position at the start of a line
387 instead of at the end of the previous one.
389 void SetCaretAtLineStart(bool atStart
) { m_caretAtLineStart
= atStart
; }
392 Returns @true if we are extending a selection.
394 bool GetDragging() const { return m_dragging
; }
397 Sets a flag to remember if we are extending a selection.
399 void SetDragging(bool dragging
) { m_dragging
= dragging
; }
402 Are we trying to start Drag'n'Drop?
404 bool GetPreDrag() const { return m_preDrag
; }
407 Set if we're trying to start Drag'n'Drop
409 void SetPreDrag(bool pd
) { m_preDrag
= pd
; }
412 Get the possible Drag'n'Drop start point
414 const wxPoint
GetDragStartPoint() const { return m_dragStartPoint
; }
417 Set the possible Drag'n'Drop start point
419 void SetDragStartPoint(wxPoint sp
) { m_dragStartPoint
= sp
; }
422 Get the possible Drag'n'Drop start time
424 const wxDateTime
GetDragStartTime() const { return m_dragStartTime
; }
427 Set the possible Drag'n'Drop start time
429 void SetDragStartTime(wxDateTime st
) { m_dragStartTime
= st
; }
431 #if wxRICHTEXT_BUFFERED_PAINTING
434 Returns the buffer bitmap if using buffered painting.
436 const wxBitmap
& GetBufferBitmap() const { return m_bufferBitmap
; }
437 wxBitmap
& GetBufferBitmap() { return m_bufferBitmap
; }
442 Returns the current context menu.
444 wxMenu
* GetContextMenu() const { return m_contextMenu
; }
447 Sets the current context menu.
449 void SetContextMenu(wxMenu
* menu
);
452 Returns an anchor so we know how to extend the selection.
453 It's a caret position since it's between two characters.
455 long GetSelectionAnchor() const { return m_selectionAnchor
; }
458 Sets an anchor so we know how to extend the selection.
459 It's a caret position since it's between two characters.
461 void SetSelectionAnchor(long anchor
) { m_selectionAnchor
= anchor
; }
464 Returns the anchor object if selecting multiple containers.
466 wxRichTextObject
* GetSelectionAnchorObject() const { return m_selectionAnchorObject
; }
469 Sets the anchor object if selecting multiple containers.
471 void SetSelectionAnchorObject(wxRichTextObject
* anchor
) { m_selectionAnchorObject
= anchor
; }
475 Returns an object that stores information about context menu property item(s),
476 in order to communicate between the context menu event handler and the code
477 that responds to it. The wxRichTextContextMenuPropertiesInfo stores one
478 item for each object that could respond to a property-editing event. If
479 objects are nested, several might be editable.
481 wxRichTextContextMenuPropertiesInfo
& GetContextMenuPropertiesInfo() { return m_contextMenuPropertiesInfo
; }
482 const wxRichTextContextMenuPropertiesInfo
& GetContextMenuPropertiesInfo() const { return m_contextMenuPropertiesInfo
; }
486 Returns the wxRichTextObject object that currently has the editing focus.
487 If there are no composite objects, this will be the top-level buffer.
489 wxRichTextParagraphLayoutBox
* GetFocusObject() const { return m_focusObject
; }
492 Setter for m_focusObject.
494 void StoreFocusObject(wxRichTextParagraphLayoutBox
* obj
);
497 Sets the wxRichTextObject object that currently has the editing focus.
498 @param setCaretPosition
499 Optionally set the caret position.
501 bool SetFocusObject(wxRichTextParagraphLayoutBox
* obj
, bool setCaretPosition
= true);
506 Invalidates the whole buffer to trigger painting later.
508 void Invalidate() { GetBuffer().Invalidate(wxRICHTEXT_ALL
); }
511 Clears the buffer content, leaving a single empty paragraph. Cannot be undone.
513 virtual void Clear();
516 Replaces the content in the specified range with the string specified by
519 virtual void Replace(long from
, long to
, const wxString
& value
);
522 Removes the content in the specified range.
524 virtual void Remove(long from
, long to
);
528 Loads content into the control's buffer using the given type.
530 If the specified type is wxRICHTEXT_TYPE_ANY, the type is deduced from
531 the filename extension.
533 This function looks for a suitable wxRichTextFileHandler object.
535 bool LoadFile(const wxString
& file
,
536 int type
= wxRICHTEXT_TYPE_ANY
);
540 Helper function for LoadFile(). Loads content into the control's buffer using the given type.
542 If the specified type is wxRICHTEXT_TYPE_ANY, the type is deduced from
543 the filename extension.
545 This function looks for a suitable wxRichTextFileHandler object.
547 virtual bool DoLoadFile(const wxString
& file
, int fileType
);
551 Saves the buffer content using the given type.
553 If the specified type is wxRICHTEXT_TYPE_ANY, the type is deduced from
554 the filename extension.
556 This function looks for a suitable wxRichTextFileHandler object.
558 bool SaveFile(const wxString
& file
= wxEmptyString
,
559 int type
= wxRICHTEXT_TYPE_ANY
);
563 Helper function for SaveFile(). Saves the buffer content using the given type.
565 If the specified type is wxRICHTEXT_TYPE_ANY, the type is deduced from
566 the filename extension.
568 This function looks for a suitable wxRichTextFileHandler object.
570 virtual bool DoSaveFile(const wxString
& file
= wxEmptyString
,
571 int fileType
= wxRICHTEXT_TYPE_ANY
);
574 Sets flags that change the behaviour of loading or saving.
576 See the documentation for each handler class to see what flags are
577 relevant for each handler.
579 void SetHandlerFlags(int flags
) { GetBuffer().SetHandlerFlags(flags
); }
582 Returns flags that change the behaviour of loading or saving.
583 See the documentation for each handler class to see what flags are
584 relevant for each handler.
586 int GetHandlerFlags() const { return GetBuffer().GetHandlerFlags(); }
589 Marks the buffer as modified.
591 virtual void MarkDirty();
594 Sets the buffer's modified status to @false, and clears the buffer's command
597 virtual void DiscardEdits();
600 Sets the maximum number of characters that may be entered in a single line
601 text control. For compatibility only; currently does nothing.
603 virtual void SetMaxLength(unsigned long WXUNUSED(len
)) { }
606 Writes text at the current position.
608 virtual void WriteText(const wxString
& text
);
611 Sets the insertion point to the end of the buffer and writes the text.
613 virtual void AppendText(const wxString
& text
);
617 Gets the attributes at the given position.
618 This function gets the combined style - that is, the style you see on the
619 screen as a result of combining base style, paragraph style and character
622 To get the character or paragraph style alone, use GetUncombinedStyle().
625 In wxPerl this method is implemented as GetStyle(@a position)
626 returning a 2-element list (ok, attr).
629 virtual bool GetStyle(long position
, wxTextAttr
& style
);
630 virtual bool GetStyle(long position
, wxRichTextAttr
& style
);
631 virtual bool GetStyle(long position
, wxRichTextAttr
& style
, wxRichTextParagraphLayoutBox
* container
);
636 Sets the attributes for the given range.
637 The end point of range is specified as the last character position of the span
640 So, for example, to set the style for a character at position 5, use the range
643 virtual bool SetStyle(long start
, long end
, const wxTextAttr
& style
);
644 virtual bool SetStyle(long start
, long end
, const wxRichTextAttr
& style
);
645 virtual bool SetStyle(const wxRichTextRange
& range
, const wxTextAttr
& style
);
646 virtual bool SetStyle(const wxRichTextRange
& range
, const wxRichTextAttr
& style
);
650 Sets the attributes for a single object
652 virtual void SetStyle(wxRichTextObject
*obj
, const wxRichTextAttr
& textAttr
, int flags
= wxRICHTEXT_SETSTYLE_WITH_UNDO
);
656 Gets the attributes common to the specified range.
657 Attributes that differ in value within the range will not be included
661 In wxPerl this method is implemented as GetStyleForRange(@a position)
662 returning a 2-element list (ok, attr).
665 virtual bool GetStyleForRange(const wxRichTextRange
& range
, wxTextAttr
& style
);
666 virtual bool GetStyleForRange(const wxRichTextRange
& range
, wxRichTextAttr
& style
);
667 virtual bool GetStyleForRange(const wxRichTextRange
& range
, wxRichTextAttr
& style
, wxRichTextParagraphLayoutBox
* container
);
671 Sets the attributes for the given range, passing flags to determine how the
674 The end point of range is specified as the last character position of the span
675 of text, plus one. So, for example, to set the style for a character at
676 position 5, use the range (5,6).
678 @a flags may contain a bit list of the following values:
679 - wxRICHTEXT_SETSTYLE_NONE: no style flag.
680 - wxRICHTEXT_SETSTYLE_WITH_UNDO: specifies that this operation should be
682 - wxRICHTEXT_SETSTYLE_OPTIMIZE: specifies that the style should not be applied
683 if the combined style at this point is already the style in question.
684 - wxRICHTEXT_SETSTYLE_PARAGRAPHS_ONLY: specifies that the style should only be
685 applied to paragraphs, and not the content.
686 This allows content styling to be preserved independently from that
687 of e.g. a named paragraph style.
688 - wxRICHTEXT_SETSTYLE_CHARACTERS_ONLY: specifies that the style should only be
689 applied to characters, and not the paragraph.
690 This allows content styling to be preserved independently from that
691 of e.g. a named paragraph style.
692 - wxRICHTEXT_SETSTYLE_RESET: resets (clears) the existing style before applying
694 - wxRICHTEXT_SETSTYLE_REMOVE: removes the specified style. Only the style flags
695 are used in this operation.
697 virtual bool SetStyleEx(const wxRichTextRange
& range
, const wxRichTextAttr
& style
, int flags
= wxRICHTEXT_SETSTYLE_WITH_UNDO
);
701 Gets the attributes at the given position.
702 This function gets the @e uncombined style - that is, the attributes associated
703 with the paragraph or character content, and not necessarily the combined
704 attributes you see on the screen.
705 To get the combined attributes, use GetStyle().
707 If you specify (any) paragraph attribute in @e style's flags, this function
708 will fetch the paragraph attributes.
709 Otherwise, it will return the character attributes.
712 In wxPerl this method is implemented as GetUncombinedStyle(@a position)
713 returning a 2-element list (ok, attr).
716 virtual bool GetUncombinedStyle(long position
, wxRichTextAttr
& style
);
717 virtual bool GetUncombinedStyle(long position
, wxRichTextAttr
& style
, wxRichTextParagraphLayoutBox
* container
);
722 Sets the current default style, which can be used to change how subsequently
723 inserted text is displayed.
725 virtual bool SetDefaultStyle(const wxTextAttr
& style
);
726 virtual bool SetDefaultStyle(const wxRichTextAttr
& style
);
730 Returns the current default style, which can be used to change how subsequently
731 inserted text is displayed.
733 virtual const wxRichTextAttr
& GetDefaultStyleEx() const;
735 //virtual const wxTextAttr& GetDefaultStyle() const;
739 Sets the list attributes for the given range, passing flags to determine how
740 the attributes are set.
742 Either the style definition or the name of the style definition (in the current
743 sheet) can be passed.
744 @a flags is a bit list of the following:
745 - wxRICHTEXT_SETSTYLE_WITH_UNDO: specifies that this command will be undoable.
746 - wxRICHTEXT_SETSTYLE_RENUMBER: specifies that numbering should start from
747 @a startFrom, otherwise existing attributes are used.
748 - wxRICHTEXT_SETSTYLE_SPECIFY_LEVEL: specifies that @a listLevel should be used
749 as the level for all paragraphs, otherwise the current indentation will be used.
751 @see NumberList(), PromoteList(), ClearListStyle().
753 virtual bool SetListStyle(const wxRichTextRange
& range
, wxRichTextListStyleDefinition
* def
, int flags
= wxRICHTEXT_SETSTYLE_WITH_UNDO
, int startFrom
= 1, int specifiedLevel
= -1);
754 virtual bool SetListStyle(const wxRichTextRange
& range
, const wxString
& defName
, int flags
= wxRICHTEXT_SETSTYLE_WITH_UNDO
, int startFrom
= 1, int specifiedLevel
= -1);
758 Clears the list style from the given range, clearing list-related attributes
759 and applying any named paragraph style associated with each paragraph.
761 @a flags is a bit list of the following:
762 - wxRICHTEXT_SETSTYLE_WITH_UNDO: specifies that this command will be undoable.
764 @see SetListStyle(), PromoteList(), NumberList().
766 virtual bool ClearListStyle(const wxRichTextRange
& range
, int flags
= wxRICHTEXT_SETSTYLE_WITH_UNDO
);
770 Numbers the paragraphs in the given range.
771 Pass flags to determine how the attributes are set.
773 Either the style definition or the name of the style definition (in the current
774 sheet) can be passed.
776 @a flags is a bit list of the following:
777 - wxRICHTEXT_SETSTYLE_WITH_UNDO: specifies that this command will be undoable.
778 - wxRICHTEXT_SETSTYLE_RENUMBER: specifies that numbering should start from
779 @a startFrom, otherwise existing attributes are used.
780 - wxRICHTEXT_SETSTYLE_SPECIFY_LEVEL: specifies that @a listLevel should be used
781 as the level for all paragraphs, otherwise the current indentation will be used.
783 @see SetListStyle(), PromoteList(), ClearListStyle().
785 virtual bool NumberList(const wxRichTextRange
& range
, wxRichTextListStyleDefinition
* def
= NULL
, int flags
= wxRICHTEXT_SETSTYLE_WITH_UNDO
, int startFrom
= 1, int specifiedLevel
= -1);
786 virtual bool NumberList(const wxRichTextRange
& range
, const wxString
& defName
, int flags
= wxRICHTEXT_SETSTYLE_WITH_UNDO
, int startFrom
= 1, int specifiedLevel
= -1);
791 Promotes or demotes the paragraphs in the given range.
792 A positive @a promoteBy produces a smaller indent, and a negative number
793 produces a larger indent. Pass flags to determine how the attributes are set.
794 Either the style definition or the name of the style definition (in the current
795 sheet) can be passed.
797 @a flags is a bit list of the following:
798 - wxRICHTEXT_SETSTYLE_WITH_UNDO: specifies that this command will be undoable.
799 - wxRICHTEXT_SETSTYLE_RENUMBER: specifies that numbering should start from
800 @a startFrom, otherwise existing attributes are used.
801 - wxRICHTEXT_SETSTYLE_SPECIFY_LEVEL: specifies that @a listLevel should be used
802 as the level for all paragraphs, otherwise the current indentation will be used.
804 @see SetListStyle(), @see SetListStyle(), ClearListStyle().
806 virtual bool PromoteList(int promoteBy
, const wxRichTextRange
& range
, wxRichTextListStyleDefinition
* def
= NULL
, int flags
= wxRICHTEXT_SETSTYLE_WITH_UNDO
, int specifiedLevel
= -1);
807 virtual bool PromoteList(int promoteBy
, const wxRichTextRange
& range
, const wxString
& defName
, int flags
= wxRICHTEXT_SETSTYLE_WITH_UNDO
, int specifiedLevel
= -1);
811 Sets the properties for the given range, passing flags to determine how the
812 attributes are set. You can merge properties or replace them.
814 The end point of range is specified as the last character position of the span
815 of text, plus one. So, for example, to set the properties for a character at
816 position 5, use the range (5,6).
818 @a flags may contain a bit list of the following values:
819 - wxRICHTEXT_SETSPROPERTIES_NONE: no flag.
820 - wxRICHTEXT_SETPROPERTIES_WITH_UNDO: specifies that this operation should be
822 - wxRICHTEXT_SETPROPERTIES_PARAGRAPHS_ONLY: specifies that the properties should only be
823 applied to paragraphs, and not the content.
824 - wxRICHTEXT_SETPROPERTIES_CHARACTERS_ONLY: specifies that the properties should only be
825 applied to characters, and not the paragraph.
826 - wxRICHTEXT_SETPROPERTIES_RESET: resets (clears) the existing properties before applying
828 - wxRICHTEXT_SETPROPERTIES_REMOVE: removes the specified properties.
830 virtual bool SetProperties(const wxRichTextRange
& range
, const wxRichTextProperties
& properties
, int flags
= wxRICHTEXT_SETPROPERTIES_WITH_UNDO
);
833 Deletes the content within the given range.
835 virtual bool Delete(const wxRichTextRange
& range
);
838 Translates from column and line number to position.
840 virtual long XYToPosition(long x
, long y
) const;
843 Converts a text position to zero-based column and line numbers.
845 virtual bool PositionToXY(long pos
, long *x
, long *y
) const;
848 Scrolls the buffer so that the given position is in view.
850 virtual void ShowPosition(long pos
);
854 Finds the character at the given position in pixels.
855 @a pt is in device coords (not adjusted for the client area origin nor for
858 virtual wxTextCtrlHitTestResult
HitTest(const wxPoint
& pt
, long *pos
) const;
859 virtual wxTextCtrlHitTestResult
HitTest(const wxPoint
& pt
,
861 wxTextCoord
*row
) const;
864 Finds the container at the given point, which is assumed to be in client coordinates.
866 wxRichTextParagraphLayoutBox
* FindContainerAtPoint(const wxPoint pt
, long& position
, int& hit
, wxRichTextObject
* hitObj
, int flags
= 0);
869 // Clipboard operations
872 Copies the selected content (if any) to the clipboard.
877 Copies the selected content (if any) to the clipboard and deletes the selection.
883 Pastes content from the clipboard to the buffer.
885 virtual void Paste();
888 Deletes the content in the selection, if any. This is undoable.
890 virtual void DeleteSelection();
893 Returns @true if selected content can be copied to the clipboard.
895 virtual bool CanCopy() const;
898 Returns @true if selected content can be copied to the clipboard and deleted.
900 virtual bool CanCut() const;
903 Returns @true if the clipboard content can be pasted to the buffer.
905 virtual bool CanPaste() const;
908 Returns @true if selected content can be deleted.
910 virtual bool CanDeleteSelection() const;
913 Undoes the command at the top of the command history, if there is one.
918 Redoes the current command.
923 Returns @true if there is a command in the command history that can be undone.
925 virtual bool CanUndo() const;
928 Returns @true if there is a command in the command history that can be redone.
930 virtual bool CanRedo() const;
933 Sets the insertion point and causes the current editing style to be taken from
934 the new position (unlike wxRichTextCtrl::SetCaretPosition).
936 virtual void SetInsertionPoint(long pos
);
939 Sets the insertion point to the end of the text control.
941 virtual void SetInsertionPointEnd();
944 Returns the current insertion point.
946 virtual long GetInsertionPoint() const;
949 Returns the last position in the buffer.
951 virtual wxTextPos
GetLastPosition() const;
955 Sets the selection to the given range.
956 The end point of range is specified as the last character position of the span
959 So, for example, to set the selection for a character at position 5, use the
962 virtual void SetSelection(long from
, long to
);
963 void SetSelection(const wxRichTextSelection
& sel
) { m_selection
= sel
; }
968 Selects all the text in the buffer.
970 virtual void SelectAll();
973 Makes the control editable, or not.
975 virtual void SetEditable(bool editable
);
978 Returns @true if there is a selection and the object containing the selection
979 was the same as the current focus object.
981 virtual bool HasSelection() const;
984 Returns @true if there was a selection, whether or not the current focus object
985 is the same as the selection's container object.
987 virtual bool HasUnfocusedSelection() const;
991 Write a bitmap or image at the current insertion point.
992 Supply an optional type to use for internal and file storage of the raw data.
994 virtual bool WriteImage(const wxImage
& image
, wxBitmapType bitmapType
= wxBITMAP_TYPE_PNG
,
995 const wxRichTextAttr
& textAttr
= wxRichTextAttr());
997 virtual bool WriteImage(const wxBitmap
& bitmap
, wxBitmapType bitmapType
= wxBITMAP_TYPE_PNG
,
998 const wxRichTextAttr
& textAttr
= wxRichTextAttr());
1002 Loads an image from a file and writes it at the current insertion point.
1004 virtual bool WriteImage(const wxString
& filename
, wxBitmapType bitmapType
,
1005 const wxRichTextAttr
& textAttr
= wxRichTextAttr());
1008 Writes an image block at the current insertion point.
1010 virtual bool WriteImage(const wxRichTextImageBlock
& imageBlock
,
1011 const wxRichTextAttr
& textAttr
= wxRichTextAttr());
1014 Write a text box at the current insertion point, returning the text box.
1015 You can then call SetFocusObject() to set the focus to the new object.
1017 virtual wxRichTextBox
* WriteTextBox(const wxRichTextAttr
& textAttr
= wxRichTextAttr());
1020 Writes a field at the current insertion point.
1023 The field type, matching an existing field type definition.
1025 Extra data for the field.
1027 Optional attributes.
1029 @see wxRichTextField, wxRichTextFieldType, wxRichTextFieldTypeStandard
1031 virtual wxRichTextField
* WriteField(const wxString
& fieldType
, const wxRichTextProperties
& properties
,
1032 const wxRichTextAttr
& textAttr
= wxRichTextAttr());
1035 Write a table at the current insertion point, returning the table.
1036 You can then call SetFocusObject() to set the focus to the new object.
1038 virtual wxRichTextTable
* WriteTable(int rows
, int cols
, const wxRichTextAttr
& tableAttr
= wxRichTextAttr(), const wxRichTextAttr
& cellAttr
= wxRichTextAttr());
1041 Inserts a new paragraph at the current insertion point. @see LineBreak().
1043 virtual bool Newline();
1046 Inserts a line break at the current insertion point.
1048 A line break forces wrapping within a paragraph, and can be introduced by
1049 using this function, by appending the wxChar value @b wxRichTextLineBreakChar
1050 to text content, or by typing Shift-Return.
1052 virtual bool LineBreak();
1055 Sets the basic (overall) style.
1057 This is the style of the whole buffer before further styles are applied,
1058 unlike the default style, which only affects the style currently being
1059 applied (for example, setting the default style to bold will cause
1060 subsequently inserted text to be bold).
1062 virtual void SetBasicStyle(const wxRichTextAttr
& style
) { GetBuffer().SetBasicStyle(style
); }
1065 Gets the basic (overall) style.
1067 This is the style of the whole buffer before further styles are applied,
1068 unlike the default style, which only affects the style currently being
1069 applied (for example, setting the default style to bold will cause
1070 subsequently inserted text to be bold).
1072 virtual const wxRichTextAttr
& GetBasicStyle() const { return GetBuffer().GetBasicStyle(); }
1075 Begins applying a style.
1077 virtual bool BeginStyle(const wxRichTextAttr
& style
) { return GetBuffer().BeginStyle(style
); }
1080 Ends the current style.
1082 virtual bool EndStyle() { return GetBuffer().EndStyle(); }
1085 Ends application of all styles in the current style stack.
1087 virtual bool EndAllStyles() { return GetBuffer().EndAllStyles(); }
1092 bool BeginBold() { return GetBuffer().BeginBold(); }
1097 bool EndBold() { return GetBuffer().EndBold(); }
1100 Begins using italic.
1102 bool BeginItalic() { return GetBuffer().BeginItalic(); }
1107 bool EndItalic() { return GetBuffer().EndItalic(); }
1110 Begins using underlining.
1112 bool BeginUnderline() { return GetBuffer().BeginUnderline(); }
1115 End applying underlining.
1117 bool EndUnderline() { return GetBuffer().EndUnderline(); }
1120 Begins using the given point size.
1122 bool BeginFontSize(int pointSize
) { return GetBuffer().BeginFontSize(pointSize
); }
1125 Ends using a point size.
1127 bool EndFontSize() { return GetBuffer().EndFontSize(); }
1130 Begins using this font.
1132 bool BeginFont(const wxFont
& font
) { return GetBuffer().BeginFont(font
); }
1137 bool EndFont() { return GetBuffer().EndFont(); }
1140 Begins using this colour.
1142 bool BeginTextColour(const wxColour
& colour
) { return GetBuffer().BeginTextColour(colour
); }
1145 Ends applying a text colour.
1147 bool EndTextColour() { return GetBuffer().EndTextColour(); }
1150 Begins using alignment.
1151 For alignment values, see wxTextAttr.
1153 bool BeginAlignment(wxTextAttrAlignment alignment
) { return GetBuffer().BeginAlignment(alignment
); }
1158 bool EndAlignment() { return GetBuffer().EndAlignment(); }
1161 Begins applying a left indent and subindent in tenths of a millimetre.
1162 The subindent is an offset from the left edge of the paragraph, and is
1163 used for all but the first line in a paragraph. A positive value will
1164 cause the first line to appear to the left of the subsequent lines, and
1165 a negative value will cause the first line to be indented to the right
1166 of the subsequent lines.
1168 wxRichTextBuffer uses indentation to render a bulleted item. The
1169 content of the paragraph, including the first line, starts at the
1170 @a leftIndent plus the @a leftSubIndent.
1173 The distance between the margin and the bullet.
1174 @param leftSubIndent
1175 The distance between the left edge of the bullet and the left edge
1176 of the actual paragraph.
1178 bool BeginLeftIndent(int leftIndent
, int leftSubIndent
= 0) { return GetBuffer().BeginLeftIndent(leftIndent
, leftSubIndent
); }
1183 bool EndLeftIndent() { return GetBuffer().EndLeftIndent(); }
1186 Begins a right indent, specified in tenths of a millimetre.
1188 bool BeginRightIndent(int rightIndent
) { return GetBuffer().BeginRightIndent(rightIndent
); }
1193 bool EndRightIndent() { return GetBuffer().EndRightIndent(); }
1196 Begins paragraph spacing; pass the before-paragraph and after-paragraph spacing
1197 in tenths of a millimetre.
1199 bool BeginParagraphSpacing(int before
, int after
) { return GetBuffer().BeginParagraphSpacing(before
, after
); }
1202 Ends paragraph spacing.
1204 bool EndParagraphSpacing() { return GetBuffer().EndParagraphSpacing(); }
1207 Begins appling line spacing. @e spacing is a multiple, where 10 means
1208 single-spacing, 15 means 1.5 spacing, and 20 means double spacing.
1210 The ::wxTextAttrLineSpacing constants are defined for convenience.
1212 bool BeginLineSpacing(int lineSpacing
) { return GetBuffer().BeginLineSpacing(lineSpacing
); }
1217 bool EndLineSpacing() { return GetBuffer().EndLineSpacing(); }
1220 Begins a numbered bullet.
1222 This call will be needed for each item in the list, and the
1223 application should take care of incrementing the numbering.
1225 @a bulletNumber is a number, usually starting with 1.
1226 @a leftIndent and @a leftSubIndent are values in tenths of a millimetre.
1227 @a bulletStyle is a bitlist of the ::wxTextAttrBulletStyle values.
1229 wxRichTextBuffer uses indentation to render a bulleted item.
1230 The left indent is the distance between the margin and the bullet.
1231 The content of the paragraph, including the first line, starts
1232 at leftMargin + leftSubIndent.
1233 So the distance between the left edge of the bullet and the
1234 left of the actual paragraph is leftSubIndent.
1236 bool BeginNumberedBullet(int bulletNumber
, int leftIndent
, int leftSubIndent
, int bulletStyle
= wxTEXT_ATTR_BULLET_STYLE_ARABIC
|wxTEXT_ATTR_BULLET_STYLE_PERIOD
)
1237 { return GetBuffer().BeginNumberedBullet(bulletNumber
, leftIndent
, leftSubIndent
, bulletStyle
); }
1240 Ends application of a numbered bullet.
1242 bool EndNumberedBullet() { return GetBuffer().EndNumberedBullet(); }
1245 Begins applying a symbol bullet, using a character from the current font.
1246 See BeginNumberedBullet() for an explanation of how indentation is used
1247 to render the bulleted paragraph.
1249 bool BeginSymbolBullet(const wxString
& symbol
, int leftIndent
, int leftSubIndent
, int bulletStyle
= wxTEXT_ATTR_BULLET_STYLE_SYMBOL
)
1250 { return GetBuffer().BeginSymbolBullet(symbol
, leftIndent
, leftSubIndent
, bulletStyle
); }
1253 Ends applying a symbol bullet.
1255 bool EndSymbolBullet() { return GetBuffer().EndSymbolBullet(); }
1258 Begins applying a symbol bullet.
1260 bool BeginStandardBullet(const wxString
& bulletName
, int leftIndent
, int leftSubIndent
, int bulletStyle
= wxTEXT_ATTR_BULLET_STYLE_STANDARD
)
1261 { return GetBuffer().BeginStandardBullet(bulletName
, leftIndent
, leftSubIndent
, bulletStyle
); }
1264 Begins applying a standard bullet.
1266 bool EndStandardBullet() { return GetBuffer().EndStandardBullet(); }
1269 Begins using the named character style.
1271 bool BeginCharacterStyle(const wxString
& characterStyle
) { return GetBuffer().BeginCharacterStyle(characterStyle
); }
1274 Ends application of a named character style.
1276 bool EndCharacterStyle() { return GetBuffer().EndCharacterStyle(); }
1279 Begins applying the named paragraph style.
1281 bool BeginParagraphStyle(const wxString
& paragraphStyle
) { return GetBuffer().BeginParagraphStyle(paragraphStyle
); }
1284 Ends application of a named paragraph style.
1286 bool EndParagraphStyle() { return GetBuffer().EndParagraphStyle(); }
1289 Begins using a specified list style.
1290 Optionally, you can also pass a level and a number.
1292 bool BeginListStyle(const wxString
& listStyle
, int level
= 1, int number
= 1) { return GetBuffer().BeginListStyle(listStyle
, level
, number
); }
1295 Ends using a specified list style.
1297 bool EndListStyle() { return GetBuffer().EndListStyle(); }
1300 Begins applying wxTEXT_ATTR_URL to the content.
1302 Pass a URL and optionally, a character style to apply, since it is common
1303 to mark a URL with a familiar style such as blue text with underlining.
1305 bool BeginURL(const wxString
& url
, const wxString
& characterStyle
= wxEmptyString
) { return GetBuffer().BeginURL(url
, characterStyle
); }
1308 Ends applying a URL.
1310 bool EndURL() { return GetBuffer().EndURL(); }
1313 Sets the default style to the style under the cursor.
1315 bool SetDefaultStyleToCursorStyle();
1318 Cancels any selection.
1320 virtual void SelectNone();
1323 Selects the word at the given character position.
1325 virtual bool SelectWord(long position
);
1328 Returns the selection range in character positions. -1, -1 means no selection.
1330 The range is in API convention, i.e. a single character selection is denoted
1333 wxRichTextRange
GetSelectionRange() const;
1336 Sets the selection to the given range.
1337 The end point of range is specified as the last character position of the span
1340 So, for example, to set the selection for a character at position 5, use the
1343 void SetSelectionRange(const wxRichTextRange
& range
);
1346 Returns the selection range in character positions. -2, -2 means no selection
1347 -1, -1 means select everything.
1348 The range is in internal format, i.e. a single character selection is denoted
1351 wxRichTextRange
GetInternalSelectionRange() const { return m_selection
.GetRange(); }
1354 Sets the selection range in character positions. -2, -2 means no selection
1355 -1, -1 means select everything.
1356 The range is in internal format, i.e. a single character selection is denoted
1359 void SetInternalSelectionRange(const wxRichTextRange
& range
) { m_selection
.Set(range
, GetFocusObject()); }
1362 Adds a new paragraph of text to the end of the buffer.
1364 virtual wxRichTextRange
AddParagraph(const wxString
& text
);
1367 Adds an image to the control's buffer.
1369 virtual wxRichTextRange
AddImage(const wxImage
& image
);
1372 Lays out the buffer, which must be done before certain operations, such as
1373 setting the caret position.
1374 This function should not normally be required by the application.
1376 virtual bool LayoutContent(bool onlyVisibleRect
= false);
1379 Move the caret to the given character position.
1381 Please note that this does not update the current editing style
1382 from the new position; to do that, call wxRichTextCtrl::SetInsertionPoint instead.
1384 virtual bool MoveCaret(long pos
, bool showAtLineStart
= false, wxRichTextParagraphLayoutBox
* container
= NULL
);
1389 virtual bool MoveRight(int noPositions
= 1, int flags
= 0);
1394 virtual bool MoveLeft(int noPositions
= 1, int flags
= 0);
1397 Moves to the start of the paragraph.
1399 virtual bool MoveUp(int noLines
= 1, int flags
= 0);
1402 Moves the caret down.
1404 virtual bool MoveDown(int noLines
= 1, int flags
= 0);
1407 Moves to the end of the line.
1409 virtual bool MoveToLineEnd(int flags
= 0);
1412 Moves to the start of the line.
1414 virtual bool MoveToLineStart(int flags
= 0);
1417 Moves to the end of the paragraph.
1419 virtual bool MoveToParagraphEnd(int flags
= 0);
1422 Moves to the start of the paragraph.
1424 virtual bool MoveToParagraphStart(int flags
= 0);
1427 Moves to the start of the buffer.
1429 virtual bool MoveHome(int flags
= 0);
1432 Moves to the end of the buffer.
1434 virtual bool MoveEnd(int flags
= 0);
1437 Moves one or more pages up.
1439 virtual bool PageUp(int noPages
= 1, int flags
= 0);
1442 Moves one or more pages down.
1444 virtual bool PageDown(int noPages
= 1, int flags
= 0);
1447 Moves a number of words to the left.
1449 virtual bool WordLeft(int noPages
= 1, int flags
= 0);
1452 Move a nuber of words to the right.
1454 virtual bool WordRight(int noPages
= 1, int flags
= 0);
1458 Returns the buffer associated with the control.
1460 wxRichTextBuffer
& GetBuffer() { return m_buffer
; }
1461 const wxRichTextBuffer
& GetBuffer() const { return m_buffer
; }
1465 Starts batching undo history for commands.
1467 virtual bool BeginBatchUndo(const wxString
& cmdName
) { return m_buffer
.BeginBatchUndo(cmdName
); }
1470 Ends batching undo command history.
1472 virtual bool EndBatchUndo() { return m_buffer
.EndBatchUndo(); }
1475 Returns @true if undo commands are being batched.
1477 virtual bool BatchingUndo() const { return m_buffer
.BatchingUndo(); }
1480 Starts suppressing undo history for commands.
1482 virtual bool BeginSuppressUndo() { return m_buffer
.BeginSuppressUndo(); }
1485 Ends suppressing undo command history.
1487 virtual bool EndSuppressUndo() { return m_buffer
.EndSuppressUndo(); }
1490 Returns @true if undo history suppression is on.
1492 virtual bool SuppressingUndo() const { return m_buffer
.SuppressingUndo(); }
1495 Test if this whole range has character attributes of the specified kind.
1496 If any of the attributes are different within the range, the test fails.
1498 You can use this to implement, for example, bold button updating.
1499 @a style must have flags indicating which attributes are of interest.
1501 virtual bool HasCharacterAttributes(const wxRichTextRange
& range
, const wxRichTextAttr
& style
) const
1503 return GetBuffer().HasCharacterAttributes(range
.ToInternal(), style
);
1507 Test if this whole range has paragraph attributes of the specified kind.
1508 If any of the attributes are different within the range, the test fails.
1509 You can use this to implement, for example, centering button updating.
1510 @a style must have flags indicating which attributes are of interest.
1512 virtual bool HasParagraphAttributes(const wxRichTextRange
& range
, const wxRichTextAttr
& style
) const
1514 return GetBuffer().HasParagraphAttributes(range
.ToInternal(), style
);
1518 Returns @true if all of the selection, or the content at the caret position, is bold.
1520 virtual bool IsSelectionBold();
1523 Returns @true if all of the selection, or the content at the caret position, is italic.
1525 virtual bool IsSelectionItalics();
1528 Returns @true if all of the selection, or the content at the caret position, is underlined.
1530 virtual bool IsSelectionUnderlined();
1533 Returns @true if all of the selection, or the content at the current caret position, has the supplied wxTextAttrEffects flag(s).
1535 virtual bool DoesSelectionHaveTextEffectFlag(int flag
);
1538 Returns @true if all of the selection is aligned according to the specified flag.
1540 virtual bool IsSelectionAligned(wxTextAttrAlignment alignment
);
1543 Apples bold to the selection or the default style (undoable).
1545 virtual bool ApplyBoldToSelection();
1548 Applies italic to the selection or the default style (undoable).
1550 virtual bool ApplyItalicToSelection();
1553 Applies underline to the selection or the default style (undoable).
1555 virtual bool ApplyUnderlineToSelection();
1558 Applies one or more wxTextAttrEffects flags to the selection (undoable).
1559 If there is no selection, it is applied to the default style.
1561 virtual bool ApplyTextEffectToSelection(int flags
);
1564 Applies the given alignment to the selection or the default style (undoable).
1565 For alignment values, see wxTextAttr.
1567 virtual bool ApplyAlignmentToSelection(wxTextAttrAlignment alignment
);
1570 Applies the style sheet to the buffer, matching paragraph styles in the sheet
1571 against named styles in the buffer.
1573 This might be useful if the styles have changed.
1574 If @a sheet is @NULL, the sheet set with SetStyleSheet() is used.
1575 Currently this applies paragraph styles only.
1577 virtual bool ApplyStyle(wxRichTextStyleDefinition
* def
);
1580 Sets the style sheet associated with the control.
1581 A style sheet allows named character and paragraph styles to be applied.
1583 void SetStyleSheet(wxRichTextStyleSheet
* styleSheet
) { GetBuffer().SetStyleSheet(styleSheet
); }
1586 Returns the style sheet associated with the control, if any.
1587 A style sheet allows named character and paragraph styles to be applied.
1589 wxRichTextStyleSheet
* GetStyleSheet() const { return GetBuffer().GetStyleSheet(); }
1592 Push the style sheet to top of stack.
1594 bool PushStyleSheet(wxRichTextStyleSheet
* styleSheet
) { return GetBuffer().PushStyleSheet(styleSheet
); }
1597 Pops the style sheet from top of stack.
1599 wxRichTextStyleSheet
* PopStyleSheet() { return GetBuffer().PopStyleSheet(); }
1602 Applies the style sheet to the buffer, for example if the styles have changed.
1604 bool ApplyStyleSheet(wxRichTextStyleSheet
* styleSheet
= NULL
);
1607 Shows the given context menu, optionally adding appropriate property-editing commands for the current position in the object hierarchy.
1609 virtual bool ShowContextMenu(wxMenu
* menu
, const wxPoint
& pt
, bool addPropertyCommands
);
1612 Prepares the context menu, optionally adding appropriate property-editing commands.
1613 Returns the number of property commands added.
1615 virtual int PrepareContextMenu(wxMenu
* menu
, const wxPoint
& pt
, bool addPropertyCommands
);
1618 Returns @true if we can edit the object's properties via a GUI.
1620 virtual bool CanEditProperties(wxRichTextObject
* obj
) const;
1623 Edits the object's properties via a GUI.
1625 virtual bool EditProperties(wxRichTextObject
* obj
, wxWindow
* parent
);
1628 Gets the object's properties menu label.
1630 virtual wxString
GetPropertiesMenuLabel(wxRichTextObject
* obj
);
1633 Prepares the content just before insertion (or after buffer reset). Called by the same function in wxRichTextBuffer.
1634 Currently is only called if undo mode is on.
1636 virtual void PrepareContent(wxRichTextParagraphLayoutBox
& WXUNUSED(container
)) {}
1639 Can we delete this range?
1640 Sends an event to the control.
1642 virtual bool CanDeleteRange(wxRichTextParagraphLayoutBox
& container
, const wxRichTextRange
& range
) const;
1645 Can we insert content at this position?
1646 Sends an event to the control.
1648 virtual bool CanInsertContent(wxRichTextParagraphLayoutBox
& container
, long pos
) const;
1651 Enable or disable the vertical scrollbar.
1653 virtual void EnableVerticalScrollbar(bool enable
);
1656 Returns @true if the vertical scrollbar is enabled.
1658 virtual bool GetVerticalScrollbarEnabled() const;
1661 Sets the scale factor for displaying fonts, for example for more comfortable
1664 void SetFontScale(double fontScale
, bool refresh
= false);
1667 Returns the scale factor for displaying fonts, for example for more comfortable
1670 double GetFontScale() const { return GetBuffer().GetFontScale(); }
1673 Sets the scale factor for displaying certain dimensions such as indentation and
1674 inter-paragraph spacing. This can be useful when editing in a small control
1675 where you still want legible text, but a minimum of wasted white space.
1677 void SetDimensionScale(double dimScale
, bool refresh
= false);
1680 Returns the scale factor for displaying certain dimensions such as indentation
1681 and inter-paragraph spacing.
1683 double GetDimensionScale() const { return GetBuffer().GetDimensionScale(); }
1686 Sets an overall scale factor for displaying and editing the content.
1688 void SetScale(double scale
, bool refresh
= false);
1691 Returns an overall scale factor for displaying and editing the content.
1693 double GetScale() const { return m_scale
; }
1696 Returns an unscaled point.
1698 wxPoint
GetUnscaledPoint(const wxPoint
& pt
) const;
1701 Returns a scaled point.
1703 wxPoint
GetScaledPoint(const wxPoint
& pt
) const;
1706 Returns an unscaled size.
1708 wxSize
GetUnscaledSize(const wxSize
& sz
) const;
1711 Returns a scaled size.
1713 wxSize
GetScaledSize(const wxSize
& sz
) const;
1716 Returns an unscaled rectangle.
1718 wxRect
GetUnscaledRect(const wxRect
& rect
) const;
1721 Returns a scaled rectangle.
1723 wxRect
GetScaledRect(const wxRect
& rect
) const;
1726 Returns @true if this control can use virtual attributes and virtual text.
1727 The default is @false.
1729 bool GetVirtualAttributesEnabled() const;
1732 Pass @true to let the control use virtual attributes.
1733 The default is @false.
1735 void EnableVirtualAttributes(bool b
);
1740 Sends the event to the control.
1742 void Command(wxCommandEvent
& event
);
1745 Loads the first dropped file.
1747 void OnDropFiles(wxDropFilesEvent
& event
);
1749 void OnCaptureLost(wxMouseCaptureLostEvent
& event
);
1750 void OnSysColourChanged(wxSysColourChangedEvent
& event
);
1753 Standard handler for the wxID_CUT command.
1755 void OnCut(wxCommandEvent
& event
);
1758 Standard handler for the wxID_COPY command.
1760 void OnCopy(wxCommandEvent
& event
);
1763 Standard handler for the wxID_PASTE command.
1765 void OnPaste(wxCommandEvent
& event
);
1768 Standard handler for the wxID_UNDO command.
1770 void OnUndo(wxCommandEvent
& event
);
1773 Standard handler for the wxID_REDO command.
1775 void OnRedo(wxCommandEvent
& event
);
1778 Standard handler for the wxID_SELECTALL command.
1780 void OnSelectAll(wxCommandEvent
& event
);
1783 Standard handler for property commands.
1785 void OnProperties(wxCommandEvent
& event
);
1788 Standard handler for the wxID_CLEAR command.
1790 void OnClear(wxCommandEvent
& event
);
1793 Standard update handler for the wxID_CUT command.
1795 void OnUpdateCut(wxUpdateUIEvent
& event
);
1798 Standard update handler for the wxID_COPY command.
1800 void OnUpdateCopy(wxUpdateUIEvent
& event
);
1803 Standard update handler for the wxID_PASTE command.
1805 void OnUpdatePaste(wxUpdateUIEvent
& event
);
1808 Standard update handler for the wxID_UNDO command.
1810 void OnUpdateUndo(wxUpdateUIEvent
& event
);
1813 Standard update handler for the wxID_REDO command.
1815 void OnUpdateRedo(wxUpdateUIEvent
& event
);
1818 Standard update handler for the wxID_SELECTALL command.
1820 void OnUpdateSelectAll(wxUpdateUIEvent
& event
);
1823 Standard update handler for property commands.
1826 void OnUpdateProperties(wxUpdateUIEvent
& event
);
1829 Standard update handler for the wxID_CLEAR command.
1831 void OnUpdateClear(wxUpdateUIEvent
& event
);
1834 Shows a standard context menu with undo, redo, cut, copy, paste, clear, and
1835 select all commands.
1837 void OnContextMenu(wxContextMenuEvent
& event
);
1842 void OnPaint(wxPaintEvent
& event
);
1843 void OnEraseBackground(wxEraseEvent
& event
);
1846 void OnLeftClick(wxMouseEvent
& event
);
1849 void OnLeftUp(wxMouseEvent
& event
);
1852 void OnMoveMouse(wxMouseEvent
& event
);
1854 // Left-double-click
1855 void OnLeftDClick(wxMouseEvent
& event
);
1858 void OnMiddleClick(wxMouseEvent
& event
);
1861 void OnRightClick(wxMouseEvent
& event
);
1864 void OnChar(wxKeyEvent
& event
);
1867 void OnSize(wxSizeEvent
& event
);
1869 // Setting/losing focus
1870 void OnSetFocus(wxFocusEvent
& event
);
1871 void OnKillFocus(wxFocusEvent
& event
);
1873 // Idle-time processing
1874 void OnIdle(wxIdleEvent
& event
);
1877 void OnScroll(wxScrollWinEvent
& event
);
1880 Sets the font, and also the basic and default attributes
1881 (see wxRichTextCtrl::SetDefaultStyle).
1883 virtual bool SetFont(const wxFont
& font
);
1886 A helper function setting up scrollbars, for example after a resize.
1888 virtual void SetupScrollbars(bool atTop
= false);
1891 Helper function implementing keyboard navigation.
1893 virtual bool KeyboardNavigate(int keyCode
, int flags
);
1896 Paints the background.
1898 virtual void PaintBackground(wxDC
& dc
);
1901 Other user defined painting after everything else (i.e. all text) is painted.
1905 virtual void PaintAboveContent(wxDC
& WXUNUSED(dc
)) {}
1907 #if wxRICHTEXT_BUFFERED_PAINTING
1909 Recreates the buffer bitmap if necessary.
1911 virtual bool RecreateBuffer(const wxSize
& size
= wxDefaultSize
);
1915 virtual void DoWriteText(const wxString
& value
, int flags
= 0);
1917 // Should we inherit colours?
1918 virtual bool ShouldInheritColours() const { return false; }
1921 Internal function to position the visible caret according to the current caret
1924 virtual void PositionCaret(wxRichTextParagraphLayoutBox
* container
= NULL
);
1927 Helper function for extending the selection, returning @true if the selection
1928 was changed. Selections are in caret positions.
1930 virtual bool ExtendSelection(long oldPosition
, long newPosition
, int flags
);
1933 Scrolls @a position into view. This function takes a caret position.
1935 virtual bool ScrollIntoView(long position
, int keyCode
);
1938 Refreshes the area affected by a selection change.
1940 bool RefreshForSelectionChange(const wxRichTextSelection
& oldSelection
, const wxRichTextSelection
& newSelection
);
1943 Sets the caret position.
1945 The caret position is the character position just before the caret.
1946 A value of -1 means the caret is at the start of the buffer.
1947 Please note that this does not update the current editing style
1948 from the new position or cause the actual caret to be refreshed; to do that,
1949 call wxRichTextCtrl::SetInsertionPoint instead.
1951 void SetCaretPosition(long position
, bool showAtLineStart
= false) ;
1954 Returns the current caret position.
1956 long GetCaretPosition() const { return m_caretPosition
; }
1959 The adjusted caret position is the character position adjusted to take
1960 into account whether we're at the start of a paragraph, in which case
1961 style information should be taken from the next position, not current one.
1963 long GetAdjustedCaretPosition(long caretPos
) const;
1966 Move the caret one visual step forward: this may mean setting a flag
1967 and keeping the same position if we're going from the end of one line
1968 to the start of the next, which may be the exact same caret position.
1970 void MoveCaretForward(long oldPosition
) ;
1973 Move the caret one visual step forward: this may mean setting a flag
1974 and keeping the same position if we're going from the end of one line
1975 to the start of the next, which may be the exact same caret position.
1977 void MoveCaretBack(long oldPosition
) ;
1980 Returns the caret height and position for the given character position.
1981 If container is null, the current focus object will be used.
1984 In wxPerl this method is implemented as
1985 GetCaretPositionForIndex(@a position) returning a
1986 2-element list (ok, rect).
1989 bool GetCaretPositionForIndex(long position
, wxRect
& rect
, wxRichTextParagraphLayoutBox
* container
= NULL
);
1992 Internal helper function returning the line for the visible caret position.
1993 If the caret is shown at the very end of the line, it means the next character
1994 is actually on the following line.
1995 So this function gets the line we're expecting to find if this is the case.
1997 wxRichTextLine
* GetVisibleLineForCaretPosition(long caretPosition
) const;
2000 Gets the command processor associated with the control's buffer.
2002 wxCommandProcessor
* GetCommandProcessor() const { return GetBuffer().GetCommandProcessor(); }
2005 Deletes content if there is a selection, e.g. when pressing a key.
2006 Returns the new caret position in @e newPos, or leaves it if there
2007 was no action. This is undoable.
2010 In wxPerl this method takes no arguments and returns a 2-element
2014 bool DeleteSelectedContent(long* newPos
= NULL
);
2017 Transforms logical (unscrolled) position to physical window position.
2019 wxPoint
GetPhysicalPoint(const wxPoint
& ptLogical
) const;
2022 Transforms physical window position to logical (unscrolled) position.
2024 wxPoint
GetLogicalPoint(const wxPoint
& ptPhysical
) const;
2027 Helper function for finding the caret position for the next word.
2028 Direction is 1 (forward) or -1 (backwards).
2030 virtual long FindNextWordPosition(int direction
= 1) const;
2033 Returns @true if the given position is visible on the screen.
2035 bool IsPositionVisible(long pos
) const;
2038 Returns the first visible position in the current view.
2040 long GetFirstVisiblePosition() const;
2043 Returns the caret position since the default formatting was changed. As
2044 soon as this position changes, we no longer reflect the default style
2045 in the UI. A value of -2 means that we should only reflect the style of the
2046 content under the caret.
2048 long GetCaretPositionForDefaultStyle() const { return m_caretPositionForDefaultStyle
; }
2051 Set the caret position for the default style that the user is selecting.
2053 void SetCaretPositionForDefaultStyle(long pos
) { m_caretPositionForDefaultStyle
= pos
; }
2056 Returns @true if the user has recently set the default style without moving
2057 the caret, and therefore the UI needs to reflect the default style and not
2058 the style at the caret.
2060 Below is an example of code that uses this function to determine whether the UI
2061 should show that the current style is bold.
2063 @see SetAndShowDefaultStyle().
2065 bool IsDefaultStyleShowing() const { return m_caretPositionForDefaultStyle
!= -2; }
2068 Sets @a attr as the default style and tells the control that the UI should
2069 reflect this attribute until the user moves the caret.
2071 @see IsDefaultStyleShowing().
2073 void SetAndShowDefaultStyle(const wxRichTextAttr
& attr
)
2075 SetDefaultStyle(attr
);
2076 SetCaretPositionForDefaultStyle(GetCaretPosition());
2080 Returns the first visible point in the window.
2082 wxPoint
GetFirstVisiblePoint() const;
2086 Returns the content of the entire control as a string.
2088 virtual wxString
GetValue() const;
2091 Replaces existing content with the given text.
2093 virtual void SetValue(const wxString
& value
);
2096 Call this function to prevent refresh and allow fast updates, and then Thaw() to
2097 refresh the control.
2102 Call this function to end a Freeze and refresh the display.
2107 Returns @true if Freeze has been called without a Thaw.
2109 bool IsFrozen() const;
2116 Processes the back key.
2118 virtual bool ProcessBackKey(wxKeyEvent
& event
, int flags
);
2121 Given a character position at which there is a list style, find the range
2122 encompassing the same list style by looking backwards and forwards.
2124 virtual wxRichTextRange
FindRangeForList(long pos
, bool& isNumberedList
);
2127 Sets up the caret for the given position and container, after a mouse click.
2129 bool SetCaretPositionAfterClick(wxRichTextParagraphLayoutBox
* container
, long position
, int hitTestFlags
, bool extendSelection
= false);
2132 Find the caret position for the combination of hit-test flags and character position.
2133 Returns the caret position and also an indication of where to place the caret (caretLineStart)
2134 since this is ambiguous (same position used for end of line and start of next).
2136 long FindCaretPositionForCharacterPosition(long position
, int hitTestFlags
, wxRichTextParagraphLayoutBox
* container
,
2137 bool& caretLineStart
);
2140 Processes mouse movement in order to change the cursor
2142 virtual bool ProcessMouseMovement(wxRichTextParagraphLayoutBox
* container
, wxRichTextObject
* obj
, long position
, const wxPoint
& pos
);
2145 Font names take a long time to retrieve, so cache them (on demand).
2147 static const wxArrayString
& GetAvailableFontNames();
2150 Clears the cache of available font names.
2152 static void ClearAvailableFontNames();
2154 WX_FORWARD_TO_SCROLL_HELPER()
2156 // implement wxTextEntry methods
2157 virtual wxString
DoGetValue() const;
2160 // implement the wxTextEntry pure virtual method
2161 virtual wxWindow
*GetEditableWindow() { return this; }
2163 // margins functions
2164 virtual bool DoSetMargins(const wxPoint
& pt
);
2165 virtual wxPoint
DoGetMargins() const;
2167 // FIXME: this does not work, it allows this code to compile but will fail
2169 #ifndef __WXUNIVERSAL__
2171 virtual WXHWND
GetEditHWND() const { return GetHWND(); }
2174 virtual WXWidget
GetTextWidget() const { return NULL
; }
2177 virtual GtkEditable
*GetEditable() const { return NULL
; }
2178 virtual GtkEntry
*GetEntry() const { return NULL
; }
2180 #endif // !__WXUNIVERSAL__
2186 Currently this simply returns @c wxSize(10, 10).
2188 virtual wxSize
DoGetBestSize() const ;
2190 virtual void DoSetValue(const wxString
& value
, int flags
= 0);
2192 virtual void DoThaw();
2197 #if wxRICHTEXT_BUFFERED_PAINTING
2199 wxBitmap m_bufferBitmap
;
2203 wxRichTextBuffer m_buffer
;
2205 wxMenu
* m_contextMenu
;
2207 /// Caret position (1 less than the character position, so -1 is the
2208 /// first caret position).
2209 long m_caretPosition
;
2211 /// Caret position when the default formatting has been changed. As
2212 /// soon as this position changes, we no longer reflect the default style
2214 long m_caretPositionForDefaultStyle
;
2216 /// Selection range in character positions. -2, -2 means no selection.
2217 wxRichTextSelection m_selection
;
2219 wxRichTextCtrlSelectionState m_selectionState
;
2221 /// Anchor so we know how to extend the selection
2222 /// It's a caret position since it's between two characters.
2223 long m_selectionAnchor
;
2225 /// Anchor object if selecting multiple container objects, such as grid cells.
2226 wxRichTextObject
* m_selectionAnchorObject
;
2228 /// Are we editable?
2231 /// Are we showing the caret position at the start of a line
2232 /// instead of at the end of the previous one?
2233 bool m_caretAtLineStart
;
2235 /// Are we dragging a selection?
2238 /// Do we need full layout in idle?
2239 bool m_fullLayoutRequired
;
2240 wxLongLong m_fullLayoutTime
;
2241 long m_fullLayoutSavedPosition
;
2243 /// Threshold for doing delayed layout
2244 long m_delayedLayoutThreshold
;
2247 wxCursor m_textCursor
;
2248 wxCursor m_urlCursor
;
2250 static wxArrayString sm_availableFontNames
;
2252 wxRichTextContextMenuPropertiesInfo m_contextMenuPropertiesInfo
;
2254 /// The object that currently has the editing focus
2255 wxRichTextParagraphLayoutBox
* m_focusObject
;
2259 @class wxRichTextEvent
2261 This is the event class for wxRichTextCtrl notifications.
2263 @beginEventTable{wxRichTextEvent}
2264 @event{EVT_RICHTEXT_LEFT_CLICK(id, func)}
2265 Process a @c wxEVT_RICHTEXT_LEFT_CLICK event, generated when the user
2266 releases the left mouse button over an object.
2267 @event{EVT_RICHTEXT_RIGHT_CLICK(id, func)}
2268 Process a @c wxEVT_RICHTEXT_RIGHT_CLICK event, generated when the user
2269 releases the right mouse button over an object.
2270 @event{EVT_RICHTEXT_MIDDLE_CLICK(id, func)}
2271 Process a @c wxEVT_RICHTEXT_MIDDLE_CLICK event, generated when the user
2272 releases the middle mouse button over an object.
2273 @event{EVT_RICHTEXT_LEFT_DCLICK(id, func)}
2274 Process a @c wxEVT_RICHTEXT_LEFT_DCLICK event, generated when the user
2275 double-clicks an object.
2276 @event{EVT_RICHTEXT_RETURN(id, func)}
2277 Process a @c wxEVT_RICHTEXT_RETURN event, generated when the user
2278 presses the return key. Valid event functions: GetFlags, GetPosition.
2279 @event{EVT_RICHTEXT_CHARACTER(id, func)}
2280 Process a @c wxEVT_RICHTEXT_CHARACTER event, generated when the user
2281 presses a character key. Valid event functions: GetFlags, GetPosition, GetCharacter.
2282 @event{EVT_RICHTEXT_DELETE(id, func)}
2283 Process a @c wxEVT_RICHTEXT_DELETE event, generated when the user
2284 presses the backspace or delete key. Valid event functions: GetFlags, GetPosition.
2285 @event{EVT_RICHTEXT_RETURN(id, func)}
2286 Process a @c wxEVT_RICHTEXT_RETURN event, generated when the user
2287 presses the return key. Valid event functions: GetFlags, GetPosition.
2288 @event{EVT_RICHTEXT_STYLE_CHANGED(id, func)}
2289 Process a @c wxEVT_RICHTEXT_STYLE_CHANGED event, generated when
2290 styling has been applied to the control. Valid event functions: GetPosition, GetRange.
2291 @event{EVT_RICHTEXT_STYLESHEET_CHANGED(id, func)}
2292 Process a @c wxEVT_RICHTEXT_STYLESHEET_CHANGING event, generated
2293 when the control's stylesheet has changed, for example the user added,
2294 edited or deleted a style. Valid event functions: GetRange, GetPosition.
2295 @event{EVT_RICHTEXT_STYLESHEET_REPLACING(id, func)}
2296 Process a @c wxEVT_RICHTEXT_STYLESHEET_REPLACING event, generated
2297 when the control's stylesheet is about to be replaced, for example when
2298 a file is loaded into the control.
2299 Valid event functions: Veto, GetOldStyleSheet, GetNewStyleSheet.
2300 @event{EVT_RICHTEXT_STYLESHEET_REPLACED(id, func)}
2301 Process a @c wxEVT_RICHTEXT_STYLESHEET_REPLACED event, generated
2302 when the control's stylesheet has been replaced, for example when a file
2303 is loaded into the control.
2304 Valid event functions: GetOldStyleSheet, GetNewStyleSheet.
2305 @event{EVT_RICHTEXT_PROPERTIES_CHANGED(id, func)}
2306 Process a @c wxEVT_RICHTEXT_PROPERTIES_CHANGED event, generated when
2307 properties have been applied to the control. Valid event functions: GetPosition, GetRange.
2308 @event{EVT_RICHTEXT_CONTENT_INSERTED(id, func)}
2309 Process a @c wxEVT_RICHTEXT_CONTENT_INSERTED event, generated when
2310 content has been inserted into the control.
2311 Valid event functions: GetPosition, GetRange.
2312 @event{EVT_RICHTEXT_CONTENT_DELETED(id, func)}
2313 Process a @c wxEVT_RICHTEXT_CONTENT_DELETED event, generated when
2314 content has been deleted from the control.
2315 Valid event functions: GetPosition, GetRange.
2316 @event{EVT_RICHTEXT_BUFFER_RESET(id, func)}
2317 Process a @c wxEVT_RICHTEXT_BUFFER_RESET event, generated when the
2318 buffer has been reset by deleting all content.
2319 You can use this to set a default style for the first new paragraph.
2320 @event{EVT_RICHTEXT_SELECTION_CHANGED(id, func)}
2321 Process a @c wxEVT_RICHTEXT_SELECTION_CHANGED event, generated when the
2322 selection range has changed.
2323 @event{EVT_RICHTEXT_FOCUS_OBJECT_CHANGED(id, func)}
2324 Process a @c wxEVT_RICHTEXT_FOCUS_OBJECT_CHANGED event, generated when the
2325 current focus object has changed.
2328 @library{wxrichtext}
2329 @category{events,richtext}
2332 class wxRichTextEvent
: public wxNotifyEvent
2339 The type of the event.
2341 Window identifier. The value @c wxID_ANY indicates a default value.
2343 wxRichTextEvent(wxEventType commandType
= wxEVT_NULL
, int winid
= 0)
2344 : wxNotifyEvent(commandType
, winid
),
2345 m_flags(0), m_position(-1), m_oldStyleSheet(NULL
), m_newStyleSheet(NULL
),
2346 m_char((wxChar
) 0), m_container(NULL
), m_oldContainer(NULL
)
2352 wxRichTextEvent(const wxRichTextEvent
& event
)
2353 : wxNotifyEvent(event
),
2354 m_flags(event
.m_flags
), m_position(-1),
2355 m_oldStyleSheet(event
.m_oldStyleSheet
), m_newStyleSheet(event
.m_newStyleSheet
),
2356 m_char((wxChar
) 0), m_container(event
.m_container
), m_oldContainer(event
.m_oldContainer
)
2360 Returns the buffer position at which the event occurred.
2362 long GetPosition() const { return m_position
; }
2365 Sets the buffer position variable.
2367 void SetPosition(long pos
) { m_position
= pos
; }
2370 Returns flags indicating modifier keys pressed.
2372 Possible values are @c wxRICHTEXT_CTRL_DOWN, @c wxRICHTEXT_SHIFT_DOWN, and @c wxRICHTEXT_ALT_DOWN.
2374 int GetFlags() const { return m_flags
; }
2377 Sets flags indicating modifier keys pressed.
2379 Possible values are @c wxRICHTEXT_CTRL_DOWN, @c wxRICHTEXT_SHIFT_DOWN, and @c wxRICHTEXT_ALT_DOWN.
2381 void SetFlags(int flags
) { m_flags
= flags
; }
2384 Returns the old style sheet.
2386 Can be used in a @c wxEVT_RICHTEXT_STYLESHEET_CHANGING or
2387 @c wxEVT_RICHTEXT_STYLESHEET_CHANGED event handler.
2389 wxRichTextStyleSheet
* GetOldStyleSheet() const { return m_oldStyleSheet
; }
2392 Sets the old style sheet variable.
2394 void SetOldStyleSheet(wxRichTextStyleSheet
* sheet
) { m_oldStyleSheet
= sheet
; }
2397 Returns the new style sheet.
2399 Can be used in a @c wxEVT_RICHTEXT_STYLESHEET_CHANGING or
2400 @c wxEVT_RICHTEXT_STYLESHEET_CHANGED event handler.
2402 wxRichTextStyleSheet
* GetNewStyleSheet() const { return m_newStyleSheet
; }
2405 Sets the new style sheet variable.
2407 void SetNewStyleSheet(wxRichTextStyleSheet
* sheet
) { m_newStyleSheet
= sheet
; }
2410 Gets the range for the current operation.
2412 const wxRichTextRange
& GetRange() const { return m_range
; }
2415 Sets the range variable.
2417 void SetRange(const wxRichTextRange
& range
) { m_range
= range
; }
2420 Returns the character pressed, within a @c wxEVT_RICHTEXT_CHARACTER event.
2422 wxChar
GetCharacter() const { return m_char
; }
2425 Sets the character variable.
2427 void SetCharacter(wxChar ch
) { m_char
= ch
; }
2430 Returns the container for which the event is relevant.
2432 wxRichTextParagraphLayoutBox
* GetContainer() const { return m_container
; }
2435 Sets the container for which the event is relevant.
2437 void SetContainer(wxRichTextParagraphLayoutBox
* container
) { m_container
= container
; }
2440 Returns the old container, for a focus change event.
2442 wxRichTextParagraphLayoutBox
* GetOldContainer() const { return m_oldContainer
; }
2445 Sets the old container, for a focus change event.
2447 void SetOldContainer(wxRichTextParagraphLayoutBox
* container
) { m_oldContainer
= container
; }
2449 virtual wxEvent
*Clone() const { return new wxRichTextEvent(*this); }
2454 wxRichTextStyleSheet
* m_oldStyleSheet
;
2455 wxRichTextStyleSheet
* m_newStyleSheet
;
2456 wxRichTextRange m_range
;
2458 wxRichTextParagraphLayoutBox
* m_container
;
2459 wxRichTextParagraphLayoutBox
* m_oldContainer
;