| Version: 3.3.1

Public Member Functions | Protected Attributes | List of all members
wxRichTextParagraphLayoutBox Class Reference
Class List by Category » Rich Text

`#include <wx/richtext/richtextbuffer.h>`

Inheritance diagram for wxRichTextParagraphLayoutBox:
[legend]

## Detailed Description

This class knows how to lay out paragraphs.

##

Library: wxRichText
Category: Rich Text

See also
  wxRichTextCompositeObject, wxRichTextObject, wxRichTextBuffer, wxRichTextCtrl

## Public Member Functions
| wxRichTextParagraphLayoutBox (wxRichTextObject *parent=nullptr)
| wxRichTextParagraphLayoutBox (const wxRichTextParagraphLayoutBox &obj)
| ~wxRichTextParagraphLayoutBox ()
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. More...
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. More...
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. More...
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=nullptr) const
| Returns the object size for the given range. More...
virtual bool | DeleteRange (const wxRichTextRange &range)
| Deletes the given range. More...
virtual wxString | GetTextForRange (const wxRichTextRange &range) const
| Returns any text in this object for the given range. More...
virtual bool | ImportFromXML (wxRichTextBuffer *buffer, wxXmlNode *node, wxRichTextXMLHandler *handler, bool *recurse)
| Imports this object from XML. More...
virtual wxString | GetXMLNodeName () const
| Returns the XML node name of this object. More...
virtual bool | AcceptsFocus () const
| Returns true if objects of this class can accept the focus, i.e. a call to SetFocusObject is possible. More...
void | SetRichTextCtrl (wxRichTextCtrl *ctrl)
| Associates a control with the buffer, for operations that for example require refreshing the window. More...
wxRichTextCtrl * | GetRichTextCtrl () const
| Returns the associated control. More...
void | SetPartialParagraph (bool partialPara)
| Sets a flag indicating whether the last paragraph is partial or complete. More...
bool | GetPartialParagraph () const
| Returns a flag indicating whether the last paragraph is partial or complete. More...
virtual wxRichTextStyleSheet * | GetStyleSheet () const
| Returns the style sheet associated with the overall buffer. More...
virtual bool | IsTopLevel () const
| Returns true if this object is top-level, i.e. contains its own paragraphs, such as a text box. More...
bool | InsertParagraphsWithUndo (wxRichTextBuffer *buffer, long pos, const wxRichTextParagraphLayoutBox &paragraphs, wxRichTextCtrl *ctrl, int flags=0)
| Submits a command to insert paragraphs. More...
bool | InsertTextWithUndo (wxRichTextBuffer *buffer, long pos, const wxString &text, wxRichTextCtrl *ctrl, int flags=0)
| Submits a command to insert the given text. More...
bool | InsertNewlineWithUndo (wxRichTextBuffer *buffer, long pos, wxRichTextCtrl *ctrl, int flags=0)
| Submits a command to insert the given text. More...
bool | InsertImageWithUndo (wxRichTextBuffer *buffer, long pos, const wxRichTextImageBlock &imageBlock, wxRichTextCtrl *ctrl, int flags, const wxRichTextAttr &textAttr)
| Submits a command to insert the given image. More...
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. More...
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. More...
wxRichTextObject * | InsertObjectWithUndo (wxRichTextBuffer *buffer, long pos, wxRichTextObject *object, wxRichTextCtrl *ctrl, int flags=0)
| Inserts an object. More...
bool | DeleteRangeWithUndo (const wxRichTextRange &range, wxRichTextCtrl *ctrl, wxRichTextBuffer *buffer)
| Submits a command to delete this range. More...
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. More...
void | MoveAnchoredObjectToParagraph (wxRichTextParagraph *from, wxRichTextParagraph *to, wxRichTextObject *obj)
| Moves an anchored object to another paragraph. More...
void | Init ()
| Initializes the object. More...
virtual void | Clear ()
| Clears all the children. More...
virtual void | Reset ()
| Clears and initializes with one blank paragraph. More...
virtual wxRichTextRange | AddParagraph (const wxString &text, wxRichTextAttr *paraStyle=nullptr)
| Convenience function to add a paragraph of text. More...
virtual wxRichTextRange | AddImage (const wxImage &image, wxRichTextAttr *paraStyle=nullptr)
| Convenience function to add an image. More...
virtual wxRichTextRange | AddParagraphs (const wxString &text, wxRichTextAttr *paraStyle=nullptr)
| Adds multiple paragraphs, based on newlines. More...
virtual wxRichTextLine * | GetLineAtPosition (long pos, bool caretPosition=false) const
| Returns the line at the given position. More...
virtual wxRichTextLine * | GetLineAtYPosition (int y) const
| Returns the line at the given y pixel position, or the last line. More...
virtual wxRichTextParagraph * | GetParagraphAtPosition (long pos, bool caretPosition=false) const
| Returns the paragraph at the given character or caret position. More...
virtual wxSize | GetLineSizeAtPosition (long pos, bool caretPosition=false) const
| Returns the line size at the given position. More...
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. More...
virtual wxRichTextLine * | GetLineForVisibleLineNumber (long lineNumber) const
| Given a line number, returns the corresponding wxRichTextLine object. More...
virtual wxRichTextObject * | GetLeafObjectAtPosition (long position) const
| Returns the leaf object in a paragraph at this position. More...
virtual wxRichTextParagraph * | GetParagraphAtLine (long paragraphNumber) const
| Returns the paragraph by number. More...
virtual wxRichTextParagraph * | GetParagraphForLine (wxRichTextLine *line) const
| Returns the paragraph for a given line. More...
virtual int | GetParagraphLength (long paragraphNumber) const
| Returns the length of the paragraph. More...
virtual int | GetParagraphCount () const
| Returns the number of paragraphs. More...
virtual int | GetLineCount () const
| Returns the number of visible lines. More...
virtual wxString | GetParagraphText (long paragraphNumber) const
| Returns the text of the paragraph. More...
virtual long | XYToPosition (long x, long y) const
| Converts zero-based line column and paragraph number to a position. More...
virtual bool | PositionToXY (long pos, long *x, long *y) const
| Converts a zero-based position to line column and paragraph number. More...
virtual bool | SetStyle (const wxRichTextRange &range, const wxRichTextAttr &style, int flags=wxRICHTEXT_SETSTYLE_WITH_UNDO)
| Sets the attributes for the given range. More...
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. More...
virtual bool | GetStyle (long position, wxRichTextAttr &style)
| Returns the combined text attributes for this position. More...
virtual bool | GetUncombinedStyle (long position, wxRichTextAttr &style)
| Returns the content (uncombined) attributes for this position. More...
virtual bool | DoGetStyle (long position, wxRichTextAttr &style, bool combineStyles=true)
| Implementation helper for GetStyle. More...
virtual bool | GetStyleForRange (const wxRichTextRange &range, wxRichTextAttr &style)
| This function gets a style representing the common, combined attributes in the given range. More...
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. More...
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. More...
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. More...
virtual bool | NumberList (const wxRichTextRange &range, wxRichTextListStyleDefinition *def=nullptr, int flags=wxRICHTEXT_SETSTYLE_WITH_UNDO, int startFrom=1, int specifiedLevel=-1)
| Numbers the paragraphs in the given range. More...
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=nullptr, int flags=wxRICHTEXT_SETSTYLE_WITH_UNDO, int specifiedLevel=-1)
| Promotes the list items within the given range. More...
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 nullptr/empty to indicate that the existing list style should be used. More...
virtual bool | FindNextParagraphNumber (wxRichTextParagraph *previousParagraph, wxRichTextAttr &attr) const
| Fills in the attributes for numbering a paragraph after previousParagraph. More...
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. More...
virtual bool | SetObjectPropertiesWithUndo (wxRichTextObject &obj, const wxRichTextProperties &properties, wxRichTextObject *objToSet=nullptr)
| Sets with undo the properties for the given object. More...
virtual bool | HasCharacterAttributes (const wxRichTextRange &range, const wxRichTextAttr &style) const
| Test if this whole range has character attributes of the specified kind. More...
virtual bool | HasParagraphAttributes (const wxRichTextRange &range, const wxRichTextAttr &style) const
| Test if this whole range has paragraph attributes of the specified kind. More...
virtual wxRichTextObject * | Clone () const
| Clones the object. More...
virtual void | PrepareContent (wxRichTextParagraphLayoutBox &container)
| Prepares the content just before insertion (or after buffer reset). More...
virtual bool | InsertFragment (long position, wxRichTextParagraphLayoutBox &fragment)
| Insert fragment into this box at the given position. More...
virtual bool | CopyFragment (const wxRichTextRange &range, wxRichTextParagraphLayoutBox &fragment)
| Make a copy of the fragment corresponding to the given range, putting it in fragment. More...
virtual bool | ApplyStyleSheet (wxRichTextStyleSheet *styleSheet)
| Apply the style sheet to the buffer, for example if the styles have changed. More...
void | Copy (const wxRichTextParagraphLayoutBox &obj)
void | operator= (const wxRichTextParagraphLayoutBox &obj)
virtual void | UpdateRanges ()
| Calculate ranges. More...
virtual wxString | GetText () const
| Get all the text. More...
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). More...
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). More...
virtual void | SetBasicStyle (const wxRichTextAttr &style)
| Sets the basic (overall) style. More...
virtual const wxRichTextAttr & | GetBasicStyle () const
| Returns the basic (overall) style. More...
virtual void | Invalidate (const wxRichTextRange &invalidRange=wxRICHTEXT_ALL)
| Invalidates the buffer. More...
virtual void | DoInvalidate (const wxRichTextRange &invalidRange)
| Do the (in)validation for this object only. More...
virtual void | InvalidateHierarchy (const wxRichTextRange &invalidRange=wxRICHTEXT_ALL)
| Do the (in)validation both up and down the hierarchy. More...
virtual bool | UpdateFloatingObjects (const wxRect &availableRect, wxRichTextObject *untilObj=nullptr)
| Gather information about floating objects. More...
wxRichTextRange | GetInvalidRange (bool wholeParagraphs=false) const
| Get invalid range, rounding to entire paragraphs if argument is true. More...
bool | IsDirty () const
| Returns true if this object needs layout. More...
wxRichTextFloatCollector * | GetFloatCollector ()
| Returns the wxRichTextFloatCollector of this object. More...
int | GetFloatingObjectCount () const
| Returns the number of floating objects at this level. More...
bool | GetFloatingObjects (wxRichTextObjectList &objects) const
| Returns a list of floating objects. More...
Public Member Functions inherited from wxRichTextCompositeObject
| wxRichTextCompositeObject (wxRichTextObject *parent=nullptr)
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. More...
virtual void | CalculateRange (long start, long &end)
| Calculates the range of the object. More...
virtual void | Dump (wxTextOutputStream &stream)
| Dump object data to the given output stream for debugging. More...
wxRichTextObjectList & | GetChildren ()
| Returns the children. More...
const wxRichTextObjectList & | GetChildren () const
| Returns the children. More...
size_t | GetChildCount () const
| Returns the number of children. More...
wxRichTextObject * | GetChild (size_t n) const
| Returns the nth child. More...
virtual bool | IsComposite () const
| Returns true if this object is composite. More...
virtual bool | IsAtomic () const
| Returns true if no user editing can be done inside the object. More...
virtual bool | IsEmpty () const
| Returns true if the buffer is empty. More...
virtual wxRichTextObject * | GetChildAtPosition (long pos) const
| Returns the child object at the given character position. More...
void | Copy (const wxRichTextCompositeObject &obj)
void | operator= (const wxRichTextCompositeObject &obj)
size_t | AppendChild (wxRichTextObject *child)
| Appends a child, returning the position. More...
bool | InsertChild (wxRichTextObject *child, wxRichTextObject *inFrontOf)
| Inserts the child in front of the given object, or at the beginning. More...
bool | RemoveChild (wxRichTextObject *child, bool deleteChild=false)
| Removes and optionally deletes the specified child. More...
bool | DeleteChildren ()
| Deletes all the children. More...
bool | Defragment (wxRichTextDrawingContext &context, const wxRichTextRange &range=wxRICHTEXT_ALL)
| Recursively merges all pieces that can be merged. More...
virtual void | Move (const wxPoint &pt)
| Moves the object recursively, by adding the offset from old to new. More...
Public Member Functions inherited from wxRichTextObject
| wxRichTextObject (wxRichTextObject *parent=nullptr)
| Constructor, taking an optional parent pointer. More...
virtual | ~wxRichTextObject ()
virtual wxSize | GetBestSize () const
| Returns the best size, i.e. the ideal starting size for this object irrespective of available space. More...
virtual wxRichTextObject * | DoSplit (long pos)
| Do a split from pos, returning an object containing the second part, and setting the first part in 'this'. More...
virtual bool | IsFloatable () const
| Returns true if this class of object is floatable. More...
virtual bool | IsFloating () const
| Returns true if this object is currently floating. More...
virtual int | GetFloatDirection () const
| Returns the floating direction. More...
virtual bool | CanMerge (wxRichTextObject *object, wxRichTextDrawingContext &context) const
| Returns true if this object can merge itself with the given one. More...
virtual bool | Merge (wxRichTextObject *object, wxRichTextDrawingContext &context)
| Returns true if this object merged itself with the given one. More...
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. More...
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. More...
virtual bool | CanEditProperties () const
| Returns true if we can edit the object's properties via a GUI. More...
virtual bool | EditProperties (wxWindow *parent, wxRichTextBuffer *buffer)
| Edits the object's properties via a GUI. More...
virtual wxString | GetPropertiesMenuLabel () const
| Returns the label to be used for the properties context menu item. More...
virtual bool | UsesParagraphAttributes () const
| Returns true if this object takes note of paragraph attributes (text and image objects don't). More...
virtual bool | HandlesChildSelections () const
| Returns true if this object can handle the selections of its children, fOr example a table. More...
virtual wxRichTextSelection | GetSelection (long start, long end) const
| Returns a selection object specifying the selections between start and end character positions. More...
virtual wxSize | GetCachedSize () const
| Gets the cached object size as calculated by Layout. More...
virtual void | SetCachedSize (const wxSize &sz)
| Sets the cached object size as calculated by Layout. More...
virtual wxSize | GetMaxSize () const
| Gets the maximum object size as calculated by Layout. More...
virtual void | SetMaxSize (const wxSize &sz)
| Sets the maximum object size as calculated by Layout. More...
virtual wxSize | GetMinSize () const
| Gets the minimum object size as calculated by Layout. More...
virtual void | SetMinSize (const wxSize &sz)
| Sets the minimum object size as calculated by Layout. More...
virtual wxTextAttrSize | GetNaturalSize () const
| Gets the 'natural' size for an object. More...
virtual wxPoint | GetPosition () const
| Returns the object position in pixels. More...
virtual void | SetPosition (const wxPoint &pos)
| Sets the object position in pixels. More...
virtual wxPoint | GetAbsolutePosition () const
| Returns the absolute object position, by traversing up the child/parent hierarchy. More...
virtual wxRect | GetRect () const
| Returns the rectangle enclosing the object. More...
void | SetRange (const wxRichTextRange &range)
| Sets the object's range within its container. More...
const wxRichTextRange & | GetRange () const
| Returns the object's range. More...
wxRichTextRange & | GetRange ()
| Returns the object's range. More...
void | SetOwnRange (const wxRichTextRange &range)
| Set the object's own range, for a top-level object with its own position space. More...
const wxRichTextRange & | GetOwnRange () const
| Returns the object's own range (valid if top-level). More...
wxRichTextRange & | GetOwnRange ()
| Returns the object's own range (valid if top-level). More...
wxRichTextRange | GetOwnRangeIfTopLevel () const
| Returns the object's own range only if a top-level object. More...
virtual wxRichTextObject * | GetParent () const
| Returns a pointer to the parent object. More...
virtual void | SetParent (wxRichTextObject *parent)
| Sets the pointer to the parent object. More...
virtual wxRichTextParagraphLayoutBox * | GetContainer () const
| Returns the top-level container of this object. More...
virtual wxRichTextParagraphLayoutBox * | GetParentContainer () const
| Returns the top-level container of this object. More...
virtual void | SetMargins (int margin)
| Set the margin around the object, in pixels. More...
virtual void | SetMargins (int leftMargin, int rightMargin, int topMargin, int bottomMargin)
| Set the margin around the object, in pixels. More...
virtual int | GetLeftMargin () const
| Returns the left margin of the object, in pixels. More...
virtual int | GetRightMargin () const
| Returns the right margin of the object, in pixels. More...
virtual int | GetTopMargin () const
| Returns the top margin of the object, in pixels. More...
virtual int | GetBottomMargin () const
| Returns the bottom margin of the object, in pixels. More...
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. More...
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. More...
virtual bool | AdjustAttributes (wxRichTextAttr &attr, wxRichTextDrawingContext &context)
| Adjusts the attributes for virtual attribute provision, collapsed borders, etc. More...
void | SetAttributes (const wxRichTextAttr &attr)
| Sets the object's attributes. More...
const wxRichTextAttr & | GetAttributes () const
| Returns the object's attributes. More...
wxRichTextAttr & | GetAttributes ()
| Returns the object's attributes. More...
wxRichTextProperties & | GetProperties ()
| Returns the object's properties. More...
const wxRichTextProperties & | GetProperties () const
| Returns the object's properties. More...
void | SetProperties (const wxRichTextProperties &props)
| Sets the object's properties. More...
void | SetDescent (int descent)
| Sets the stored descent value. More...
int | GetDescent () const
| Returns the stored descent value. More...
wxRichTextBuffer * | GetBuffer () const
| Returns the containing buffer. More...
void | SetName (const wxString &name)
| Sets the identifying name for this object as a property using the "name" key. More...
wxString | GetName () const
| Returns the identifying name for this object from the properties, using the "name" key. More...
bool | IsShown () const
| Returns true if the object will be shown, false otherwise. More...
virtual void | Show (bool show)
| Call to show or hide this object. More...
void | Copy (const wxRichTextObject &obj)
| Copies the object. More...
void | Reference ()
| Reference-counting allows us to use the same object in multiple lists (not yet used). More...
void | Dereference ()
| Reference-counting allows us to use the same object in multiple lists (not yet used). More...
int | ConvertTenthsMMToPixels (wxDC &dc, int units) const
| Converts units in tenths of a millimetre to device units. More...
int | ConvertPixelsToTenthsMM (wxDC &dc, int pixels) const
| Convert units in pixels to tenths of a millimetre. More...
Public Member Functions inherited from wxObject
| wxObject ()
| Default ctor; initializes to nullptr the internal reference data. More...
| wxObject (const wxObject &other)
| Copy ctor. More...
virtual | ~wxObject ()
| Destructor. More...
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). More...
wxObjectRefData * | GetRefData () const
| Returns the wxObject::m_refData pointer, i.e. the data referenced by this object. More...
bool | IsKindOf (const wxClassInfo *info) const
| Determines whether this class is a subclass of (or the same class as) the given class. More...
bool | IsSameAs (const wxObject &obj) const
| Returns true if this object has the same data pointer as obj. More...
void | Ref (const wxObject &clone)
| Makes this object refer to the data in clone. More...
void | SetRefData (wxObjectRefData *data)
| Sets the wxObject::m_refData pointer. More...
void | UnRef ()
| Decrements the reference count in the associated data, and if it is zero, deletes the data. More...
void | UnShare ()
| This is the same of AllocExclusive() but this method is public. More...
void | operator delete (void *buf)
| The delete operator is defined for debugging versions of the library only, when the identifier `__WXDEBUG__` is defined. More...
void * | operator new (size_t size, const wxString &filename=nullptr, int lineNum=0)
| The new operator is defined for debugging versions of the library only, when the identifier `__WXDEBUG__` is defined. More...

