wx.richtext.RichTextTable represents a table with arbitrary columns and rows.
Default constructor; optionally pass the parent object. |
|
Returns |
|
Adds columns from the given column position. |
|
Adds rows from the given row position. |
|
Calculates the range of the object. |
|
Returns |
|
Clears the table. |
|
Clones the object. |
|
Creates a table of the given dimensions. |
|
Deletes columns from the given column position. |
|
Deletes the given range. |
|
Deletes rows from the given row position. |
|
Draw the item, within the given range. |
|
Edits the object’s properties via a GUI. |
|
Finds the absolute position and row height for the given character position. |
|
Returns the cell at the given row/column position. |
|
Returns the row/column for a given character position. |
|
Returns the cells array. |
|
Returns the column count. |
|
Returns the coordinates of the cell with keyboard focus, or (-1,-1) if none. |
|
Returns the label to be used for the properties context menu item. |
|
Returns the object size for the given range. |
|
Returns the row count. |
|
Returns a selection object specifying the selections between start and end character positions. |
|
Returns any text in this object for the given range. |
|
Returns the |
|
Returns |
|
Hit-testing: returns a flag indicating hit test details, plus information about position. |
|
Imports this object from |
|
Lay the item out at the specified position with the given size constraint. |
|
Sets the attributes for the cells specified by the selection. |
See |
|
See |
|
See |
|
See |
|
See |
wx.richtext.
RichTextTable
(RichTextBox)¶Possible constructors:
RichTextTable(parent=None)
RichTextTable(obj)
RichTextTable represents a table with arbitrary columns and rows.
__init__
(self, *args, **kw)¶__init__ (self, parent=None)
Default constructor; optionally pass the parent object.
parent (wx.richtext.RichTextObject) –
__init__ (self, obj)
Copy constructor.
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).
bool
AddColumns
(self, startCol, noCols=1, attr=RichTextAttr())¶Adds columns from the given column position.
startCol (int) –
noCols (int) –
attr (wx.richtext.RichTextAttr) –
bool
AddRows
(self, startRow, noRows=1, attr=RichTextAttr())¶Adds rows from the given row position.
startRow (int) –
noRows (int) –
attr (wx.richtext.RichTextAttr) –
bool
CalculateRange
(self, start)¶Calculates the range of the object.
By default, guess that the object is 1 unit long.
start (long) –
end
CanEditProperties
(self)¶Returns True
if we can edit the object’s properties via a GUI.
bool
ClearTable
(self)¶Clears the table.
Clone
(self)¶Clones the object.
Copy
(self, obj)¶obj (wx.richtext.RichTextTable) –
CreateTable
(self, rows, cols)¶Creates a table of the given dimensions.
rows (int) –
cols (int) –
bool
DeleteColumns
(self, startCol, noCols=1)¶Deletes columns from the given column position.
startCol (int) –
noCols (int) –
bool
DeleteRange
(self, range)¶Deletes the given range.
range (wx.richtext.RichTextRange) –
bool
DeleteRows
(self, startRow, noRows=1)¶Deletes rows from the given row position.
startRow (int) –
noRows (int) –
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)
dc (wx.DC) –
context (wx.richtext.RichTextDrawingContext) –
range (wx.richtext.RichTextRange) –
selection (wx.richtext.RichTextSelection) –
rect (wx.Rect) –
descent (int) –
style (int) –
bool
EditProperties
(self, parent, buffer)¶Edits the object’s properties via a GUI.
parent (wx.Window) –
buffer (wx.richtext.RichTextBuffer) –
bool
FindPosition
(self, dc, context, index, forceLineStart)¶Finds the absolute position and row height for the given character position.
dc (wx.DC) –
context (wx.richtext.RichTextDrawingContext) –
index (long) –
forceLineStart (bool) –
tuple
( bool, pt, height )
GetCell
(self, *args, **kw)¶GetCell (self, row, col)
Returns the cell at the given row/column position.
row (int) –
col (int) –
GetCell (self, pos)
Returns the cell at the given character position (in the range of the table).
pos (long) –
GetCellRowColumnPosition
(self, pos, row, col)¶Returns the row/column for a given character position.
pos (long) –
row (int) –
col (int) –
bool
GetCells
(self)¶Returns the cells array.
RichTextObjectPtrArrayArray
GetColumnCount
(self)¶Returns the column count.
int
GetFocusedCell
(self)¶Returns the coordinates of the cell with keyboard focus, or (-1,-1) if none.
Position
GetPropertiesMenuLabel
(self)¶Returns the label to be used for the properties context menu item.
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.
range (wx.richtext.RichTextRange) –
size (wx.Size) –
descent (int) –
dc (wx.DC) –
context (wx.richtext.RichTextDrawingContext) –
flags (int) –
position (wx.Point) –
parentSize (wx.Size) –
partialExtents (list of integers) –
bool
GetRowCount
(self)¶Returns the row count.
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.
start (long) –
end (long) –
GetTextForRange
(self, range)¶Returns any text in this object for the given range.
range (wx.richtext.RichTextRange) –
string
GetXMLNodeName
(self)¶Returns the XML
node name of this object.
This must be overridden for XmlNode-base XML
export to work.
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.
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).
dc (wx.DC) –
context (wx.richtext.RichTextDrawingContext) –
pt (wx.Point) –
flags (int) –
tuple
( int, textPosition, obj, contextObj )
ImportFromXML
(self, buffer, node, handler, recurse)¶Imports this object from XML
.
buffer (wx.richtext.RichTextBuffer) –
node (wx.xml.XmlNode) –
handler (wx.richtext.RichTextXMLHandler) –
recurse (bool) –
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).
dc (wx.DC) –
context (wx.richtext.RichTextDrawingContext) –
rect (wx.Rect) –
parentRect (wx.Rect) –
style (int) –
bool
SetCellStyle
(self, selection, style, flags=RICHTEXT_SETSTYLE_WITH_UNDO)¶Sets the attributes for the cells specified by the selection.
selection (wx.richtext.RichTextSelection) –
style (wx.richtext.RichTextAttr) –
flags (int) –
bool
ColumnCount
¶See GetColumnCount
FocusedCell
¶See GetFocusedCell
PropertiesMenuLabel
¶RowCount
¶See GetRowCount
XMLNodeName
¶See GetXMLNodeName