Version: 2.9.4
Public Member Functions | Protected Attributes
wxRichTextCompositeObject Class Reference

#include </home/zeitlin/src/wx/github/interface/wx/richtext/richtextbuffer.h>

Inheritance diagram for wxRichTextCompositeObject:

Detailed Description

Objects of this class can contain other objects.

Library:  wxRichText
Category:  Rich Text
参照:
wxRichTextObject, wxRichTextBuffer, wxRichTextCtrl

Public Member Functions

 wxRichTextCompositeObject (wxRichTextObject *parent=NULL)
virtual ~wxRichTextCompositeObject ()
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.
virtual bool FindPosition (wxDC &dc, wxRichTextDrawingContext &context, 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, wxRichTextDrawingContext &context, 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.
wxRichTextObjectGetChild (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 wxRichTextObjectGetChildAtPosition (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 wxRichTextField, 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]
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,
wxRichTextDrawingContext context,
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.

wxRichTextObjectList& wxRichTextCompositeObject::GetChildren ( ) [inline]

Returns the children.

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

Returns the children.

virtual bool wxRichTextCompositeObject::GetRangeSize ( const wxRichTextRange range,
wxSize size,
int &  descent,
wxDC dc,
wxRichTextDrawingContext context,
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, wxRichTextField, wxRichTextParagraph, and wxRichTextTable.

virtual wxString wxRichTextCompositeObject::GetTextForRange ( const wxRichTextRange range) const [virtual]
virtual int wxRichTextCompositeObject::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 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::IsAtomic ( ) const [inline, virtual]

Returns true if no user editing can be done inside the object.

This returns true for simple objects, false for most composite objects, but true for fields, which if composite, should not be user-edited.

Reimplemented from wxRichTextObject.

Reimplemented in wxRichTextField.

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.

Reimplemented in wxRichTextField.

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]
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines