Version: 3.0.2
wxRichTextTable Class Reference

#include <wx/richtext/richtextbuffer.h>

+ Inheritance diagram for wxRichTextTable:

Detailed Description

wxRichTextTable represents a table with arbitrary columns and rows.

Public Member Functions

 wxRichTextTable (wxRichTextObject *parent=NULL)
 Default constructor; optionally pass the parent object.
 
 wxRichTextTable (const wxRichTextTable &obj)
 Copy constructor.
 
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 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 wxString GetXMLNodeName () const
 Returns the XML node name of this object.
 
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 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.
 
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 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 AcceptsFocus () const
 Returns true if objects of this class can accept the focus, i.e. a call to SetFocusObject is possible.
 
const
wxRichTextObjectPtrArrayArray & 
GetCells () const
 Returns the cells array.
 
wxRichTextObjectPtrArrayArray & GetCells ()
 Returns the cells array.
 
int GetRowCount () const
 Returns the row count.
 
int GetColumnCount () const
 Returns the column count.
 
virtual wxRichTextCellGetCell (int row, int col) const
 Returns the cell at the given row/column position.
 
virtual wxRichTextCellGetCell (long pos) const
 Returns the cell at the given character position (in the range of the table).
 
virtual bool GetCellRowColumnPosition (long pos, int &row, int &col) const
 Returns the row/column for a given character position.
 
virtual wxPosition GetFocusedCell () const
 Returns the coordinates of the cell with keyboard focus, or (-1,-1) if none.
 
virtual void ClearTable ()
 Clears the table.
 
virtual bool CreateTable (int rows, int cols)
 Creates a table of the given dimensions.
 
virtual bool SetCellStyle (const wxRichTextSelection &selection, const wxRichTextAttr &style, int flags=wxRICHTEXT_SETSTYLE_WITH_UNDO)
 Sets the attributes for the cells specified by the selection.
 
virtual bool DeleteRows (int startRow, int noRows=1)
 Deletes rows from the given row position.
 
virtual bool DeleteColumns (int startCol, int noCols=1)
 Deletes columns from the given column position.
 
virtual bool AddRows (int startRow, int noRows=1, const wxRichTextAttr &attr=wxRichTextAttr())
 Adds rows from the given row position.
 
virtual bool AddColumns (int startCol, int noCols=1, const wxRichTextAttr &attr=wxRichTextAttr())
 Adds columns from the given column position.
 
virtual wxRichTextObjectClone () const
 Clones the object.
 
void Copy (const wxRichTextTable &obj)
 
- Public Member Functions inherited from wxRichTextBox
 wxRichTextBox (wxRichTextObject *parent=NULL)
 Default constructor; optionally pass the parent object.
 
 wxRichTextBox (const wxRichTextBox &obj)
 Copy constructor.
 
void Copy (const wxRichTextBox &obj)
 
- Public Member Functions inherited from wxRichTextParagraphLayoutBox
 wxRichTextParagraphLayoutBox (wxRichTextObject *parent=NULL)
 
 wxRichTextParagraphLayoutBox (const wxRichTextParagraphLayoutBox &obj)
 
 ~wxRichTextParagraphLayoutBox ()
 
void SetRichTextCtrl (wxRichTextCtrl *ctrl)
 Associates a control with the buffer, for operations that for example require refreshing the window.
 
wxRichTextCtrlGetRichTextCtrl () 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 wxRichTextStyleSheetGetStyleSheet () const
 Returns the style sheet associated with the overall buffer.
 
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.
 