## Protected Attributes
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. More...

## Additional Inherited Members
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. More...
static int | ConvertPixelsToTenthsMM (int ppi, int pixels, double scale=1.0)
| Convert units in pixels to tenths of a millimetre. More...
static bool | DrawBoxAttributes (wxDC &dc, wxRichTextBuffer *buffer, const wxRichTextAttr &attr, const wxRect &boxRect, int flags=0, wxRichTextObject *obj=nullptr)
| Draws the borders and background for the given rectangle and attributes. More...
static bool | DrawBorder (wxDC &dc, wxRichTextBuffer *buffer, const wxRichTextAttr &attr, const wxTextAttrBorders &borders, const wxRect &rect, int flags=0)
| Draws a border. More...
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. More...
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. More...
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. More...
Protected Member Functions inherited from wxObject
void | AllocExclusive ()
| Ensure that this object's data is not shared with any other object. More...
virtual wxObjectRefData * | CreateRefData () const
| Creates a new instance of the wxObjectRefData-derived class specific to this object and returns it. More...
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. More...

## Constructor & Destructor Documentation

## ◆ wxRichTextParagraphLayoutBox() [1/2]

wxRichTextParagraphLayoutBox::wxRichTextParagraphLayoutBox | ( | wxRichTextObject * | parent = `nullptr` | ) |

