wxRichTextBuffer Class Reference | wxWidgets

| Version: 3.2.11

Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Attributes | Static Protected Attributes | List of all members
wxRichTextBuffer Class Reference
Class List by Category » Rich Text

`#include </cygdrive/c/Users/Hamis/Cygwin-packaging/wxWidgets3.2/wxWidgets3.2-3.2.11-1.x86_64/src/wxWidgets-3.2.11/interface/wx/richtext/richtextbuffer.h>`

Inheritance diagram for wxRichTextBuffer:
[legend]

## Detailed Description

This is a kind of paragraph layout box, used to represent the whole buffer.

##

Library: wxRichText
Category: Rich Text

See also
  wxRichTextParagraphLayoutBox, wxRichTextCtrl

## Public Member Functions
| wxRichTextBuffer ()
| Default constructor.
| wxRichTextBuffer (const wxRichTextBuffer &obj)
| Copy constructor.
virtual | ~wxRichTextBuffer ()
wxCommandProcessor * | GetCommandProcessor () const
| Returns the command processor.
void | SetStyleSheet (wxRichTextStyleSheet *styleSheet)
| Sets style sheet, if any.
virtual wxRichTextStyleSheet * | GetStyleSheet () const
| Returns the style sheet.
bool | SetStyleSheetAndNotify (wxRichTextStyleSheet *sheet)
| Sets the style sheet and sends a notification of the change.
bool | PushStyleSheet (wxRichTextStyleSheet *styleSheet)
| Pushes the style sheet to the top of the style sheet stack.
wxRichTextStyleSheet * | PopStyleSheet ()
| Pops the style sheet from the top of the style sheet stack.
wxRichTextFontTable & | GetFontTable ()
| Returns the table storing fonts, for quick access and font reuse.
const wxRichTextFontTable & | GetFontTable () const
| Returns the table storing fonts, for quick access and font reuse.
void | SetFontTable (const wxRichTextFontTable &table)
| Sets table storing fonts, for quick access and font reuse.
void | SetFontScale (double fontScale)
| Sets the scale factor for displaying fonts, for example for more comfortable editing.
double | GetFontScale () const
| Returns the scale factor for displaying fonts, for example for more comfortable editing.
void | SetDimensionScale (double dimScale)
| Sets the scale factor for displaying certain dimensions such as indentation and inter-paragraph spacing.
double | GetDimensionScale () const
| Returns the scale factor for displaying certain dimensions such as indentation and inter-paragraph spacing.
void | Init ()
| Initialisation.
virtual void | ResetAndClearCommands ()
| Clears the buffer, adds an empty paragraph, and clears the command processor.
virtual bool | LoadFile (const wxString &filename, wxRichTextFileType type=wxRICHTEXT_TYPE_ANY)
| Loads content from a stream or file.
virtual bool | LoadFile (wxInputStream &stream, wxRichTextFileType type=wxRICHTEXT_TYPE_ANY)
virtual bool | SaveFile (const wxString &filename, wxRichTextFileType type=wxRICHTEXT_TYPE_ANY)
| Saves content to a stream or file.
virtual bool | SaveFile (wxOutputStream &stream, wxRichTextFileType type=wxRICHTEXT_TYPE_ANY)
void | SetHandlerFlags (int flags)
| Sets the handler flags, controlling loading and saving.
int | GetHandlerFlags () const
| Gets the handler flags, controlling loading and saving.
virtual wxRichTextRange | AddParagraph (const wxString &text, wxRichTextAttr *paraStyle=NULL)
| Convenience function to add a paragraph of text.
virtual bool | BeginBatchUndo (const wxString &cmdName)
| Begin collapsing undo/redo commands.
virtual bool | EndBatchUndo ()
| End collapsing undo/redo commands.
virtual bool | BatchingUndo () const
| Returns true if we are collapsing commands.
virtual bool | SubmitAction (wxRichTextAction *action)
| Submit the action immediately, or delay according to whether collapsing is on.
virtual wxRichTextCommand * | GetBatchedCommand () const
| Returns the collapsed command.
virtual bool | BeginSuppressUndo ()
| Begin suppressing undo/redo commands.
virtual bool | EndSuppressUndo ()
| End suppressing undo/redo commands.
virtual bool | SuppressingUndo () const
| Are we suppressing undo?
virtual bool | CopyToClipboard (const wxRichTextRange &range)
| Copy the range to the clipboard.
virtual bool | PasteFromClipboard (long position)
| Paste the clipboard content to the buffer.
virtual bool | CanPasteFromClipboard () const
| Returns true if we can paste from the clipboard.
virtual bool | BeginStyle (const wxRichTextAttr &style)
| Begin using a style.
virtual bool | EndStyle ()
| End the style.
virtual bool | EndAllStyles ()
| End all styles.
virtual void | ClearStyleStack ()
| Clears the style stack.
virtual size_t | GetStyleStackSize () const
| Returns the size of the style stack, for example to check correct nesting.
bool | BeginBold ()
| Begins using bold.
bool | EndBold ()
| Ends using bold.
bool | BeginItalic ()
| Begins using italic.
bool | EndItalic ()
| Ends using italic.
bool | BeginUnderline ()
| Begins using underline.
bool | EndUnderline ()
| Ends using underline.
bool | BeginFontSize (int pointSize)
| Begins using point size.
bool | EndFontSize ()
| Ends using point size.
bool | BeginFont (const wxFont &font)
| Begins using this font.
bool | EndFont ()
| Ends using a font.
bool | BeginTextColour (const wxColour &colour)
| Begins using this colour.
bool | EndTextColour ()
| Ends using a colour.
bool | BeginAlignment (wxTextAttrAlignment alignment)
| Begins using alignment.
bool | EndAlignment ()
| Ends alignment.
bool | BeginLeftIndent (int leftIndent, int leftSubIndent=0)
| Begins using leftIndent for the left indent, and optionally leftSubIndent for the sub-indent.
bool | EndLeftIndent ()
| Ends left indent.
bool | BeginRightIndent (int rightIndent)
| Begins a right indent, specified in tenths of a millimetre.
bool | EndRightIndent ()
| Ends right indent.
bool | BeginParagraphSpacing (int before, int after)
| Begins paragraph spacing; pass the before-paragraph and after-paragraph spacing in tenths of a millimetre.
bool | EndParagraphSpacing ()
| Ends paragraph spacing.
bool | BeginLineSpacing (int lineSpacing)
| Begins line spacing using the specified value.
bool | EndLineSpacing ()
| Ends line spacing.
bool | BeginNumberedBullet (int bulletNumber, int leftIndent, int leftSubIndent, int bulletStyle=wxTEXT_ATTR_BULLET_STYLE_ARABIC|wxTEXT_ATTR_BULLET_STYLE_PERIOD)
| Begins numbered bullet.
bool | EndNumberedBullet ()
| Ends numbered bullet.
bool | BeginSymbolBullet (const wxString &symbol, int leftIndent, int leftSubIndent, int bulletStyle=wxTEXT_ATTR_BULLET_STYLE_SYMBOL)
| Begins applying a symbol bullet, using a character from the current font.
bool | EndSymbolBullet ()
| Ends symbol bullet.
bool | BeginStandardBullet (const wxString &bulletName, int leftIndent, int leftSubIndent, int bulletStyle=wxTEXT_ATTR_BULLET_STYLE_STANDARD)
| Begins applying a standard bullet, using one of the standard bullet names (currently `standard/circle` or `standard/square`.
bool | EndStandardBullet ()
| Ends standard bullet.
bool | BeginCharacterStyle (const wxString &characterStyle)
| Begins named character style.
bool | EndCharacterStyle ()
| Ends named character style.
bool | BeginParagraphStyle (const wxString &paragraphStyle)
| Begins named paragraph style.
bool | EndParagraphStyle ()
| Ends named character style.
bool | BeginListStyle (const wxString &listStyle, int level=1, int number=1)
| Begins named list style.
bool | EndListStyle ()
| Ends named character style.
bool | BeginURL (const wxString &url, const wxString &characterStyle=wxEmptyString)
| Begins applying wxTEXT_ATTR_URL to the content.
bool | EndURL ()
| Ends URL.
bool | AddEventHandler (wxEvtHandler *handler)
| Adds an event handler.
bool | RemoveEventHandler (wxEvtHandler *handler, bool deleteHandler=false)
| Removes an event handler from the buffer's list of handlers, deleting the object if deleteHandler is true.
void | ClearEventHandlers ()
| Clear event handlers.
bool | SendEvent (wxEvent &event, bool sendToAll=true)
| Send event to event handlers.
virtual int | HitTest (wxDC &dc, wxRichTextDrawingContext &context, const wxPoint &pt, long &textPosition, wxRichTextObject **obj, wxRichTextObject **contextObj, int flags=0)
| Hit-testing: returns a flag indicating hit test details, plus information about position.
void | Copy (const wxRichTextBuffer &obj)
| Copies the buffer.
void | operator= (const wxRichTextBuffer &obj)
| Assignment operator.
virtual wxRichTextObject * | Clone () const
| Clones the buffer.
bool | InsertParagraphsWithUndo (long pos, const wxRichTextParagraphLayoutBox &paragraphs, wxRichTextCtrl *ctrl, int flags=0)
| Submits a command to insert paragraphs.
bool | InsertTextWithUndo (long pos, const wxString &text, wxRichTextCtrl *ctrl, int flags=0)
| Submits a command to insert the given text.
bool | InsertNewlineWithUndo (long pos, wxRichTextCtrl *ctrl, int flags=0)
| Submits a command to insert a newline.
bool | InsertImageWithUndo (long pos, const wxRichTextImageBlock &imageBlock, wxRichTextCtrl *ctrl, int flags=0, const wxRichTextAttr &textAttr=wxRichTextAttr())
| Submits a command to insert the given image.
wxRichTextObject * | InsertObjectWithUndo (long pos, wxRichTextObject *object, wxRichTextCtrl *ctrl, int flags)
| Submits a command to insert an object.
bool | DeleteRangeWithUndo (const wxRichTextRange &range, wxRichTextCtrl *ctrl)
| Submits a command to delete this range.
void | Modify (bool modify=true)
| Mark modified.
bool | IsModified () const
| Returns true if the buffer was modified.
virtual void | Dump ()
| Dumps contents of buffer for debugging purposes.
virtual void | Dump (wxTextOutputStream &stream)
| Dump object data to the given output stream for debugging.
double | GetScale () const
| Returns the scale factor for calculating dimensions.
void | SetScale (double scale)
| Sets the scale factor for calculating dimensions.
Public Member Functions inherited from wxRichTextParagraphLayoutBox
| wxRichTextParagraphLayoutBox (wxRichTextObject *parent=NULL)
| wxRichTextParagraphLayoutBox (const wxRichTextParagraphLayoutBox &obj)
| ~wxRichTextParagraphLayoutBox ()
virtual bool | Draw (wxDC &dc, wxRichTextDrawingContext &context, const wxRichTextRange &range, const wxRichTextSelection &selection, const wxRect &rect, int descent, int style)
| Draw the item, within the given range.
virtual bool | Layout (wxDC &dc, wxRichTextDrawingContext &context, const wxRect &rect, const wxRect &parentRect, int style)
| Lay the item out at the specified position with the given size constraint.
virtual bool | GetRangeSize (const wxRichTextRange &range, wxSize &size, int &descent, wxDC &dc, wxRichTextDrawingContext &context, int flags, const wxPoint &position=wxPoint(0, 0), const wxSize &parentSize=wxDefaultSize, wxArrayInt *partialExtents=NULL) const
| Returns the object size for the given range.
virtual bool | DeleteRange (const wxRichTextRange &range)
| Deletes the given range.
virtual wxString | GetTextForRange (const wxRichTextRange &range) const
| Returns any text in this object for the given range.
virtual bool | ImportFromXML (wxRichTextBuffer *buffer, wxXmlNode *node, wxRichTextXMLHandler *handler, bool *recurse)
| Imports this object from XML.
virtual wxString | GetXMLNodeName () const
| Returns the XML node name of this object.
virtual bool | AcceptsFocus () const
| Returns true if objects of this class can accept the focus, i.e. a call to SetFocusObject is possible.
void | SetRichTextCtrl (wxRichTextCtrl *ctrl)
| Associates a control with the buffer, for operations that for example require refreshing the window.
wxRichTextCtrl * | GetRichTextCtrl () const
| Returns the associated control.
void | SetPartialParagraph (bool partialPara)
| Sets a flag indicating whether the last paragraph is partial or complete.
bool | GetPartialParagraph () const
| Returns a flag indicating whether the last paragraph is partial or complete.
virtual bool | IsTopLevel () const
| Returns true if this object is top-level, i.e. contains its own paragraphs, such as a text box.
bool | InsertParagraphsWithUndo (wxRichTextBuffer *buffer, long pos, const wxRichTextParagraphLayoutBox &paragraphs, wxRichTextCtrl *ctrl, int flags=0)
| Submits a command to insert paragraphs.
bool | InsertTextWithUndo (wxRichTextBuffer *buffer, long pos, const wxString &text, wxRichTextCtrl *ctrl, int flags=0)
| Submits a command to insert the given text.
bool | InsertNewlineWithUndo (wxRichTextBuffer *buffer, long pos, wxRichTextCtrl *ctrl, int flags=0)
| Submits a command to insert the given text.
bool | InsertImageWithUndo (wxRichTextBuffer *buffer, long pos, const wxRichTextImageBlock &imageBlock, wxRichTextCtrl *ctrl, int flags, const wxRichTextAttr &textAttr)
| Submits a command to insert the given image.
wxRichTextField * | InsertFieldWithUndo (wxRichTextBuffer *buffer, long pos, const wxString &fieldType, const wxRichTextProperties &properties, wxRichTextCtrl *ctrl, int flags, const wxRichTextAttr &textAttr)
| Submits a command to insert the given field.
wxRichTextAttr | GetStyleForNewParagraph (wxRichTextBuffer *buffer, long pos, bool caretPosition=false, bool lookUpNewParaStyle=false) const
| Returns the style that is appropriate for a new paragraph at this position.
wxRichTextObject * | InsertObjectWithUndo (wxRichTextBuffer *buffer, long pos, wxRichTextObject *object, wxRichTextCtrl *ctrl, int flags=0)
| Inserts an object.
bool | DeleteRangeWithUndo (const wxRichTextRange &range, wxRichTextCtrl *ctrl, wxRichTextBuffer *buffer)
| Submits a command to delete this range.
void | DrawFloats (wxDC &dc, wxRichTextDrawingContext &context, const wxRichTextRange &range, const wxRichTextSelection &selection, const wxRect &rect, int descent, int style)
| Draws the floating objects in this buffer.
void | MoveAnchoredObjectToParagraph (wxRichTextParagraph *from, wxRichTextParagraph *to, wxRichTextObject *obj)
| Moves an anchored object to another paragraph.
void | Init ()
| Initializes the object.
virtual void | Clear ()
| Clears all the children.
virtual void | Reset ()
| Clears and initializes with one blank paragraph.
virtual wxRichTextRange | AddImage (const wxImage &image, wxRichTextAttr *paraStyle=NULL)
| Convenience function to add an image.
virtual wxRichTextRange | AddParagraphs (const wxString &text, wxRichTextAttr *paraStyle=NULL)
| Adds multiple paragraphs, based on newlines.
virtual wxRichTextLine * | GetLineAtPosition (long pos, bool caretPosition=false) const
| Returns the line at the given position.
virtual wxRichTextLine * | GetLineAtYPosition (int y) const
| Returns the line at the given y pixel position, or the last line.
virtual wxRichTextParagraph * | GetParagraphAtPosition (long pos, bool caretPosition=false) const
| Returns the paragraph at the given character or caret position.
virtual wxSize | GetLineSizeAtPosition (long pos, bool caretPosition=false) const
| Returns the line size at the given position.
virtual long | GetVisibleLineNumber (long pos, bool caretPosition=false, bool startOfLine=false) const
| Given a position, returns the number of the visible line (potentially many to a paragraph), starting from zero at the start of the buffer.
virtual wxRichTextLine * | GetLineForVisibleLineNumber (long lineNumber) const
| Given a line number, returns the corresponding wxRichTextLine object.
virtual wxRichTextObject * | GetLeafObjectAtPosition (long position) const
| Returns the leaf object in a paragraph at this position.
virtual wxRichTextParagraph * | GetParagraphAtLine (long paragraphNumber) const
| Returns the paragraph by number.
virtual wxRichTextParagraph * | GetParagraphForLine (wxRichTextLine *line) const
| Returns the paragraph for a given line.
virtual int | GetParagraphLength (long paragraphNumber) const
| Returns the length of the paragraph.
virtual int | GetParagraphCount () const
| Returns the number of paragraphs.
virtual int | GetLineCount () const
| Returns the number of visible lines.
virtual wxString | GetParagraphText (long paragraphNumber) const
| Returns the text of the paragraph.
virtual long | XYToPosition (long x, long y) const
| Converts zero-based line column and paragraph number to a position.
virtual bool | PositionToXY (long pos, long *x, long *y) const
| Converts a zero-based position to line column and paragraph number.
virtual bool | SetStyle (const wxRichTextRange &range, const wxRichTextAttr &style, int flags=wxRICHTEXT_SETSTYLE_WITH_UNDO)
| Sets the attributes for the given range.
virtual void | SetStyle (wxRichTextObject *obj, const wxRichTextAttr &textAttr, int flags=wxRICHTEXT_SETSTYLE_WITH_UNDO)
| Sets the attributes for the given object only, for example the box attributes for a text box.
virtual bool | GetStyle (long position, wxRichTextAttr &style)
| Returns the combined text attributes for this position.
virtual bool | GetUncombinedStyle (long position, wxRichTextAttr &style)
| Returns the content (uncombined) attributes for this position.
virtual bool | DoGetStyle (long position, wxRichTextAttr &style, bool combineStyles=true)
| Implementation helper for GetStyle.
virtual bool | GetStyleForRange (const wxRichTextRange &range, wxRichTextAttr &style)
| This function gets a style representing the common, combined attributes in the given range.
bool | CollectStyle (wxRichTextAttr &currentStyle, const wxRichTextAttr &style, wxRichTextAttr &clashingAttr, wxRichTextAttr &absentAttr)
| Combines style with currentStyle for the purpose of summarising the attributes of a range of content.
virtual bool | SetListStyle (const wxRichTextRange &range, wxRichTextListStyleDefinition *def, int flags=wxRICHTEXT_SETSTYLE_WITH_UNDO, int startFrom=1, int specifiedLevel=-1)
| Sets the list attributes for the given range, passing flags to determine how the attributes are set.
virtual bool | SetListStyle (const wxRichTextRange &range, const wxString &defName, int flags=wxRICHTEXT_SETSTYLE_WITH_UNDO, int startFrom=1, int specifiedLevel=-1)
virtual bool | ClearListStyle (const wxRichTextRange &range, int flags=wxRICHTEXT_SETSTYLE_WITH_UNDO)
| Clears the list style from the given range, clearing list-related attributes and applying any named paragraph style associated with each paragraph.
virtual bool | NumberList (const wxRichTextRange &range, wxRichTextListStyleDefinition *def=NULL, int flags=wxRICHTEXT_SETSTYLE_WITH_UNDO, int startFrom=1, int specifiedLevel=-1)
| Numbers the paragraphs in the given range.
virtual bool | NumberList (const wxRichTextRange &range, const wxString &defName, int flags=wxRICHTEXT_SETSTYLE_WITH_UNDO, int startFrom=1, int specifiedLevel=-1)
virtual bool | PromoteList (int promoteBy, const wxRichTextRange &range, wxRichTextListStyleDefinition *def=NULL, int flags=wxRICHTEXT_SETSTYLE_WITH_UNDO, int specifiedLevel=-1)
| Promotes the list items within the given range.
virtual bool | PromoteList (int promoteBy, const wxRichTextRange &range, const wxString &defName, int flags=wxRICHTEXT_SETSTYLE_WITH_UNDO, int specifiedLevel=-1)
virtual bool | DoNumberList (const wxRichTextRange &range, const wxRichTextRange &promotionRange, int promoteBy, wxRichTextListStyleDefinition *def, int flags=wxRICHTEXT_SETSTYLE_WITH_UNDO, int startFrom=1, int specifiedLevel=-1)
| Helper for NumberList and PromoteList, that does renumbering and promotion simultaneously def can be NULL/empty to indicate that the existing list style should be used.
virtual bool | FindNextParagraphNumber (wxRichTextParagraph *previousParagraph, wxRichTextAttr &attr) const
| Fills in the attributes for numbering a paragraph after previousParagraph.
virtual bool | SetProperties (const wxRichTextRange &range, const wxRichTextProperties &properties, int flags=wxRICHTEXT_SETPROPERTIES_WITH_UNDO)
| Sets the properties for the given range, passing flags to determine how the attributes are set.
virtual bool | SetObjectPropertiesWithUndo (wxRichTextObject &obj, const wxRichTextProperties &properties, wxRichTextObject *objToSet=NULL)
| Sets with undo the properties for the given object.
virtual bool | HasCharacterAttributes (const wxRichTextRange &range, const wxRichTextAttr &style) const
| Test if this whole range has character attributes of the specified kind.
virtual bool | HasParagraphAttributes (const wxRichTextRange &range, const wxRichTextAttr &style) const
| Test if this whole range has paragraph attributes of the specified kind.
virtual void | PrepareContent (wxRichTextParagraphLayoutBox &container)
| Prepares the content just before insertion (or after buffer reset).
virtual bool | InsertFragment (long position, wxRichTextParagraphLayoutBox &fragment)
| Insert fragment into this box at the given position.
virtual bool | CopyFragment (const wxRichTextRange &range, wxRichTextParagraphLayoutBox &fragment)
| Make a copy of the fragment corresponding to the given range, putting it in fragment.
virtual bool | ApplyStyleSheet (wxRichTextStyleSheet *styleSheet)
| Apply the style sheet to the buffer, for example if the styles have changed.
void | Copy (const wxRichTextParagraphLayoutBox &obj)
void | operator= (const wxRichTextParagraphLayoutBox &obj)
virtual void | UpdateRanges ()
| Calculate ranges.
virtual wxString | GetText () const
| Get all the text.
virtual bool | SetDefaultStyle (const wxRichTextAttr &style)
| Sets the default style, affecting the style currently being applied (for example, setting the default style to bold will cause subsequently inserted text to be bold).
virtual const wxRichTextAttr & | GetDefaultStyle () const
| Returns the current default style, affecting the style currently being applied (for example, setting the default style to bold will cause subsequently inserted text to be bold).
virtual void | SetBasicStyle (const wxRichTextAttr &style)
| Sets the basic (overall) style.
virtual const wxRichTextAttr & | GetBasicStyle () const
| Returns the basic (overall) style.
virtual void | Invalidate (const wxRichTextRange &invalidRange=wxRICHTEXT_ALL)
| Invalidates the buffer.
virtual void | DoInvalidate (const wxRichTextRange &invalidRange)
| Do the (in)validation for this object only.
virtual void | InvalidateHierarchy (const wxRichTextRange &invalidRange=wxRICHTEXT_ALL)
| Do the (in)validation both up and down the hierarchy.
virtual bool | UpdateFloatingObjects (const wxRect &availableRect, wxRichTextObject *untilObj=NULL)
| Gather information about floating objects.
wxRichTextRange | GetInvalidRange (bool wholeParagraphs=false) const
| Get invalid range, rounding to entire paragraphs if argument is true.
bool | IsDirty () const
| Returns true if this object needs layout.
wxRichTextFloatCollector * | GetFloatCollector ()
| Returns the wxRichTextFloatCollector of this object.
int | GetFloatingObjectCount () const
| Returns the number of floating objects at this level.
bool | GetFloatingObjects (wxRichTextObjectList &objects) const
| Returns a list of floating objects.
Public Member Functions inherited from wxRichTextCompositeObject
| wxRichTextCompositeObject (wxRichTextObject *parent=NULL)
virtual | ~wxRichTextCompositeObject ()
virtual bool | FindPosition (wxDC &dc, wxRichTextDrawingContext &context, long index, wxPoint &pt, int *height, bool forceLineStart)
| Finds the absolute position and row height for the given character position.
virtual void | CalculateRange (long start, long &end)
| Calculates the range of the object.
wxRichTextObjectList & | GetChildren ()
| Returns the children.
const wxRichTextObjectList & | GetChildren () const
| Returns the children.
size_t | GetChildCount () const
| Returns the number of children.
wxRichTextObject * | GetChild (size_t n) const
| Returns the nth child.
virtual bool | IsComposite () const
| Returns true if this object is composite.
virtual bool | IsAtomic () const
| Returns true if no user editing can be done inside the object.
virtual bool | IsEmpty () const
| Returns true if the buffer is empty.
virtual wxRichTextObject * | GetChildAtPosition (long pos) const
| Returns the child object at the given character position.
void | Copy (const wxRichTextCompositeObject &obj)
void | operator= (const wxRichTextCompositeObject &obj)
size_t | AppendChild (wxRichTextObject *child)
| Appends a child, returning the position.
bool | InsertChild (wxRichTextObject *child, wxRichTextObject *inFrontOf)
| Inserts the child in front of the given object, or at the beginning.
bool | RemoveChild (wxRichTextObject *child, bool deleteChild=false)
| Removes and optionally deletes the specified child.
bool | DeleteChildren ()
| Deletes all the children.
bool | Defragment (wxRichTextDrawingContext &context, const wxRichTextRange &range=wxRICHTEXT_ALL)
| Recursively merges all pieces that can be merged.
virtual void | Move (const wxPoint &pt)
| Moves the object recursively, by adding the offset from old to new.
Public Member Functions inherited from wxRichTextObject
| wxRichTextObject (wxRichTextObject *parent=NULL)
| Constructor, taking an optional parent pointer.
virtual | ~wxRichTextObject ()
virtual wxSize | GetBestSize () const
| Returns the best size, i.e. the ideal starting size for this object irrespective of available space.
virtual wxRichTextObject * | DoSplit (long pos)
| Do a split from pos, returning an object containing the second part, and setting the first part in 'this'.
virtual bool | IsFloatable () const
| Returns true if this class of object is floatable.
virtual bool | IsFloating () const
| Returns true if this object is currently floating.
virtual int | GetFloatDirection () const
| Returns the floating direction.
virtual bool | CanMerge (wxRichTextObject *object, wxRichTextDrawingContext &context) const
| Returns true if this object can merge itself with the given one.
virtual bool | Merge (wxRichTextObject *object, wxRichTextDrawingContext &context)
| Returns true if this object merged itself with the given one.
virtual bool | CanSplit (wxRichTextDrawingContext &context) const
| Returns true if this object can potentially be split, by virtue of having different virtual attributes for individual sub-objects.
virtual wxRichTextObject * | Split (wxRichTextDrawingContext &context)
| Returns the final object in the split objects if this object was split due to differences between sub-object virtual attributes.
virtual bool | CanEditProperties () const
| Returns true if we can edit the object's properties via a GUI.
virtual bool | EditProperties (wxWindow *parent, wxRichTextBuffer *buffer)
| Edits the object's properties via a GUI.
virtual wxString | GetPropertiesMenuLabel () const
| Returns the label to be used for the properties context menu item.
virtual bool | UsesParagraphAttributes () const
| Returns true if this object takes note of paragraph attributes (text and image objects don't).
virtual bool | HandlesChildSelections () const
| Returns true if this object can handle the selections of its children, fOr example a table.
virtual wxRichTextSelection | GetSelection (long start, long end) const
| Returns a selection object specifying the selections between start and end character positions.
virtual wxSize | GetCachedSize () const
| Gets the cached object size as calculated by Layout.
virtual void | SetCachedSize (const wxSize &sz)
| Sets the cached object size as calculated by Layout.
virtual wxSize | GetMaxSize () const
| Gets the maximum object size as calculated by Layout.
virtual void | SetMaxSize (const wxSize &sz)
| Sets the maximum object size as calculated by Layout.
virtual wxSize | GetMinSize () const
| Gets the minimum object size as calculated by Layout.
virtual void | SetMinSize (const wxSize &sz)
| Sets the minimum object size as calculated by Layout.
virtual wxTextAttrSize | GetNaturalSize () const
| Gets the 'natural' size for an object.
virtual wxPoint | GetPosition () const
| Returns the object position in pixels.
virtual void | SetPosition (const wxPoint &pos)
| Sets the object position in pixels.
virtual wxPoint | GetAbsolutePosition () const
| Returns the absolute object position, by traversing up the child/parent hierarchy.
virtual wxRect | GetRect () const
| Returns the rectangle enclosing the object.
void | SetRange (const wxRichTextRange &range)
| Sets the object's range within its container.
const wxRichTextRange & | GetRange () const
| Returns the object's range.
wxRichTextRange & | GetRange ()
| Returns the object's range.
void | SetOwnRange (const wxRichTextRange &range)
| Set the object's own range, for a top-level object with its own position space.
const wxRichTextRange & | GetOwnRange () const
| Returns the object's own range (valid if top-level).
wxRichTextRange & | GetOwnRange ()
| Returns the object's own range (valid if top-level).
wxRichTextRange | GetOwnRangeIfTopLevel () const
| Returns the object's own range only if a top-level object.
virtual wxRichTextObject * | GetParent () const
| Returns a pointer to the parent object.
virtual void | SetParent (wxRichTextObject *parent)
| Sets the pointer to the parent object.
virtual wxRichTextParagraphLayoutBox * | GetContainer () const
| Returns the top-level container of this object.
virtual wxRichTextParagraphLayoutBox * | GetParentContainer () const
| Returns the top-level container of this object.
virtual void | SetMargins (int margin)
| Set the margin around the object, in pixels.
virtual void | SetMargins (int leftMargin, int rightMargin, int topMargin, int bottomMargin)
| Set the margin around the object, in pixels.
virtual int | GetLeftMargin () const
| Returns the left margin of the object, in pixels.
virtual int | GetRightMargin () const
| Returns the right margin of the object, in pixels.
virtual int | GetTopMargin () const
| Returns the top margin of the object, in pixels.
virtual int | GetBottomMargin () const
| Returns the bottom margin of the object, in pixels.
virtual wxRect | GetAvailableContentArea (wxDC &dc, wxRichTextDrawingContext &context, const wxRect &outerRect) const
| Calculates the available content space in the given rectangle, given the margins, border and padding specified in the object's attributes.
virtual bool | LayoutToBestSize (wxDC &dc, wxRichTextDrawingContext &context, wxRichTextBuffer *buffer, const wxRichTextAttr &parentAttr, const wxRichTextAttr &attr, const wxRect &availableParentSpace, const wxRect &availableContainerSpace, int style)
| Lays out the object first with a given amount of space, and then if no width was specified in attr, lays out the object again using the minimum size.
virtual bool | AdjustAttributes (wxRichTextAttr &attr, wxRichTextDrawingContext &context)
| Adjusts the attributes for virtual attribute provision, collapsed borders, etc.
void | SetAttributes (const wxRichTextAttr &attr)
| Sets the object's attributes.
const wxRichTextAttr & | GetAttributes () const
| Returns the object's attributes.
wxRichTextAttr & | GetAttributes ()
| Returns the object's attributes.
wxRichTextProperties & | GetProperties ()
| Returns the object's properties.
const wxRichTextProperties & | GetProperties () const
| Returns the object's properties.
void | SetProperties (const wxRichTextProperties &props)
| Sets the object's properties.
void | SetDescent (int descent)
| Sets the stored descent value.
int | GetDescent () const
| Returns the stored descent value.
wxRichTextBuffer * | GetBuffer () const
| Returns the containing buffer.
void | SetName (const wxString &name)
| Sets the identifying name for this object as a property using the "name" key.
wxString | GetName () const
| Returns the identifying name for this object from the properties, using the "name" key.
bool | IsShown () const
| Returns true if the object will be shown, false otherwise.
virtual void | Show (bool show)
| Call to show or hide this object.
void | Copy (const wxRichTextObject &obj)
| Copies the object.
void | Reference ()
| Reference-counting allows us to use the same object in multiple lists (not yet used).
void | Dereference ()
| Reference-counting allows us to use the same object in multiple lists (not yet used).
int | ConvertTenthsMMToPixels (wxDC &dc, int units) const
| Converts units in tenths of a millimetre to device units.
int | ConvertPixelsToTenthsMM (wxDC &dc, int pixels) const
| Convert units in pixels to tenths of a millimetre.
Public Member Functions inherited from wxObject
| wxObject ()
| Default ctor; initializes to NULL the internal reference data.
| wxObject (const wxObject &other)
| Copy ctor.
virtual | ~wxObject ()
| Destructor.
virtual wxClassInfo * | GetClassInfo () const
| This virtual function is redefined for every class that requires run-time type information, when using the wxDECLARE_CLASS macro (or similar).
wxObjectRefData * | GetRefData () const
| Returns the wxObject::m_refData pointer, i.e. the data referenced by this object.
bool | IsKindOf (const wxClassInfo *info) const
| Determines whether this class is a subclass of (or the same class as) the given class.
bool | IsSameAs (const wxObject &obj) const
| Returns true if this object has the same data pointer as obj.
void | Ref (const wxObject &clone)
| Makes this object refer to the data in clone.
void | SetRefData (wxObjectRefData *data)
| Sets the wxObject::m_refData pointer.
void | UnRef ()
| Decrements the reference count in the associated data, and if it is zero, deletes the data.
void | UnShare ()
| This is the same of AllocExclusive() but this method is public.
void | operator delete (void *buf)
| The delete operator is defined for debugging versions of the library only, when the identifier `__WXDEBUG__` is defined.
void * | operator new (size_t size, const wxString &filename=NULL, int lineNum=0)
| The new operator is defined for debugging versions of the library only, when the identifier `__WXDEBUG__` is defined.

## Static Public Member Functions
static wxList & | GetHandlers ()
| Returns the file handlers.
static void | AddHandler (wxRichTextFileHandler *handler)
| Adds a file handler to the end.
static void | InsertHandler (wxRichTextFileHandler *handler)
| Inserts a file handler at the front.
static bool | RemoveHandler (const wxString &name)
| Removes a file handler.
static wxRichTextFileHandler * | FindHandler (const wxString &name)
| Finds a file handler by name.
static wxRichTextFileHandler * | FindHandler (const wxString &extension, wxRichTextFileType imageType)
| Finds a file handler by extension and type.
static wxRichTextFileHandler * | FindHandlerFilenameOrType (const wxString &filename, wxRichTextFileType imageType)
| Finds a handler by filename or, if supplied, type.
static wxRichTextFileHandler * | FindHandler (wxRichTextFileType imageType)
| Finds a handler by type.
static wxString | GetExtWildcard (bool combine=false, bool save=false, wxArrayInt *types=NULL)
| Gets a wildcard incorporating all visible handlers.
static void | CleanUpHandlers ()
| Clean up file handlers.
static void | InitStandardHandlers ()
| Initialise the standard file handlers.
static wxList & | GetDrawingHandlers ()
| Returns the drawing handlers.
static void | AddDrawingHandler (wxRichTextDrawingHandler *handler)
| Adds a drawing handler to the end.
static void | InsertDrawingHandler (wxRichTextDrawingHandler *handler)
| Inserts a drawing handler at the front.
static bool | RemoveDrawingHandler (const wxString &name)
| Removes a drawing handler.
static wxRichTextDrawingHandler * | FindDrawingHandler (const wxString &name)
| Finds a drawing handler by name.
static void | CleanUpDrawingHandlers ()
| Clean up drawing handlers.
static wxRichTextFieldTypeHashMap & | GetFieldTypes ()
| Returns the field types.
static void | AddFieldType (wxRichTextFieldType *fieldType)
| Adds a field type.
static bool | RemoveFieldType (const wxString &name)
| Removes a field type by name.
static wxRichTextFieldType * | FindFieldType (const wxString &name)
| Finds a field type by name.
static void | CleanUpFieldTypes ()
| Cleans up field types.
static wxRichTextRenderer * | GetRenderer ()
| Returns the renderer object.
static void | SetRenderer (wxRichTextRenderer *renderer)
| Sets renderer as the object to be used to render certain aspects of the content, such as bullets.
static int | GetBulletRightMargin ()
| Returns the minimum margin between bullet and paragraph in 10ths of a mm.
static void | SetBulletRightMargin (int margin)
| Sets the minimum margin between bullet and paragraph in 10ths of a mm.
static float | GetBulletProportion ()
| Returns the factor to multiply by character height to get a reasonable bullet size.
static void | SetBulletProportion (float prop)
| Sets the factor to multiply by character height to get a reasonable bullet size.
static bool | GetFloatingLayoutMode ()
| Returns the floating layout mode.
static void | SetFloatingLayoutMode (bool mode)
| Sets the floating layout mode.
Static Public Member Functions inherited from wxRichTextObject
static int | ConvertTenthsMMToPixels (int ppi, int units, double scale=1.0)
| Converts units in tenths of a millimetre to device units.
static int | ConvertPixelsToTenthsMM (int ppi, int pixels, double scale=1.0)
| Convert units in pixels to tenths of a millimetre.
static bool | DrawBoxAttributes (wxDC &dc, wxRichTextBuffer *buffer, const wxRichTextAttr &attr, const wxRect &boxRect, int flags=0, wxRichTextObject *obj=NULL)
| Draws the borders and background for the given rectangle and attributes.
static bool | DrawBorder (wxDC &dc, wxRichTextBuffer *buffer, const wxRichTextAttr &attr, const wxTextAttrBorders &borders, const wxRect &rect, int flags=0)
| Draws a border.
static bool | GetBoxRects (wxDC &dc, wxRichTextBuffer *buffer, const wxRichTextAttr &attr, wxRect &marginRect, wxRect &borderRect, wxRect &contentRect, wxRect &paddingRect, wxRect &outlineRect)
| Returns the various rectangles of the box model in pixels.
static bool | GetTotalMargin (wxDC &dc, wxRichTextBuffer *buffer, const wxRichTextAttr &attr, int &leftMargin, int &rightMargin, int &topMargin, int &bottomMargin)
| Returns the total margin for the object in pixels, taking into account margin, padding and border size.
static wxRect | AdjustAvailableSpace (wxDC &dc, wxRichTextBuffer *buffer, const wxRichTextAttr &parentAttr, const wxRichTextAttr &childAttr, const wxRect &availableParentSpace, const wxRect &availableContainerSpace)
| Returns the rectangle which the child has available to it given restrictions specified in the child attribute, e.g.

## Protected Attributes
wxCommandProcessor * | m_commandProcessor
| Command processor.
wxRichTextFontTable | m_fontTable
| Table storing fonts.
bool | m_modified
| Has been modified?
int | m_batchedCommandDepth
| Collapsed command stack.
wxString | m_batchedCommandsName
| Name for collapsed command.
wxRichTextCommand * | m_batchedCommand
| Current collapsed command accumulating actions.
int | m_suppressUndo
| Whether to suppress undo.
wxRichTextStyleSheet * | m_styleSheet
| Style sheet, if any.
wxList | m_eventHandlers
| List of event handlers that will be notified of events.
wxList | m_attributeStack
| Stack of attributes for convenience functions.
int | m_handlerFlags
| Flags to be passed to handlers.
double | m_scale
| Scaling factor in use: needed to calculate correct dimensions when printing.
Protected Attributes inherited from wxRichTextParagraphLayoutBox
wxRichTextCtrl * | m_ctrl
wxRichTextAttr | m_defaultAttributes
wxRichTextRange | m_invalidRange
bool | m_partialParagraph
wxRichTextFloatCollector * | m_floatCollector
Protected Attributes inherited from wxRichTextCompositeObject
wxRichTextObjectList | m_children
Protected Attributes inherited from wxRichTextObject
wxSize | m_size
wxSize | m_maxSize
wxSize | m_minSize
wxPoint | m_pos
int | m_descent
int | m_refCount
bool | m_show
wxRichTextObject * | m_parent
wxRichTextRange | m_range
wxRichTextRange | m_ownRange
wxRichTextAttr | m_attributes
wxRichTextProperties | m_properties
Protected Attributes inherited from wxObject
wxObjectRefData * | m_refData
| Pointer to an object which is the object's reference-counted data.

## Static Protected Attributes
static wxList | sm_handlers
| File handlers.
static wxList | sm_drawingHandlers
| Drawing handlers.
static wxRichTextFieldTypeHashMap | sm_fieldTypes
| Field types.
static wxRichTextRenderer * | sm_renderer
| Renderer.
static int | sm_bulletRightMargin
| Minimum margin between bullet and paragraph in 10ths of a mm.
static float | sm_bulletProportion
| Factor to multiply by character height to get a reasonable bullet size.

## Additional Inherited Members
Protected Member Functions inherited from wxObject
void | AllocExclusive ()
| Ensure that this object's data is not shared with any other object.
virtual wxObjectRefData * | CreateRefData () const
| Creates a new instance of the wxObjectRefData-derived class specific to this object and returns it.
virtual wxObjectRefData * | CloneRefData (const wxObjectRefData *data) const
| Creates a new instance of the wxObjectRefData-derived class specific to this object and initializes it copying data.

## Constructor & Destructor Documentation

## ◆ wxRichTextBuffer() [1/2]

wxRichTextBuffer::wxRichTextBuffer | ( |  | ) |
| inline

Default constructor.

## ◆ wxRichTextBuffer() [2/2]

wxRichTextBuffer::wxRichTextBuffer | ( | const wxRichTextBuffer & | obj | ) |
| inline

Copy constructor.

## ◆ ~wxRichTextBuffer()

virtual wxRichTextBuffer::~wxRichTextBuffer | ( |  | ) |
| virtual

## Member Function Documentation

## ◆ AddDrawingHandler()

void wxRichTextBuffer::AddDrawingHandler | ( | wxRichTextDrawingHandler * | handler | ) |
| static

Adds a drawing handler to the end.

## ◆ AddEventHandler()

bool wxRichTextBuffer::AddEventHandler | ( | wxEvtHandler * | handler | ) |

Adds an event handler.

A buffer associated with a control has the control as the only event handler, but the application is free to add more if further notification is required. All handlers are notified of an event originating from the buffer, such as the replacement of a style sheet during loading.

The buffer never deletes any of the event handlers, unless RemoveEventHandler() is called with true as the second argument.

## ◆ AddFieldType()

void wxRichTextBuffer::AddFieldType | ( | wxRichTextFieldType * | fieldType | ) |
| static

Adds a field type.

See also
  RemoveFieldType(), FindFieldType(), wxRichTextField, wxRichTextFieldType, wxRichTextFieldTypeStandard

## ◆ AddHandler()

void wxRichTextBuffer::AddHandler | ( | wxRichTextFileHandler * | handler | ) |
| static

Adds a file handler to the end.

## ◆ AddParagraph()

virtual wxRichTextRange wxRichTextBuffer::AddParagraph | ( | const wxString & | text,
|  | wxRichTextAttr * | paraStyle = NULL )
| inlinevirtual

Convenience function to add a paragraph of text.

Reimplemented from wxRichTextParagraphLayoutBox.

## ◆ BatchingUndo()

virtual bool wxRichTextBuffer::BatchingUndo | ( |  | ) | const
| inlinevirtual

Returns true if we are collapsing commands.

## ◆ BeginAlignment()

bool wxRichTextBuffer::BeginAlignment | ( | wxTextAttrAlignment | alignment | ) |

Begins using alignment.

## ◆ BeginBatchUndo()

virtual bool wxRichTextBuffer::BeginBatchUndo | ( | const wxString & | cmdName | ) |
| virtual

Begin collapsing undo/redo commands.

Note that this may not work properly if combining commands that delete or insert content, changing ranges for subsequent actions.

cmdName should be the name of the combined command that will appear next to Undo and Redo in the edit menu.

## ◆ BeginBold()

bool wxRichTextBuffer::BeginBold | ( |  | ) |

Begins using bold.

## ◆ BeginCharacterStyle()

bool wxRichTextBuffer::BeginCharacterStyle | ( | const wxString & | characterStyle | ) |

Begins named character style.

## ◆ BeginFont()

bool wxRichTextBuffer::BeginFont | ( | const wxFont & | font | ) |

Begins using this font.

## ◆ BeginFontSize()

bool wxRichTextBuffer::BeginFontSize | ( | int | pointSize | ) |

Begins using point size.

## ◆ BeginItalic()

bool wxRichTextBuffer::BeginItalic | ( |  | ) |

Begins using italic.

## ◆ BeginLeftIndent()

bool wxRichTextBuffer::BeginLeftIndent | ( | int | leftIndent,
|  | int | leftSubIndent = 0 )

Begins using leftIndent for the left indent, and optionally leftSubIndent for the sub-indent.

Both are expressed in tenths of a millimetre.

The sub-indent is an offset from the left of the paragraph, and is used for all but the first line in a paragraph. A positive value will cause the first line to appear to the left of the subsequent lines, and a negative value will cause the first line to be indented relative to the subsequent lines.

## ◆ BeginLineSpacing()

bool wxRichTextBuffer::BeginLineSpacing | ( | int | lineSpacing | ) |

Begins line spacing using the specified value.

spacing is a multiple, where 10 means single-spacing, 15 means 1.5 spacing, and 20 means double spacing.

The wxTextAttrLineSpacing enumeration values are defined for convenience.

## ◆ BeginListStyle()

bool wxRichTextBuffer::BeginListStyle | ( | const wxString & | listStyle,
|  | int | level = 1,
|  | int | number = 1 )

Begins named list style.

Optionally, you can also pass a level and a number.

## ◆ BeginNumberedBullet()

bool wxRichTextBuffer::BeginNumberedBullet | ( | int | bulletNumber,
|  | int | leftIndent,
|  | int | leftSubIndent,
|  | int | bulletStyle = wxTEXT_ATTR_BULLET_STYLE_ARABIC|wxTEXT_ATTR_BULLET_STYLE_PERIOD )

Begins numbered bullet.

This call will be needed for each item in the list, and the application should take care of incrementing the numbering.

bulletNumber is a number, usually starting with 1. leftIndent and leftSubIndent are values in tenths of a millimetre. bulletStyle is a bitlist of the following values:

wxRichTextBuffer uses indentation to render a bulleted item. The left indent is the distance between the margin and the bullet. The content of the paragraph, including the first line, starts at leftMargin + leftSubIndent. So the distance between the left edge of the bullet and the left of the actual paragraph is leftSubIndent.

## ◆ BeginParagraphSpacing()

bool wxRichTextBuffer::BeginParagraphSpacing | ( | int | before,
|  | int | after )

Begins paragraph spacing; pass the before-paragraph and after-paragraph spacing in tenths of a millimetre.

## ◆ BeginParagraphStyle()

bool wxRichTextBuffer::BeginParagraphStyle | ( | const wxString & | paragraphStyle | ) |

Begins named paragraph style.

## ◆ BeginRightIndent()

bool wxRichTextBuffer::BeginRightIndent | ( | int | rightIndent | ) |

Begins a right indent, specified in tenths of a millimetre.

## ◆ BeginStandardBullet()

bool wxRichTextBuffer::BeginStandardBullet | ( | const wxString & | bulletName,
|  | int | leftIndent,
|  | int | leftSubIndent,
|  | int | bulletStyle = wxTEXT_ATTR_BULLET_STYLE_STANDARD )

Begins applying a standard bullet, using one of the standard bullet names (currently `standard/circle` or `standard/square`.

See BeginNumberedBullet() for an explanation of how indentation is used to render the bulleted paragraph.

## ◆ BeginStyle()

virtual bool wxRichTextBuffer::BeginStyle | ( | const wxRichTextAttr & | style | ) |
| virtual

Begin using a style.

## ◆ BeginSuppressUndo()

virtual bool wxRichTextBuffer::BeginSuppressUndo | ( |  | ) |
| virtual

Begin suppressing undo/redo commands.

The way undo is suppressed may be implemented differently by each command. If not dealt with by a command implementation, then it will be implemented automatically by not storing the command in the undo history when the action is submitted to the command processor.

## ◆ BeginSymbolBullet()

bool wxRichTextBuffer::BeginSymbolBullet | ( | const wxString & | symbol,
|  | int | leftIndent,
|  | int | leftSubIndent,
|  | int | bulletStyle = wxTEXT_ATTR_BULLET_STYLE_SYMBOL )

Begins applying a symbol bullet, using a character from the current font.

See BeginNumberedBullet() for an explanation of how indentation is used to render the bulleted paragraph.

## ◆ BeginTextColour()

bool wxRichTextBuffer::BeginTextColour | ( | const wxColour & | colour | ) |

Begins using this colour.

## ◆ BeginUnderline()

bool wxRichTextBuffer::BeginUnderline | ( |  | ) |

Begins using underline.

## ◆ BeginURL()

bool wxRichTextBuffer::BeginURL | ( | const wxString & | url,
|  | const wxString & | characterStyle = wxEmptyString )

Begins applying wxTEXT_ATTR_URL to the content.

Pass a URL and optionally, a character style to apply, since it is common to mark a URL with a familiar style such as blue text with underlining.

## ◆ CanPasteFromClipboard()

virtual bool wxRichTextBuffer::CanPasteFromClipboard | ( |  | ) | const
| virtual

Returns true if we can paste from the clipboard.

## ◆ CleanUpDrawingHandlers()

void wxRichTextBuffer::CleanUpDrawingHandlers | ( |  | ) |
| static

Clean up drawing handlers.

## ◆ CleanUpFieldTypes()

void wxRichTextBuffer::CleanUpFieldTypes | ( |  | ) |
| static

Cleans up field types.

## ◆ CleanUpHandlers()

void wxRichTextBuffer::CleanUpHandlers | ( |  | ) |
| static

Clean up file handlers.

## ◆ ClearEventHandlers()

void wxRichTextBuffer::ClearEventHandlers | ( |  | ) |

Clear event handlers.

## ◆ ClearStyleStack()

virtual void wxRichTextBuffer::ClearStyleStack | ( |  | ) |
| virtual

Clears the style stack.

## ◆ Clone()

virtual wxRichTextObject * wxRichTextBuffer::Clone | ( |  | ) | const
| inlinevirtual

Clones the buffer.

Reimplemented from wxRichTextParagraphLayoutBox.

## ◆ Copy()

void wxRichTextBuffer::Copy | ( | const wxRichTextBuffer & | obj | ) |

Copies the buffer.

## ◆ CopyToClipboard()

virtual bool wxRichTextBuffer::CopyToClipboard | ( | const wxRichTextRange & | range | ) |
| virtual

Copy the range to the clipboard.

## ◆ DeleteRangeWithUndo()

bool wxRichTextBuffer::DeleteRangeWithUndo | ( | const wxRichTextRange & | range,
|  | wxRichTextCtrl * | ctrl )

Submits a command to delete this range.

## ◆ Dump() [1/2]

virtual void wxRichTextBuffer::Dump | ( |  | ) |
| virtual

Dumps contents of buffer for debugging purposes.

## ◆ Dump() [2/2]

virtual void wxRichTextBuffer::Dump | ( | wxTextOutputStream & | stream | ) |
| inlinevirtual

Dump object data to the given output stream for debugging.

Reimplemented from wxRichTextCompositeObject.

## ◆ EndAlignment()

bool wxRichTextBuffer::EndAlignment | ( |  | ) |
| inline

Ends alignment.

## ◆ EndAllStyles()

virtual bool wxRichTextBuffer::EndAllStyles | ( |  | ) |
| virtual

End all styles.

## ◆ EndBatchUndo()

virtual bool wxRichTextBuffer::EndBatchUndo | ( |  | ) |
| virtual

End collapsing undo/redo commands.

## ◆ EndBold()

bool wxRichTextBuffer::EndBold | ( |  | ) |
| inline

Ends using bold.

## ◆ EndCharacterStyle()

bool wxRichTextBuffer::EndCharacterStyle | ( |  | ) |
| inline

Ends named character style.

## ◆ EndFont()

bool wxRichTextBuffer::EndFont | ( |  | ) |
| inline

Ends using a font.

## ◆ EndFontSize()

bool wxRichTextBuffer::EndFontSize | ( |  | ) |
| inline

Ends using point size.

## ◆ EndItalic()

bool wxRichTextBuffer::EndItalic | ( |  | ) |
| inline

Ends using italic.

## ◆ EndLeftIndent()

bool wxRichTextBuffer::EndLeftIndent | ( |  | ) |
| inline

Ends left indent.

## ◆ EndLineSpacing()

bool wxRichTextBuffer::EndLineSpacing | ( |  | ) |
| inline

Ends line spacing.

## ◆ EndListStyle()

bool wxRichTextBuffer::EndListStyle | ( |  | ) |
| inline

Ends named character style.

## ◆ EndNumberedBullet()

bool wxRichTextBuffer::EndNumberedBullet | ( |  | ) |
| inline

Ends numbered bullet.

## ◆ EndParagraphSpacing()

bool wxRichTextBuffer::EndParagraphSpacing | ( |  | ) |
| inline

Ends paragraph spacing.

## ◆ EndParagraphStyle()

bool wxRichTextBuffer::EndParagraphStyle | ( |  | ) |
| inline

Ends named character style.

## ◆ EndRightIndent()

bool wxRichTextBuffer::EndRightIndent | ( |  | ) |
| inline

Ends right indent.

## ◆ EndStandardBullet()

bool wxRichTextBuffer::EndStandardBullet | ( |  | ) |
| inline

Ends standard bullet.

## ◆ EndStyle()

virtual bool wxRichTextBuffer::EndStyle | ( |  | ) |
| virtual

End the style.

## ◆ EndSuppressUndo()

virtual bool wxRichTextBuffer::EndSuppressUndo | ( |  | ) |
| virtual

End suppressing undo/redo commands.

## ◆ EndSymbolBullet()

bool wxRichTextBuffer::EndSymbolBullet | ( |  | ) |
| inline

Ends symbol bullet.

## ◆ EndTextColour()

bool wxRichTextBuffer::EndTextColour | ( |  | ) |
| inline

Ends using a colour.

## ◆ EndUnderline()

bool wxRichTextBuffer::EndUnderline | ( |  | ) |
| inline

Ends using underline.

## ◆ EndURL()

bool wxRichTextBuffer::EndURL | ( |  | ) |
| inline

Ends URL.

## ◆ FindDrawingHandler()

wxRichTextDrawingHandler * wxRichTextBuffer::FindDrawingHandler | ( | const wxString & | name | ) |
| static

Finds a drawing handler by name.

## ◆ FindFieldType()

wxRichTextFieldType * wxRichTextBuffer::FindFieldType | ( | const wxString & | name | ) |
| static

Finds a field type by name.

See also
  RemoveFieldType(), AddFieldType(), wxRichTextField, wxRichTextFieldType, wxRichTextFieldTypeStandard

## ◆ FindHandler() [1/3]

wxRichTextFileHandler * wxRichTextBuffer::FindHandler | ( | const wxString & | extension,
|  | wxRichTextFileType | imageType )
| static

Finds a file handler by extension and type.

## ◆ FindHandler() [2/3]

wxRichTextFileHandler * wxRichTextBuffer::FindHandler | ( | const wxString & | name | ) |
| static

Finds a file handler by name.

## ◆ FindHandler() [3/3]

wxRichTextFileHandler * wxRichTextBuffer::FindHandler | ( | wxRichTextFileType | imageType | ) |
| static

Finds a handler by type.

## ◆ FindHandlerFilenameOrType()

wxRichTextFileHandler * wxRichTextBuffer::FindHandlerFilenameOrType | ( | const wxString & | filename,
|  | wxRichTextFileType | imageType )
| static

Finds a handler by filename or, if supplied, type.

## ◆ GetBatchedCommand()

virtual wxRichTextCommand * wxRichTextBuffer::GetBatchedCommand | ( |  | ) | const
| inlinevirtual

Returns the collapsed command.

## ◆ GetBulletProportion()

float wxRichTextBuffer::GetBulletProportion | ( |  | ) |
| inlinestatic

Returns the factor to multiply by character height to get a reasonable bullet size.

## ◆ GetBulletRightMargin()

int wxRichTextBuffer::GetBulletRightMargin | ( |  | ) |
| inlinestatic

Returns the minimum margin between bullet and paragraph in 10ths of a mm.

## ◆ GetCommandProcessor()

wxCommandProcessor * wxRichTextBuffer::GetCommandProcessor | ( |  | ) | const
| inline

Returns the command processor.

A text buffer always creates its own command processor when it is initialized.

## ◆ GetDimensionScale()

double wxRichTextBuffer::GetDimensionScale | ( |  | ) | const
| inline

Returns the scale factor for displaying certain dimensions such as indentation and inter-paragraph spacing.

## ◆ GetDrawingHandlers()

wxList & wxRichTextBuffer::GetDrawingHandlers | ( |  | ) |
| inlinestatic

Returns the drawing handlers.

## ◆ GetExtWildcard()

wxString wxRichTextBuffer::GetExtWildcard | ( | bool | combine = false,
|  | bool | save = false,
|  | wxArrayInt * | types = NULL )
| static

Gets a wildcard incorporating all visible handlers.

If types is present, it will be filled with the file type corresponding to each filter. This can be used to determine the type to pass to LoadFile given a selected filter.

## ◆ GetFieldTypes()

wxRichTextFieldTypeHashMap & wxRichTextBuffer::GetFieldTypes | ( |  | ) |
| inlinestatic

Returns the field types.

## ◆ GetFloatingLayoutMode()

bool wxRichTextBuffer::GetFloatingLayoutMode | ( |  | ) |
| static

Returns the floating layout mode.

The default is true, where objects are laid out according to their floating status.

## ◆ GetFontScale()

double wxRichTextBuffer::GetFontScale | ( |  | ) | const
| inline

Returns the scale factor for displaying fonts, for example for more comfortable editing.

## ◆ GetFontTable() [1/2]

wxRichTextFontTable & wxRichTextBuffer::GetFontTable | ( |  | ) |
| inline

Returns the table storing fonts, for quick access and font reuse.

## ◆ GetFontTable() [2/2]

const wxRichTextFontTable & wxRichTextBuffer::GetFontTable | ( |  | ) | const
| inline

Returns the table storing fonts, for quick access and font reuse.

## ◆ GetHandlerFlags()

int wxRichTextBuffer::GetHandlerFlags | ( |  | ) | const
| inline

Gets the handler flags, controlling loading and saving.

## ◆ GetHandlers()

wxList & wxRichTextBuffer::GetHandlers | ( |  | ) |
| inlinestatic

Returns the file handlers.

## ◆ GetRenderer()

wxRichTextRenderer * wxRichTextBuffer::GetRenderer | ( |  | ) |
| inlinestatic

Returns the renderer object.

## ◆ GetScale()

double wxRichTextBuffer::GetScale | ( |  | ) | const
| inline

Returns the scale factor for calculating dimensions.

## ◆ GetStyleSheet()

virtual wxRichTextStyleSheet * wxRichTextBuffer::GetStyleSheet | ( |  | ) | const
| inlinevirtual

Returns the style sheet.

Reimplemented from wxRichTextParagraphLayoutBox.

## ◆ GetStyleStackSize()

virtual size_t wxRichTextBuffer::GetStyleStackSize | ( |  | ) | const
| inlinevirtual

Returns the size of the style stack, for example to check correct nesting.

## ◆ HitTest()

virtual int wxRichTextBuffer::HitTest | ( | wxDC & | dc,
|  | wxRichTextDrawingContext & | context,
|  | const wxPoint & | pt,
|  | long & | textPosition,
|  | wxRichTextObject ** | obj,
|  | wxRichTextObject ** | contextObj,
|  | int | flags = 0 )
| virtual

Hit-testing: returns a flag indicating hit test details, plus information about position.

contextObj is returned to specify what object position is relevant to, since otherwise there's an ambiguity. @ obj might not be a child of contextObj, since we may be referring to the container itself if we have no hit on a child - for example if we click outside an object.

The function puts the position in textPosition if one is found. pt is in logical units (a zero y position is at the beginning of the buffer).

Returns
  One of the wxRichTextHitTestFlags values.

Reimplemented from wxRichTextParagraphLayoutBox.

## ◆ Init()

void wxRichTextBuffer::Init | ( |  | ) |

Initialisation.

## ◆ InitStandardHandlers()

void wxRichTextBuffer::InitStandardHandlers | ( |  | ) |
| static

Initialise the standard file handlers.

Currently, only the plain text loading/saving handler is initialised by default.

## ◆ InsertDrawingHandler()

void wxRichTextBuffer::InsertDrawingHandler | ( | wxRichTextDrawingHandler * | handler | ) |
| static

Inserts a drawing handler at the front.

## ◆ InsertHandler()

void wxRichTextBuffer::InsertHandler | ( | wxRichTextFileHandler * | handler | ) |
| static

Inserts a file handler at the front.

## ◆ InsertImageWithUndo()

bool wxRichTextBuffer::InsertImageWithUndo | ( | long | pos,
|  | const wxRichTextImageBlock & | imageBlock,
|  | wxRichTextCtrl * | ctrl,
|  | int | flags = 0,
|  | const wxRichTextAttr & | textAttr = wxRichTextAttr() )

Submits a command to insert the given image.

## ◆ InsertNewlineWithUndo()

bool wxRichTextBuffer::InsertNewlineWithUndo | ( | long | pos,
|  | wxRichTextCtrl * | ctrl,
|  | int | flags = 0 )

Submits a command to insert a newline.

## ◆ InsertObjectWithUndo()

wxRichTextObject * wxRichTextBuffer::InsertObjectWithUndo | ( | long | pos,
|  | wxRichTextObject * | object,
|  | wxRichTextCtrl * | ctrl,
|  | int | flags )

Submits a command to insert an object.

## ◆ InsertParagraphsWithUndo()

bool wxRichTextBuffer::InsertParagraphsWithUndo | ( | long | pos,
|  | const wxRichTextParagraphLayoutBox & | paragraphs,
|  | wxRichTextCtrl * | ctrl,
|  | int | flags = 0 )

Submits a command to insert paragraphs.

## ◆ InsertTextWithUndo()

bool wxRichTextBuffer::InsertTextWithUndo | ( | long | pos,
|  | const wxString & | text,
|  | wxRichTextCtrl * | ctrl,
|  | int | flags = 0 )

Submits a command to insert the given text.

## ◆ IsModified()

bool wxRichTextBuffer::IsModified | ( |  | ) | const
| inline

Returns true if the buffer was modified.

## ◆ LoadFile() [1/2]

virtual bool wxRichTextBuffer::LoadFile | ( | const wxString & | filename,
|  | wxRichTextFileType | type = wxRICHTEXT_TYPE_ANY )
| virtual

Loads content from a stream or file.

Not all handlers will implement file loading.

## ◆ LoadFile() [2/2]

virtual bool wxRichTextBuffer::LoadFile | ( | wxInputStream & | stream,
|  | wxRichTextFileType | type = wxRICHTEXT_TYPE_ANY )
| virtual

## ◆ Modify()

void wxRichTextBuffer::Modify | ( | bool | modify = true | ) |
| inline

Mark modified.

## ◆ operator=()

void wxRichTextBuffer::operator= | ( | const wxRichTextBuffer & | obj | ) |
| inline

Assignment operator.

## ◆ PasteFromClipboard()

virtual bool wxRichTextBuffer::PasteFromClipboard | ( | long | position | ) |
| virtual

Paste the clipboard content to the buffer.

## ◆ PopStyleSheet()

wxRichTextStyleSheet * wxRichTextBuffer::PopStyleSheet | ( |  | ) |

Pops the style sheet from the top of the style sheet stack.

## ◆ PushStyleSheet()

bool wxRichTextBuffer::PushStyleSheet | ( | wxRichTextStyleSheet * | styleSheet | ) |

Pushes the style sheet to the top of the style sheet stack.

## ◆ RemoveDrawingHandler()

bool wxRichTextBuffer::RemoveDrawingHandler | ( | const wxString & | name | ) |
| static

Removes a drawing handler.

## ◆ RemoveEventHandler()

bool wxRichTextBuffer::RemoveEventHandler | ( | wxEvtHandler * | handler,
|  | bool | deleteHandler = false )

Removes an event handler from the buffer's list of handlers, deleting the object if deleteHandler is true.

## ◆ RemoveFieldType()

bool wxRichTextBuffer::RemoveFieldType | ( | const wxString & | name | ) |
| static

Removes a field type by name.

See also
  AddFieldType(), FindFieldType(), wxRichTextField, wxRichTextFieldType, wxRichTextFieldTypeStandard

## ◆ RemoveHandler()

bool wxRichTextBuffer::RemoveHandler | ( | const wxString & | name | ) |
| static

Removes a file handler.

## ◆ ResetAndClearCommands()

virtual void wxRichTextBuffer::ResetAndClearCommands | ( |  | ) |
| virtual

Clears the buffer, adds an empty paragraph, and clears the command processor.

## ◆ SaveFile() [1/2]

virtual bool wxRichTextBuffer::SaveFile | ( | const wxString & | filename,
|  | wxRichTextFileType | type = wxRICHTEXT_TYPE_ANY )
| virtual

Saves content to a stream or file.

Not all handlers will implement file saving.

## ◆ SaveFile() [2/2]

virtual bool wxRichTextBuffer::SaveFile | ( | wxOutputStream & | stream,
|  | wxRichTextFileType | type = wxRICHTEXT_TYPE_ANY )
| virtual

## ◆ SendEvent()

bool wxRichTextBuffer::SendEvent | ( | wxEvent & | event,
|  | bool | sendToAll = true )

Send event to event handlers.

If sendToAll is true, will send to all event handlers, otherwise will stop at the first successful one.

## ◆ SetBulletProportion()

void wxRichTextBuffer::SetBulletProportion | ( | float | prop | ) |
| inlinestatic

Sets the factor to multiply by character height to get a reasonable bullet size.

## ◆ SetBulletRightMargin()

void wxRichTextBuffer::SetBulletRightMargin | ( | int | margin | ) |
| inlinestatic

Sets the minimum margin between bullet and paragraph in 10ths of a mm.

## ◆ SetDimensionScale()

void wxRichTextBuffer::SetDimensionScale | ( | double | dimScale | ) |

Sets the scale factor for displaying certain dimensions such as indentation and inter-paragraph spacing.

This can be useful when editing in a small control where you still want legible text, but a minimum of wasted white space.

## ◆ SetFloatingLayoutMode()

void wxRichTextBuffer::SetFloatingLayoutMode | ( | bool | mode | ) |
| static

Sets the floating layout mode.

Pass false to speed up editing by not performing floating layout. This setting affects all buffers.

## ◆ SetFontScale()

void wxRichTextBuffer::SetFontScale | ( | double | fontScale | ) |

Sets the scale factor for displaying fonts, for example for more comfortable editing.

## ◆ SetFontTable()

void wxRichTextBuffer::SetFontTable | ( | const wxRichTextFontTable & | table | ) |
| inline

Sets table storing fonts, for quick access and font reuse.

## ◆ SetHandlerFlags()

void wxRichTextBuffer::SetHandlerFlags | ( | int | flags | ) |
| inline

Sets the handler flags, controlling loading and saving.

## ◆ SetRenderer()

void wxRichTextBuffer::SetRenderer | ( | wxRichTextRenderer * | renderer | ) |
| static

Sets renderer as the object to be used to render certain aspects of the content, such as bullets.

You can override default rendering by deriving a new class from wxRichTextRenderer or wxRichTextStdRenderer, overriding one or more virtual functions, and setting an instance of the class using this function.

## ◆ SetScale()

void wxRichTextBuffer::SetScale | ( | double | scale | ) |
| inline

Sets the scale factor for calculating dimensions.

## ◆ SetStyleSheet()

void wxRichTextBuffer::SetStyleSheet | ( | wxRichTextStyleSheet * | styleSheet | ) |
| inline

Sets style sheet, if any.

This will allow the application to use named character and paragraph styles found in the style sheet.

Neither the buffer nor the control owns the style sheet so must be deleted by the application.

## ◆ SetStyleSheetAndNotify()

bool wxRichTextBuffer::SetStyleSheetAndNotify | ( | wxRichTextStyleSheet * | sheet | ) |

Sets the style sheet and sends a notification of the change.

## ◆ SubmitAction()

virtual bool wxRichTextBuffer::SubmitAction | ( | wxRichTextAction * | action | ) |
| virtual

Submit the action immediately, or delay according to whether collapsing is on.

## ◆ SuppressingUndo()

virtual bool wxRichTextBuffer::SuppressingUndo | ( |  | ) | const
| inlinevirtual

Are we suppressing undo?

?

## Member Data Documentation

## ◆ m_attributeStack

wxList wxRichTextBuffer::m_attributeStack
| protected

Stack of attributes for convenience functions.

## ◆ m_batchedCommand

wxRichTextCommand* wxRichTextBuffer::m_batchedCommand
| protected

Current collapsed command accumulating actions.

## ◆ m_batchedCommandDepth

int wxRichTextBuffer::m_batchedCommandDepth
| protected

Collapsed command stack.

## ◆ m_batchedCommandsName

wxString wxRichTextBuffer::m_batchedCommandsName
| protected

Name for collapsed command.

## ◆ m_commandProcessor

wxCommandProcessor* wxRichTextBuffer::m_commandProcessor
| protected

Command processor.

## ◆ m_eventHandlers

wxList wxRichTextBuffer::m_eventHandlers
| protected

List of event handlers that will be notified of events.

## ◆ m_fontTable

wxRichTextFontTable wxRichTextBuffer::m_fontTable
| protected

Table storing fonts.

## ◆ m_handlerFlags

int wxRichTextBuffer::m_handlerFlags
| protected

Flags to be passed to handlers.

## ◆ m_modified

bool wxRichTextBuffer::m_modified
| protected

Has been modified?

## ◆ m_scale

double wxRichTextBuffer::m_scale
| protected

Scaling factor in use: needed to calculate correct dimensions when printing.

## ◆ m_styleSheet

wxRichTextStyleSheet* wxRichTextBuffer::m_styleSheet
| protected

Style sheet, if any.

## ◆ m_suppressUndo

int wxRichTextBuffer::m_suppressUndo
| protected

Whether to suppress undo.

## ◆ sm_bulletProportion

float wxRichTextBuffer::sm_bulletProportion
| staticprotected

Factor to multiply by character height to get a reasonable bullet size.

## ◆ sm_bulletRightMargin

int wxRichTextBuffer::sm_bulletRightMargin
| staticprotected

Minimum margin between bullet and paragraph in 10ths of a mm.

## ◆ sm_drawingHandlers

wxList wxRichTextBuffer::sm_drawingHandlers
| staticprotected

Drawing handlers.

## ◆ sm_fieldTypes

wxRichTextFieldTypeHashMap wxRichTextBuffer::sm_fieldTypes
| staticprotected

Field types.

## ◆ sm_handlers

wxList wxRichTextBuffer::sm_handlers
| staticprotected

File handlers.

## ◆ sm_renderer

wxRichTextRenderer* wxRichTextBuffer::sm_renderer
| staticprotected

Renderer.