Phoenix Logo

phoenix_title wx.richtext.RichTextTable

wx.richtext.RichTextTable represents a table with arbitrary columns and rows.


class_hierarchy Class Hierarchy

Inheritance diagram for class RichTextTable:

method_summary Methods Summary

__init__ Default constructor; optionally pass the parent object.
AcceptsFocus Returns True if objects of this class can accept the focus, i.e. a call to SetFocusObject is possible.
AddColumns Adds columns from the given column position.
AddRows Adds rows from the given row position.
CalculateRange Calculates the range of the object.
CanEditProperties Returns True if we can edit the object’s properties via a GUI.
ClearTable Clears the table.
Clone Clones the object.
Copy  
CreateTable Creates a table of the given dimensions.
DeleteColumns Deletes columns from the given column position.
DeleteRange Deletes the given range.
DeleteRows Deletes rows from the given row position.
Draw Draw the item, within the given range.
EditProperties Edits the object’s properties via a GUI.
FindPosition Finds the absolute position and row height for the given character position.
GetCell Returns the cell at the given row/column position.
GetCellRowColumnPosition Returns the row/column for a given character position.
GetCells Returns the cells array.
GetColumnCount Returns the column count.
GetFocusedCell Returns the coordinates of the cell with keyboard focus, or (-1,-1) if none.
GetPropertiesMenuLabel Returns the label to be used for the properties context menu item.
GetRangeSize Returns the object size for the given range.
GetRowCount Returns the row count.
GetSelection Returns a selection object specifying the selections between start and end character positions.
GetTextForRange Returns any text in this object for the given range.
GetXMLNodeName Returns the XML node name of this object.
HandlesChildSelections Returns True if this object can handle the selections of its children, fOr example a table.
HitTest Hit-testing: returns a flag indicating hit test details, plus information about position.
ImportFromXML Imports this object from XML.
Layout Lay the item out at the specified position with the given size constraint.
SetCellStyle Sets the attributes for the cells specified by the selection.

api Class API



class wx.richtext.RichTextTable(RichTextBox)

Possible constructors:

RichTextTable(parent=None)

RichTextTable(obj)

RichTextTable represents a table with arbitrary columns and rows.


Methods



__init__(self, *args, **kw)

overload Overloaded Implementations:



__init__ (self, parent=None)

Default constructor; optionally pass the parent object.

Parameters:parent (wx.richtext.RichTextObject) –



__init__ (self, obj)

Copy constructor.

Parameters:obj (wx.richtext.RichTextTable) –





AcceptsFocus(self)

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

Return type:bool


AddColumns(self, startCol, noCols=1, attr=RichTextAttr())

Adds columns from the given column position.

Parameters:
Return type:

bool



AddRows(self, startRow, noRows=1, attr=RichTextAttr())

Adds rows from the given row position.

Parameters:
Return type:

bool



CalculateRange(self, start)

Calculates the range of the object.

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

Parameters:start (long) –
Return type:end


CanEditProperties(self)

Returns True if we can edit the object’s properties via a GUI.

Return type:bool


ClearTable(self)

Clears the table.



Clone(self)

Clones the object.

Return type: wx.richtext.RichTextObject


Copy(self, obj)
Parameters:obj (wx.richtext.RichTextTable) –


CreateTable(self, rows, cols)

Creates a table of the given dimensions.

Parameters:
  • rows (int) –
  • cols (int) –
Return type:

bool



DeleteColumns(self, startCol, noCols=1)

Deletes columns from the given column position.

Parameters:
  • startCol (int) –
  • noCols (int) –
Return type:

bool



DeleteRange(self, range)

Deletes the given range.

Parameters:range (wx.richtext.RichTextRange) –
Return type:bool


DeleteRows(self, startRow, noRows=1)

Deletes rows from the given row position.

Parameters:
  • startRow (int) –
  • noRows (int) –
Return type:

bool



Draw(self, dc, context, range, selection, rect, descent, style)

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)

Parameters:
Return type:

bool



EditProperties(self, parent, buffer)

Edits the object’s properties via a GUI.

Parameters:
Return type:

bool



FindPosition(self, dc, context, index, forceLineStart)

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

Parameters:
Return type:

tuple

Returns:

( bool, pt, height )



GetCell(self, *args, **kw)

overload Overloaded Implementations:



GetCell (self, row, col)

Returns the cell at the given row/column position.

Parameters:
  • row (int) –
  • col (int) –
Return type:

wx.richtext.RichTextCell



GetCell (self, pos)

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

Parameters:pos (long) –
Return type: wx.richtext.RichTextCell





GetCellRowColumnPosition(self, pos, row, col)

Returns the row/column for a given character position.

Parameters:
  • pos (long) –
  • row (int) –
  • col (int) –
Return type:

bool



GetCells(self)

Returns the cells array.

Return type:RichTextObjectPtrArrayArray


GetColumnCount(self)

Returns the column count.

Return type:int


GetFocusedCell(self)

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

Return type:Position


GetPropertiesMenuLabel(self)

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

Return type:string


GetRangeSize(self, range, size, descent, dc, context, flags, position=Point(0, 0), parentSize=DefaultSize, partialExtents=None)

Returns the object size for the given range.

Returns False if the range is invalid for this object.

Parameters:
Return type:

bool



GetRowCount(self)

Returns the row count.

Return type:int


GetSelection(self, start, end)

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.

Parameters:
  • start (long) –
  • end (long) –
Return type:

wx.richtext.RichTextSelection



GetTextForRange(self, range)

Returns any text in this object for the given range.

Parameters:range (wx.richtext.RichTextRange) –
Return type:string


GetXMLNodeName(self)

Returns the XML node name of this object.

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

Return type:string


HandlesChildSelections(self)

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

Required for composite selection handling to work.

Return type:bool


HitTest(self, dc, context, pt, flags=0)

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

Parameters:
Return type:

tuple

Returns:

( int, textPosition, obj, contextObj )



ImportFromXML(self, buffer, node, handler, recurse)

Imports this object from XML.

Parameters:
Return type:

bool



Layout(self, dc, context, rect, parentRect, style)

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

Parameters:
Return type:

bool



SetCellStyle(self, selection, style, flags=RICHTEXT_SETSTYLE_WITH_UNDO)

Sets the attributes for the cells specified by the selection.

Parameters:
Return type:

bool


Properties



Cells

See GetCells



ColumnCount

See GetColumnCount



FocusedCell

See GetFocusedCell



PropertiesMenuLabel

See GetPropertiesMenuLabel



RowCount

See GetRowCount



XMLNodeName

See GetXMLNodeName