## ◆ wxRichTextParagraphLayoutBox() [2/2]

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

## ◆ ~wxRichTextParagraphLayoutBox()

wxRichTextParagraphLayoutBox::~wxRichTextParagraphLayoutBox | ( |  | ) |

## Member Function Documentation

## ◆ AcceptsFocus()

virtual bool wxRichTextParagraphLayoutBox::AcceptsFocus | ( |  | ) | const
| inline virtual

Returns true if objects of this class can accept the focus, i.e. a call to SetFocusObject is possible.

For example, containers supporting text, such as a text box object, can accept the focus, but a table can't (set the focus to individual cells instead).

Reimplemented from wxRichTextObject.

Reimplemented in wxRichTextTable, and wxRichTextField.

## ◆ AddImage()

virtual wxRichTextRange wxRichTextParagraphLayoutBox::AddImage | ( | const wxImage & | image,
|  | wxRichTextAttr * | paraStyle = `nullptr`
| ) |  |
| virtual

Convenience function to add an image.

## ◆ AddParagraph()

virtual wxRichTextRange wxRichTextParagraphLayoutBox::AddParagraph | ( | const wxString & | text,
|  | wxRichTextAttr * | paraStyle = `nullptr`
| ) |  |
| virtual

Convenience function to add a paragraph of text.

Reimplemented in wxRichTextBuffer.

## ◆ AddParagraphs()

virtual wxRichTextRange wxRichTextParagraphLayoutBox::AddParagraphs | ( | const wxString & | text,
|  | wxRichTextAttr * | paraStyle = `nullptr`
| ) |  |
| virtual

Adds multiple paragraphs, based on newlines.

## ◆ ApplyStyleSheet()

virtual bool wxRichTextParagraphLayoutBox::ApplyStyleSheet | ( | wxRichTextStyleSheet * | styleSheet | ) |
| virtual

Apply the style sheet to the buffer, for example if the styles have changed.

## ◆ Clear()

virtual void wxRichTextParagraphLayoutBox::Clear | ( |  | ) |
| virtual

Clears all the children.

## ◆ ClearListStyle()

virtual bool wxRichTextParagraphLayoutBox::ClearListStyle | ( | const wxRichTextRange & | range,
|  | int | flags = `wxRICHTEXT_SETSTYLE_WITH_UNDO`
| ) |  |
| virtual

Clears the list style from the given range, clearing list-related attributes and applying any named paragraph style associated with each paragraph.

flags is a bit list of the following:

- wxRICHTEXT_SETSTYLE_WITH_UNDO: specifies that this command will be undoable.

See also
  SetListStyle(), PromoteList(), NumberList()

## ◆ Clone()

virtual wxRichTextObject* wxRichTextParagraphLayoutBox::Clone | ( |  | ) | const
| inline virtual

Clones the object.

Reimplemented from wxRichTextObject.

Reimplemented in wxRichTextTable, wxRichTextCell, wxRichTextBuffer, wxRichTextField, and wxRichTextBox.

## ◆ CollectStyle()

bool wxRichTextParagraphLayoutBox::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.

## ◆ Copy()

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

## ◆ CopyFragment()

virtual bool wxRichTextParagraphLayoutBox::CopyFragment | ( | const wxRichTextRange & | range,
|  | wxRichTextParagraphLayoutBox & | fragment
| ) |  |
| virtual

Make a copy of the fragment corresponding to the given range, putting it in fragment.

## ◆ DeleteRange()

virtual bool wxRichTextParagraphLayoutBox::DeleteRange | ( | const wxRichTextRange & | range | ) |
| virtual

Deletes the given range.

Reimplemented from wxRichTextCompositeObject.

Reimplemented in wxRichTextTable.

## ◆ DeleteRangeWithUndo()

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

Submits a command to delete this range.

## ◆ DoGetStyle()

virtual bool wxRichTextParagraphLayoutBox::DoGetStyle | ( | long | position,
|  | wxRichTextAttr & | style,
|  | bool | combineStyles = `true`
| ) |  |
| virtual

Implementation helper for GetStyle.

If combineStyles is true, combine base, paragraph and context attributes.

## ◆ DoInvalidate()

virtual void wxRichTextParagraphLayoutBox::DoInvalidate | ( | const wxRichTextRange & | invalidRange | ) |
| virtual

Do the (in)validation for this object only.

## ◆ DoNumberList()

virtual bool wxRichTextParagraphLayoutBox::DoNumberList | ( | const wxRichTextRange & | range,
|  | const wxRichTextRange & | promotionRange,
|  | int | promoteBy,
|  | wxRichTextListStyleDefinition * | def,
|  | int | flags = `wxRICHTEXT_SETSTYLE_WITH_UNDO`,
|  | int | startFrom = `1`,
|  | int | specifiedLevel = `-1`
| ) |  |
| virtual

