# wxRichTextCompositeObject Class Reference
[Rich Text]

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

Inheritance diagram for wxRichTextCompositeObject:
[legend]

## Detailed Description

Objects of this class can contain other objects.

##

Library: wxRichText

Category: Rich Text

See also:
  wxRichTextObject, wxRichTextBuffer, wxRichTextCtrl

## Public Member Functions
| wxRichTextCompositeObject (wxRichTextObject *parent=NULL)
virtual | ~wxRichTextCompositeObject ()
virtual int | HitTest (wxDC &dc, 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.
virtual bool | FindPosition (wxDC &dc, long index, wxPoint &pt, int *height, bool forceLineStart)
virtual void | CalculateRange (long start, long &end)
| Calculates the range of the object.
virtual bool | DeleteRange (const wxRichTextRange &range)
virtual wxString | GetTextForRange (const wxRichTextRange &range) const
virtual bool | GetRangeSize (const wxRichTextRange &range, wxSize &size, int &descent, wxDC &dc, int flags, wxPoint position=wxPoint(0, 0), wxArrayInt *partialExtents=NULL) const
| Returns the object size for the given range.
virtual void | Dump (wxTextOutputStream &stream)
| Dump object data to the given output stream for debugging.
virtual void | Invalidate (const wxRichTextRange &invalidRange=wxRICHTEXT_ALL)
| Invalidates the object at the given range.
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 | 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 (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.
## Protected Attributes
wxRichTextObjectList | m_children

List of all members.

## Constructor & Destructor Documentation

wxRichTextCompositeObject::wxRichTextCompositeObject | ( | wxRichTextObject * | parent = `NULL` | ) |

virtual wxRichTextCompositeObject::~wxRichTextCompositeObject | ( |  | ) | `[virtual]`

## Member Function Documentation

size_t wxRichTextCompositeObject::AppendChild | ( | wxRichTextObject * | child | ) |

Appends a child, returning the position.

virtual void wxRichTextCompositeObject::CalculateRange | ( | long | start,
|  | long & | end |
| ) |  |  | `[virtual]`

Calculates the range of the object.

By default, guess that the object is 1 unit long.

Reimplemented from wxRichTextObject.

Reimplemented in wxRichTextParagraph, and wxRichTextTable.

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

bool wxRichTextCompositeObject::Defragment | ( | const wxRichTextRange & | range = `wxRICHTEXT_ALL` | ) |

Recursively merges all pieces that can be merged.

bool wxRichTextCompositeObject::DeleteChildren | ( |  | ) |

Deletes all the children.

virtual bool wxRichTextCompositeObject::DeleteRange | ( | const wxRichTextRange & | range | ) | `[virtual]`

Reimplemented in wxRichTextParagraphLayoutBox, and wxRichTextTable.

virtual void wxRichTextCompositeObject::Dump | ( | wxTextOutputStream & | stream | ) | `[virtual]`

Dump object data to the given output stream for debugging.

Reimplemented from wxRichTextObject.

Reimplemented in wxRichTextBuffer.

virtual bool wxRichTextCompositeObject::FindPosition | ( | wxDC & | dc,
|  | long | index,
|  | wxPoint & | pt,
|  | int * | height,
|  | bool | forceLineStart |
| ) |  |  | `[virtual]`

Reimplemented in wxRichTextParagraph, and wxRichTextTable.

wxRichTextObject* wxRichTextCompositeObject::GetChild | ( | size_t | n | ) | const

Returns the nth child.

virtual wxRichTextObject* wxRichTextCompositeObject::GetChildAtPosition | ( | long | pos | ) | const`[virtual]`

Returns the child object at the given character position.

size_t wxRichTextCompositeObject::GetChildCount | ( |  | ) | const

Returns the number of children.

const wxRichTextObjectList& wxRichTextCompositeObject::GetChildren | ( |  | ) | const`[inline]`

Returns the children.

wxRichTextObjectList& wxRichTextCompositeObject::GetChildren | ( |  | ) | `[inline]`

Returns the children.

virtual bool wxRichTextCompositeObject::GetRangeSize | ( | const wxRichTextRange & | range,
|  | wxSize & | size,
|  | int & | descent,
|  | wxDC & | dc,
|  | int | flags,
|  | wxPoint | position = `wxPoint(0, 0)`,
|  | wxArrayInt * | partialExtents = `NULL` |
| ) |  |  | const`[virtual]`

Returns the object size for the given range.

Returns false if the range is invalid for this object.

Implements wxRichTextObject.

Reimplemented in wxRichTextParagraphLayoutBox, wxRichTextParagraph, and wxRichTextTable.

virtual wxString wxRichTextCompositeObject::GetTextForRange | ( | const wxRichTextRange & | range | ) | const`[virtual]`

Reimplemented in wxRichTextParagraphLayoutBox, and wxRichTextTable.

virtual int wxRichTextCompositeObject::HitTest | ( | wxDC & | dc,
|  | 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 wxRichTextObject.

Reimplemented in wxRichTextParagraphLayoutBox, wxRichTextParagraph, and wxRichTextBuffer.

bool wxRichTextCompositeObject::InsertChild | ( | wxRichTextObject * | child,
|  | wxRichTextObject * | inFrontOf |
| ) |  |  |

Inserts the child in front of the given object, or at the beginning.

virtual void wxRichTextCompositeObject::Invalidate | ( | const wxRichTextRange & | invalidRange = `wxRICHTEXT_ALL` | ) | `[virtual]`

Invalidates the object at the given range.

With no argument, invalidates the whole object.

Reimplemented from wxRichTextObject.

Reimplemented in wxRichTextParagraphLayoutBox.

virtual bool wxRichTextCompositeObject::IsComposite | ( |  | ) | const`[inline, virtual]`

Returns true if this object is composite.

Reimplemented from wxRichTextObject.

virtual bool wxRichTextCompositeObject::IsEmpty | ( |  | ) | const`[inline, virtual]`

Returns true if the buffer is empty.

Reimplemented from wxRichTextObject.

virtual void wxRichTextCompositeObject::Move | ( | const wxPoint & | pt | ) | `[virtual]`

Moves the object recursively, by adding the offset from old to new.

Reimplemented from wxRichTextObject.

void wxRichTextCompositeObject::operator= | ( | const wxRichTextCompositeObject & | obj | ) | `[inline]`

bool wxRichTextCompositeObject::RemoveChild | ( | wxRichTextObject * | child,
|  | bool | deleteChild = `false` |
| ) |  |  |

Removes and optionally deletes the specified child.

## Member Data Documentation

wxRichTextObjectList wxRichTextCompositeObject::m_children`[protected]`

|  | [ top ]