wxRichTextFieldInsertFieldWithUndo (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.
 
wxRichTextObjectInsertObjectWithUndo (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 AddParagraph (const wxString &text, wxRichTextAttr *paraStyle=NULL)
 Convenience function to add a paragraph of text.
 
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 wxRichTextLineGetLineAtPosition (long pos, bool caretPosition=false) const
 Returns the line at the given position.
 
virtual wxRichTextLineGetLineAtYPosition (int y) const
 Returns the line at the given y pixel position, or the last line.
 
virtual wxRichTextParagraphGetParagraphAtPosition (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 wxRichTextLineGetLineForVisibleLineNumber (long lineNumber) const
 Given a line number, returns the corresponding wxRichTextLine object.
 
virtual wxRichTextObjectGetLeafObjectAtPosition (long position) const
 Returns the leaf object in a paragraph at this position.
 
virtual wxRichTextParagraphGetParagraphAtLine (long paragraphNumber) const
 Returns the paragraph by number.
 
virtual wxRichTextParagraphGetParagraphForLine (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 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 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 wxRichTextAttrGetDefaultStyle () 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 wxRichTextAttrGetBasicStyle () 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.
 
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)
 Sets the list attributes for the given range, passing flags to determine how the attributes are set.
 
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)
 Numbers the paragraphs in the given range.
 
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)
 Promotes the list items within the given range.
 
- Public Member Functions inherited from wxRichTextCompositeObject
 wxRichTextCompositeObject (wxRichTextObject *parent=NULL)
 
virtual ~wxRichTextCompositeObject ()
 
virtual void Dump (wxTextOutputStream &stream)
 Dump object data to the given output stream for debugging.
 
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 (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 wxRichTextObjectDoSplit (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 wxRichTextObjectSplit (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 UsesParagraphAttributes () const
 Returns true if this object takes note of paragraph attributes (text and image objects don't).
 
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 wxRichTextRangeGetRange () const
 Returns the object's range.
 
wxRichTextRangeGetRange ()
 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 wxRichTextRangeGetOwnRange () const
 Returns the object's own range (valid if top-level).
 
wxRichTextRangeGetOwnRange ()
 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 wxRichTextObjectGetParent () 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 wxRichTextAttrGetAttributes () const
 Returns the object's attributes.
 
wxRichTextAttrGetAttributes ()
 Returns the object's attributes.
 
wxRichTextPropertiesGetProperties ()
 Returns the object's properties.
 
const wxRichTextPropertiesGetProperties () 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.
 
wxRichTextBufferGetBuffer () 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 wxClassInfoGetClassInfo () const
 This virtual function is redefined for every class that requires run-time type information, when using the wxDECLARE_CLASS macro (or similar).
 
wxObjectRefDataGetRefData () 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.
 

Protected Attributes

int m_rowCount
 
int m_colCount
 
wxRichTextObjectPtrArrayArray m_cells
 

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.
 
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 wxTextAttrBorders &attr, 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 Member Functions inherited from wxObject
void AllocExclusive ()
 Ensure that this object's data is not shared with any other object.
 
virtual wxObjectRefDataCreateRefData () const
 Creates a new instance of the wxObjectRefData-derived class specific to this object and returns it.
 
virtual wxObjectRefDataCloneRefData (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

wxRichTextTable::wxRichTextTable ( wxRichTextObject parent = NULL)

Default constructor; optionally pass the parent object.

wxRichTextTable::wxRichTextTable ( const wxRichTextTable obj)
inline

Copy constructor.

Member Function Documentation

virtual bool wxRichTextTable::AcceptsFocus ( ) const
inlinevirtual

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

virtual bool wxRichTextTable::AddColumns ( int  startCol,
int  noCols = 1,
const wxRichTextAttr attr = wxRichTextAttr() 
)
virtual

Adds columns from the given column position.

virtual bool wxRichTextTable::AddRows ( int  startRow,
int  noRows = 1,
const wxRichTextAttr attr = wxRichTextAttr() 
)
virtual

Adds rows from the given row position.

virtual void wxRichTextTable::CalculateRange ( long  start,
long &  end 
)
virtual

Calculates the range of the object.

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

Reimplemented from wxRichTextCompositeObject.

virtual bool wxRichTextTable::CanEditProperties ( ) const
inlinevirtual

Returns true if we can edit the object's properties via a GUI.

Reimplemented from wxRichTextBox.

virtual void wxRichTextTable::ClearTable ( )
virtual

Clears the table.

virtual wxRichTextObject* wxRichTextTable::Clone ( ) const
inlinevirtual

Clones the object.

Reimplemented from wxRichTextBox.

void wxRichTextTable::Copy ( const wxRichTextTable obj)
virtual bool wxRichTextTable::CreateTable ( int  rows,
int  cols 
)
virtual

Creates a table of the given dimensions.

virtual bool wxRichTextTable::DeleteColumns ( int  startCol,
int  noCols = 1 
)
virtual

Deletes columns from the given column position.

virtual bool wxRichTextTable::DeleteRange ( const wxRichTextRange range)
virtual

Deletes the given range.

Reimplemented from wxRichTextParagraphLayoutBox.

virtual bool wxRichTextTable::DeleteRows ( int  startRow,
int  noRows = 1 
)
virtual

Deletes rows from the given row position.

virtual bool wxRichTextTable::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)

Reimplemented from wxRichTextBox.

virtual bool wxRichTextTable::EditProperties ( wxWindow parent,
wxRichTextBuffer buffer 
)
virtual

Edits the object's properties via a GUI.

Reimplemented from wxRichTextBox.

virtual bool wxRichTextTable::FindPosition ( wxDC dc,
wxRichTextDrawingContext context,
long  index,
wxPoint pt,
int *  height,
bool  forceLineStart 
)
virtual

Finds the absolute position and row height for the given character position.

Reimplemented from wxRichTextCompositeObject.

virtual wxRichTextCell* wxRichTextTable::GetCell ( int  row,
int  col 
) const
virtual

Returns the cell at the given row/column position.

virtual wxRichTextCell* wxRichTextTable::GetCell ( long  pos) const
virtual

Returns the cell at the given character position (in the range of the table).

virtual bool wxRichTextTable::GetCellRowColumnPosition ( long  pos,
int &  row,
int &  col 
) const
virtual

Returns the row/column for a given character position.

const wxRichTextObjectPtrArrayArray& wxRichTextTable::GetCells ( ) const
inline

Returns the cells array.

wxRichTextObjectPtrArrayArray& wxRichTextTable::GetCells ( )
inline

Returns the cells array.

int wxRichTextTable::GetColumnCount ( ) const
inline

Returns the column count.

virtual wxPosition wxRichTextTable::GetFocusedCell ( ) const
virtual

Returns the coordinates of the cell with keyboard focus, or (-1,-1) if none.

virtual wxString wxRichTextTable::GetPropertiesMenuLabel ( ) const
inlinevirtual

Returns the label to be used for the properties context menu item.

Reimplemented from wxRichTextBox.

virtual bool wxRichTextTable::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
virtual

Returns the object size for the given range.

Returns false if the range is invalid for this object.

Reimplemented from wxRichTextParagraphLayoutBox.

int wxRichTextTable::GetRowCount ( ) const
inline

Returns the row count.

virtual wxRichTextSelection wxRichTextTable::GetSelection ( long  start,
long  end 
) const
virtual

Returns a selection object specifying the selections between start and end character positions.

For example, a table would deduce what cells (of range length 1) are selected when dragging across the table.

Reimplemented from wxRichTextObject.

virtual wxString wxRichTextTable::GetTextForRange ( const wxRichTextRange range) const
virtual

Returns any text in this object for the given range.

Reimplemented from wxRichTextParagraphLayoutBox.

virtual wxString wxRichTextTable::GetXMLNodeName ( ) const
inlinevirtual

Returns the XML node name of this object.

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

Reimplemented from wxRichTextBox.

virtual bool wxRichTextTable::HandlesChildSelections ( ) const
inlinevirtual

Returns true if this object can handle the selections of its children, fOr example a table.

Required for composite selection handling to work.

Reimplemented from wxRichTextObject.

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

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

Imports this object from XML.

Reimplemented from wxRichTextParagraphLayoutBox.

virtual bool wxRichTextTable::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).

Reimplemented from wxRichTextParagraphLayoutBox.

virtual bool wxRichTextTable::SetCellStyle ( const wxRichTextSelection selection,
const wxRichTextAttr style,
int  flags = wxRICHTEXT_SETSTYLE_WITH_UNDO 
)
virtual

Sets the attributes for the cells specified by the selection.

Member Data Documentation

wxRichTextObjectPtrArrayArray wxRichTextTable::m_cells
protected
int wxRichTextTable::m_colCount
protected
int wxRichTextTable::m_rowCount
protected