Helper for NumberList and PromoteList, that does renumbering and promotion simultaneously def can be nullptr/empty to indicate that the existing list style should be used.

## ◆ Draw()

virtual bool wxRichTextParagraphLayoutBox::Draw | ( | wxDC & | dc,
|  | wxRichTextDrawingContext & | context,
|  | const wxRichTextRange & | range,
|  | const wxRichTextSelection & | selection,
|  | const wxRect & | rect,
|  | int | descent,
|  | int | style
| ) |  |
| virtual

Draw the item, within the given range.

Some objects may ignore the range (for example paragraphs) while others must obey it (lines, to implement wrapping)

Implements wxRichTextObject.

Reimplemented in wxRichTextTable, wxRichTextCell, wxRichTextField, and wxRichTextBox.

## ◆ DrawFloats()

void wxRichTextParagraphLayoutBox::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.

## ◆ FindNextParagraphNumber()

virtual bool wxRichTextParagraphLayoutBox::FindNextParagraphNumber | ( | wxRichTextParagraph * | previousParagraph,
|  | wxRichTextAttr & | attr
| ) |  | const
| virtual

Fills in the attributes for numbering a paragraph after previousParagraph.

## ◆ GetBasicStyle()

virtual const wxRichTextAttr& wxRichTextParagraphLayoutBox::GetBasicStyle | ( |  | ) | const
| inline virtual

Returns the basic (overall) style.

This is the style of the whole buffer before further styles are applied, unlike the default style, which only affects the style currently being applied (for example, setting the default style to bold will cause subsequently inserted text to be bold).

## ◆ GetDefaultStyle()

virtual const wxRichTextAttr& wxRichTextParagraphLayoutBox::GetDefaultStyle | ( |  | ) | const
| inline virtual

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).

## ◆ GetFloatCollector()

wxRichTextFloatCollector* wxRichTextParagraphLayoutBox::GetFloatCollector | ( |  | ) |
| inline

Returns the wxRichTextFloatCollector of this object.

## ◆ GetFloatingObjectCount()

int wxRichTextParagraphLayoutBox::GetFloatingObjectCount | ( |  | ) | const

Returns the number of floating objects at this level.

## ◆ GetFloatingObjects()

bool wxRichTextParagraphLayoutBox::GetFloatingObjects | ( | wxRichTextObjectList & | objects | ) | const

Returns a list of floating objects.

## ◆ GetInvalidRange()

wxRichTextRange wxRichTextParagraphLayoutBox::GetInvalidRange | ( | bool | wholeParagraphs = `false` | ) | const

Get invalid range, rounding to entire paragraphs if argument is true.

## ◆ GetLeafObjectAtPosition()

virtual wxRichTextObject* wxRichTextParagraphLayoutBox::GetLeafObjectAtPosition | ( | long | position | ) | const
| virtual

Returns the leaf object in a paragraph at this position.

## ◆ GetLineAtPosition()

virtual wxRichTextLine* wxRichTextParagraphLayoutBox::GetLineAtPosition | ( | long | pos,
|  | bool | caretPosition = `false`
| ) |  | const
| virtual

Returns the line at the given position.

If caretPosition is true, the position is a caret position, which is normally a smaller number.

## ◆ GetLineAtYPosition()

virtual wxRichTextLine* wxRichTextParagraphLayoutBox::GetLineAtYPosition | ( | int | y | ) | const
| virtual

Returns the line at the given y pixel position, or the last line.

## ◆ GetLineCount()

virtual int wxRichTextParagraphLayoutBox::GetLineCount | ( |  | ) | const
| virtual

Returns the number of visible lines.

## ◆ GetLineForVisibleLineNumber()

virtual wxRichTextLine* wxRichTextParagraphLayoutBox::GetLineForVisibleLineNumber | ( | long | lineNumber | ) | const
| virtual

Given a line number, returns the corresponding wxRichTextLine object.

## ◆ GetLineSizeAtPosition()

virtual wxSize wxRichTextParagraphLayoutBox::GetLineSizeAtPosition | ( | long | pos,
|  | bool | caretPosition = `false`
| ) |  | const
| virtual

Returns the line size at the given position.

## ◆ GetParagraphAtLine()

virtual wxRichTextParagraph* wxRichTextParagraphLayoutBox::GetParagraphAtLine | ( | long | paragraphNumber | ) | const
| virtual

Returns the paragraph by number.

## ◆ GetParagraphAtPosition()

virtual wxRichTextParagraph* wxRichTextParagraphLayoutBox::GetParagraphAtPosition | ( | long | pos,
|  | bool | caretPosition = `false`
| ) |  | const
| virtual

Returns the paragraph at the given character or caret position.

## ◆ GetParagraphCount()

virtual int wxRichTextParagraphLayoutBox::GetParagraphCount | ( |  | ) | const
| inline virtual

Returns the number of paragraphs.

## ◆ GetParagraphForLine()

virtual wxRichTextParagraph* wxRichTextParagraphLayoutBox::GetParagraphForLine | ( | wxRichTextLine * | line | ) | const
| virtual

Returns the paragraph for a given line.

## ◆ GetParagraphLength()

virtual int wxRichTextParagraphLayoutBox::GetParagraphLength | ( | long | paragraphNumber | ) | const
| virtual

Returns the length of the paragraph.

## ◆ GetParagraphText()

virtual wxString wxRichTextParagraphLayoutBox::GetParagraphText | ( | long | paragraphNumber | ) | const
| virtual

Returns the text of the paragraph.

## ◆ GetPartialParagraph()

bool wxRichTextParagraphLayoutBox::GetPartialParagraph | ( |  | ) | const
| inline

Returns a flag indicating whether the last paragraph is partial or complete.

## ◆ GetRangeSize()

virtual bool wxRichTextParagraphLayoutBox::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 = `nullptr`
| ) |  | const
| virtual

Returns the object size for the given range.

Returns false if the range is invalid for this object.

Reimplemented from wxRichTextCompositeObject.

Reimplemented in wxRichTextTable, and wxRichTextField.

## ◆ GetRichTextCtrl()

wxRichTextCtrl* wxRichTextParagraphLayoutBox::GetRichTextCtrl | ( |  | ) | const
| inline

Returns the associated control.

## ◆ GetStyle()

virtual bool wxRichTextParagraphLayoutBox::GetStyle | ( | long | position,
|  | wxRichTextAttr & | style
| ) |  |
| virtual

Returns the combined text attributes for this position.

This function gets the uncombined style - that is, the attributes associated with the paragraph or character content, and not necessarily the combined attributes you see on the screen. To get the combined attributes, use GetStyle(). If you specify (any) paragraph attribute in style's flags, this function will fetch the paragraph attributes. Otherwise, it will return the character attributes.

## ◆ GetStyleForNewParagraph()

wxRichTextAttr wxRichTextParagraphLayoutBox::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.

If the previous paragraph has a paragraph style name, looks up the next-paragraph style.

## ◆ GetStyleForRange()

virtual bool wxRichTextParagraphLayoutBox::GetStyleForRange | ( | const wxRichTextRange & | range,
|  | wxRichTextAttr & | style
| ) |  |
| virtual

This function gets a style representing the common, combined attributes in the given range.

Attributes which have different values within the specified range will not be included the style flags.

The function is used to get the attributes to display in the formatting dialog: the user can edit the attributes common to the selection, and optionally specify the values of further attributes to be applied uniformly.

To apply the edited attributes, you can use SetStyle() specifying the wxRICHTEXT_SETSTYLE_OPTIMIZE flag, which will only apply attributes that are different from the combined attributes within the range. So, the user edits the effective, displayed attributes for the range, but his choice won't be applied unnecessarily to content. As an example, say the style for a paragraph specifies bold, but the paragraph text doesn't specify a weight. The combined style is bold, and this is what the user will see on-screen and in the formatting dialog. The user now specifies red text, in addition to bold. When applying with SetStyle(), the content font weight attributes won't be changed to bold because this is already specified by the paragraph. However the text colour attributes will be changed to show red.

## ◆ GetStyleSheet()

virtual wxRichTextStyleSheet* wxRichTextParagraphLayoutBox::GetStyleSheet | ( |  | ) | const
| virtual

Returns the style sheet associated with the overall buffer.

Reimplemented in wxRichTextBuffer.

## ◆ GetText()

virtual wxString wxRichTextParagraphLayoutBox::GetText | ( |  | ) | const
| virtual

Get all the text.

## ◆ GetTextForRange()

virtual wxString wxRichTextParagraphLayoutBox::GetTextForRange | ( | const wxRichTextRange & | range | ) | const
| virtual

Returns any text in this object for the given range.

Reimplemented from wxRichTextCompositeObject.

Reimplemented in wxRichTextTable.

## ◆ GetUncombinedStyle()

virtual bool wxRichTextParagraphLayoutBox::GetUncombinedStyle | ( | long | position,
|  | wxRichTextAttr & | style
| ) |  |
| virtual

Returns the content (uncombined) attributes for this position.

## ◆ GetVisibleLineNumber()

virtual long wxRichTextParagraphLayoutBox::GetVisibleLineNumber | ( | long | pos,
|  | bool | caretPosition = `false`,
|  | bool | startOfLine = `false`
| ) |  | const
| virtual

Given a position, returns the number of the visible line (potentially many to a paragraph), starting from zero at the start of the buffer.

We also have to pass a bool (startOfLine) that indicates whether the caret is being shown at the end of the previous line or at the start of the next, since the caret can be shown at two visible positions for the same underlying position.

## ◆ GetXMLNodeName()

virtual wxString wxRichTextParagraphLayoutBox::GetXMLNodeName | ( |  | ) | const
| inline virtual

Returns the XML node name of this object.

This must be overridden for wxXmlNode-base XML export to work.

Reimplemented from wxRichTextObject.

Reimplemented in wxRichTextTable, wxRichTextCell, wxRichTextField, and wxRichTextBox.

## ◆ HasCharacterAttributes()

virtual bool wxRichTextParagraphLayoutBox::HasCharacterAttributes | ( | const wxRichTextRange & | range,
|  | const wxRichTextAttr & | style
| ) |  | const
| virtual

Test if this whole range has character attributes of the specified kind.

If any of the attributes are different within the range, the test fails. You can use this to implement, for example, bold button updating. style must have flags indicating which attributes are of interest.

## ◆ HasParagraphAttributes()

virtual bool wxRichTextParagraphLayoutBox::HasParagraphAttributes | ( | const wxRichTextRange & | range,
|  | const wxRichTextAttr & | style
| ) |  | const
| virtual

Test if this whole range has paragraph attributes of the specified kind.

If any of the attributes are different within the range, the test fails. You can use this to implement, for example, centering button updating. style must have flags indicating which attributes are of interest.

## ◆ HitTest()

virtual int wxRichTextParagraphLayoutBox::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 wxRichTextCompositeObject.

Reimplemented in wxRichTextTable, wxRichTextCell, and wxRichTextBuffer.

## ◆ ImportFromXML()

virtual bool wxRichTextParagraphLayoutBox::ImportFromXML | ( | wxRichTextBuffer * | buffer,
|  | wxXmlNode * | node,
|  | wxRichTextXMLHandler * | handler,
|  | bool * | recurse
| ) |  |
| virtual

Imports this object from XML.

Reimplemented from wxRichTextObject.

Reimplemented in wxRichTextTable.

## ◆ Init()

void wxRichTextParagraphLayoutBox::Init | ( |  | ) |

Initializes the object.

## ◆ InsertFieldWithUndo()

wxRichTextField* wxRichTextParagraphLayoutBox::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.

Field data can be included in properties.

See also
  wxRichTextField, wxRichTextFieldType, wxRichTextFieldTypeStandard

## ◆ InsertFragment()

virtual bool wxRichTextParagraphLayoutBox::InsertFragment | ( | long | position,
|  | wxRichTextParagraphLayoutBox & | fragment
| ) |  |
| virtual

Insert fragment into this box at the given position.

If partialParagraph is true, it is assumed that the last (or only) paragraph is just a piece of data with no paragraph marker.

## ◆ InsertImageWithUndo()

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

Submits a command to insert the given image.

## ◆ InsertNewlineWithUndo()

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

Submits a command to insert the given text.

## ◆ InsertObjectWithUndo()

wxRichTextObject* wxRichTextParagraphLayoutBox::InsertObjectWithUndo | ( | wxRichTextBuffer * | buffer,
|  | long | pos,
|  | wxRichTextObject * | object,
|  | wxRichTextCtrl * | ctrl,
|  | int | flags = `0`
| ) |  |

Inserts an object.

## ◆ InsertParagraphsWithUndo()

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

Submits a command to insert paragraphs.

## ◆ InsertTextWithUndo()

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

Submits a command to insert the given text.

## ◆ Invalidate()

virtual void wxRichTextParagraphLayoutBox::Invalidate | ( | const wxRichTextRange & | invalidRange = `wxRICHTEXT_ALL` | ) |
| virtual

Invalidates the buffer.

With no argument, invalidates whole buffer.

Reimplemented from wxRichTextCompositeObject.

## ◆ InvalidateHierarchy()

virtual void wxRichTextParagraphLayoutBox::InvalidateHierarchy | ( | const wxRichTextRange & | invalidRange = `wxRICHTEXT_ALL` | ) |
| virtual

Do the (in)validation both up and down the hierarchy.

## ◆ IsDirty()

bool wxRichTextParagraphLayoutBox::IsDirty | ( |  | ) | const
| inline

Returns true if this object needs layout.

## ◆ IsTopLevel()

virtual bool wxRichTextParagraphLayoutBox::IsTopLevel | ( |  | ) | const
| inline virtual

Returns true if this object is top-level, i.e. contains its own paragraphs, such as a text box.

Reimplemented from wxRichTextObject.

Reimplemented in wxRichTextField.

## ◆ Layout()

virtual bool wxRichTextParagraphLayoutBox::Layout | ( | wxDC & | dc,
|  | wxRichTextDrawingContext & | context,
|  | const wxRect & | rect,
|  | const wxRect & | parentRect,
|  | int | style
| ) |  |
| virtual

Lay the item out at the specified position with the given size constraint.

Layout must set the cached size. rect is the available space for the object, and parentRect is the container that is used to determine a relative size or position (for example if a text box must be 50% of the parent text box).

Implements wxRichTextObject.

Reimplemented in wxRichTextTable, and wxRichTextField.

## ◆ MoveAnchoredObjectToParagraph()

void wxRichTextParagraphLayoutBox::MoveAnchoredObjectToParagraph | ( | wxRichTextParagraph * | from,
|  | wxRichTextParagraph * | to,
|  | wxRichTextObject * | obj
| ) |  |

Moves an anchored object to another paragraph.

## ◆ NumberList() [1/2]

virtual bool wxRichTextParagraphLayoutBox::NumberList | ( | const wxRichTextRange & | range,
|  | const wxString & | defName,
|  | int | flags = `wxRICHTEXT_SETSTYLE_WITH_UNDO`,
|  | int | startFrom = `1`,
|  | int | specifiedLevel = `-1`
| ) |  |
| virtual

## ◆ NumberList() [2/2]

virtual bool wxRichTextParagraphLayoutBox::NumberList | ( | const wxRichTextRange & | range,
|  | wxRichTextListStyleDefinition * | def = `nullptr`,
|  | int | flags = `wxRICHTEXT_SETSTYLE_WITH_UNDO`,
|  | int | startFrom = `1`,
|  | int | specifiedLevel = `-1`
| ) |  |
| virtual

Numbers the paragraphs in the given range.

Pass flags to determine how the attributes are set. Either the style definition or the name of the style definition (in the current sheet) can be passed.

flags is a bit list of the following:

- wxRICHTEXT_SETSTYLE_WITH_UNDO: specifies that this command will be undoable.
- wxRICHTEXT_SETSTYLE_RENUMBER: specifies that numbering should start from startFrom, otherwise existing attributes are used.
- wxRICHTEXT_SETSTYLE_SPECIFY_LEVEL: specifies that listLevel should be used as the level for all paragraphs, otherwise the current indentation will be used.

def can be nullptr to indicate that the existing list style should be used.

See also
  SetListStyle(), PromoteList(), ClearListStyle()

## ◆ operator=()

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

## ◆ PositionToXY()

virtual bool wxRichTextParagraphLayoutBox::PositionToXY | ( | long | pos,
|  | long * | x,
|  | long * | y
| ) |  | const
| virtual

Converts a zero-based position to line column and paragraph number.

## ◆ PrepareContent()

virtual void wxRichTextParagraphLayoutBox::PrepareContent | ( | wxRichTextParagraphLayoutBox & | container | ) |
| virtual

Prepares the content just before insertion (or after buffer reset).

Currently is only called if undo mode is on.

## ◆ PromoteList() [1/2]

virtual bool wxRichTextParagraphLayoutBox::PromoteList | ( | int | promoteBy,
|  | const wxRichTextRange & | range,
|  | const wxString & | defName,
|  | int | flags = `wxRICHTEXT_SETSTYLE_WITH_UNDO`,
|  | int | specifiedLevel = `-1`
| ) |  |
| virtual

## ◆ PromoteList() [2/2]

virtual bool wxRichTextParagraphLayoutBox::PromoteList | ( | int | promoteBy,
|  | const wxRichTextRange & | range,
|  | wxRichTextListStyleDefinition * | def = `nullptr`,
|  | int | flags = `wxRICHTEXT_SETSTYLE_WITH_UNDO`,
|  | int | specifiedLevel = `-1`
| ) |  |
| virtual

Promotes the list items within the given range.

A positive promoteBy produces a smaller indent, and a negative number produces a larger indent. Pass flags to determine how the attributes are set. Either the style definition or the name of the style definition (in the current sheet) can be passed.

flags is a bit list of the following:

- wxRICHTEXT_SETSTYLE_WITH_UNDO: specifies that this command will be undoable.
- wxRICHTEXT_SETSTYLE_RENUMBER: specifies that numbering should start from startFrom, otherwise existing attributes are used.
- wxRICHTEXT_SETSTYLE_SPECIFY_LEVEL: specifies that listLevel should be used as the level for all paragraphs, otherwise the current indentation will be used.

See also
  SetListStyle(), SetListStyle(), ClearListStyle()

## ◆ Reset()

virtual void wxRichTextParagraphLayoutBox::Reset | ( |  | ) |
| virtual

Clears and initializes with one blank paragraph.

## ◆ SetBasicStyle()

virtual void wxRichTextParagraphLayoutBox::SetBasicStyle | ( | const wxRichTextAttr & | style | ) |
| inline virtual

Sets the basic (overall) style.

This is the style of the whole buffer before further styles are applied, unlike the default style, which only affects the style currently being applied (for example, setting the default style to bold will cause subsequently inserted text to be bold).

## ◆ SetDefaultStyle()

virtual bool wxRichTextParagraphLayoutBox::SetDefaultStyle | ( | const wxRichTextAttr & | style | ) |
| virtual

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).

This is not cumulative - setting the default style will replace the previous default style.

Setting it to a default attribute object makes new content take on the 'basic' style.

## ◆ SetListStyle() [1/2]

virtual bool wxRichTextParagraphLayoutBox::SetListStyle | ( | const wxRichTextRange & | range,
|  | const wxString & | defName,
|  | int | flags = `wxRICHTEXT_SETSTYLE_WITH_UNDO`,
|  | int | startFrom = `1`,
|  | int | specifiedLevel = `-1`
| ) |  |
| virtual

## ◆ SetListStyle() [2/2]

virtual bool wxRichTextParagraphLayoutBox::SetListStyle | ( | const wxRichTextRange & | range,
|  | wxRichTextListStyleDefinition * | def,
|  | int | flags = `wxRICHTEXT_SETSTYLE_WITH_UNDO`,
|  | int | startFrom = `1`,
|  | int | specifiedLevel = `-1`
| ) |  |
| virtual

Sets the list attributes for the given range, passing flags to determine how the attributes are set.

Either the style definition or the name of the style definition (in the current sheet) can be passed.

flags is a bit list of the following:

- wxRICHTEXT_SETSTYLE_WITH_UNDO: specifies that this command will be undoable.
- wxRICHTEXT_SETSTYLE_RENUMBER: specifies that numbering should start from startFrom, otherwise existing attributes are used.
- wxRICHTEXT_SETSTYLE_SPECIFY_LEVEL: specifies that listLevel should be used as the level for all paragraphs, otherwise the current indentation will be used.

See also
  NumberList(), PromoteList(), ClearListStyle().

## ◆ SetObjectPropertiesWithUndo()

virtual bool wxRichTextParagraphLayoutBox::SetObjectPropertiesWithUndo | ( | wxRichTextObject & | obj,
|  | const wxRichTextProperties & | properties,
|  | wxRichTextObject * | objToSet = `nullptr`
| ) |  |
| virtual

Sets with undo the properties for the given object.

## ◆ SetPartialParagraph()

void wxRichTextParagraphLayoutBox::SetPartialParagraph | ( | bool | partialPara | ) |
| inline

Sets a flag indicating whether the last paragraph is partial or complete.

## ◆ SetProperties()

virtual bool wxRichTextParagraphLayoutBox::SetProperties | ( | const wxRichTextRange & | range,
|  | const wxRichTextProperties & | properties,
|  | int | flags = `wxRICHTEXT_SETPROPERTIES_WITH_UNDO`
| ) |  |
| virtual

Sets the properties for the given range, passing flags to determine how the attributes are set.

You can merge properties or replace them.

The end point of range is specified as the last character position of the span of text, plus one. So, for example, to set the properties for a character at position 5, use the range (5,6).

flags may contain a bit list of the following values:

- wxRICHTEXT_SETPROPERTIES_NONE: no flag.
- wxRICHTEXT_SETPROPERTIES_WITH_UNDO: specifies that this operation should be undoable.
- wxRICHTEXT_SETPROPERTIES_PARAGRAPHS_ONLY: specifies that the properties should only be applied to paragraphs, and not the content.
- wxRICHTEXT_SETPROPERTIES_CHARACTERS_ONLY: specifies that the properties should only be applied to characters, and not the paragraph.
- wxRICHTEXT_SETPROPERTIES_RESET: resets (clears) the existing properties before applying the new properties.
- wxRICHTEXT_SETPROPERTIES_REMOVE: removes the specified properties.

## ◆ SetRichTextCtrl()

void wxRichTextParagraphLayoutBox::SetRichTextCtrl | ( | wxRichTextCtrl * | ctrl | ) |
| inline

Associates a control with the buffer, for operations that for example require refreshing the window.

## ◆ SetStyle() [1/2]

virtual bool wxRichTextParagraphLayoutBox::SetStyle | ( | const wxRichTextRange & | range,
|  | const wxRichTextAttr & | style,
|  | int | flags = `wxRICHTEXT_SETSTYLE_WITH_UNDO`
| ) |  |
| virtual

Sets the attributes for the given range.

Pass flags to determine how the attributes are set.

The end point of range is specified as the last character position of the span of text. So, for example, to set the style for a character at position 5, use the range (5,5). This differs from the wxRichTextCtrl API, where you would specify (5,6).

flags may contain a bit list of the following values:

- wxRICHTEXT_SETSTYLE_NONE: no style flag.
- wxRICHTEXT_SETSTYLE_WITH_UNDO: specifies that this operation should be undoable.
- wxRICHTEXT_SETSTYLE_OPTIMIZE: specifies that the style should not be applied if the combined style at this point is already the style in question.
- wxRICHTEXT_SETSTYLE_PARAGRAPHS_ONLY: specifies that the style should only be applied to paragraphs, and not the content. This allows content styling to be preserved independently from that of e.g. a named paragraph style.
- wxRICHTEXT_SETSTYLE_CHARACTERS_ONLY: specifies that the style should only be applied to characters, and not the paragraph. This allows content styling to be preserved independently from that of e.g. a named paragraph style.
- wxRICHTEXT_SETSTYLE_RESET: resets (clears) the existing style before applying the new style.
- wxRICHTEXT_SETSTYLE_REMOVE: removes the specified style. Only the style flags are used in this operation.

## ◆ SetStyle() [2/2]

virtual void wxRichTextParagraphLayoutBox::SetStyle | ( | wxRichTextObject * | obj,
|  | const wxRichTextAttr & | textAttr,
|  | int | flags = `wxRICHTEXT_SETSTYLE_WITH_UNDO`
| ) |  |
| virtual

Sets the attributes for the given object only, for example the box attributes for a text box.

## ◆ UpdateFloatingObjects()

virtual bool wxRichTextParagraphLayoutBox::UpdateFloatingObjects | ( | const wxRect & | availableRect,
|  | wxRichTextObject * | untilObj = `nullptr`
| ) |  |
| virtual

Gather information about floating objects.

If untilObj is non-null, will stop getting information if the current object is this, since we will collect the rest later.

## ◆ UpdateRanges()

virtual void wxRichTextParagraphLayoutBox::UpdateRanges | ( |  | ) |
| virtual

Calculate ranges.

## ◆ XYToPosition()

virtual long wxRichTextParagraphLayoutBox::XYToPosition | ( | long | x,
|  | long | y
| ) |  | const
| virtual

Converts zero-based line column and paragraph number to a position.

## Member Data Documentation

## ◆ m_ctrl

wxRichTextCtrl* wxRichTextParagraphLayoutBox::m_ctrl
| protected

## ◆ m_defaultAttributes

wxRichTextAttr wxRichTextParagraphLayoutBox::m_defaultAttributes
| protected

## ◆ m_floatCollector

wxRichTextFloatCollector* wxRichTextParagraphLayoutBox::m_floatCollector
| protected

## ◆ m_invalidRange

wxRichTextRange wxRichTextParagraphLayoutBox::m_invalidRange
| protected

## ◆ m_partialParagraph

bool wxRichTextParagraphLayoutBox::m_partialParagraph
| protected