arelle.UITkTable#

@author: Acsone S. A. See COPYRIGHT.md for copyright information.

Module Contents#

Classes#

Coordinate

MyToolTip

TableCombobox

XbrlTable

This class implements all the GUI elements needed for representing the sliced 2D-view of an Xbrl Table

ScrolledTkTableFrame

Data#

API#

arelle.UITkTable.USE_resizeTableCells#

False

class arelle.UITkTable.Coordinate(row, column)#

Bases: object

Initialization

__str__()#
__repr__()#
__eq__(other)#
__ne__(other)#
__lt__(other)#
__gt__(other)#
__hash__()#
class arelle.UITkTable.MyToolTip(master, text='', delay=500, **opts)#

Bases: arelle.CntlrWinTooltip.ToolTip

Initialization

motion(event=None)#
class arelle.UITkTable.TableCombobox(master=None, **kw)#

Bases: tkinter.ttk.Combobox

property valueIndex#
class arelle.UITkTable.XbrlTable(parentWidget, rows, columns, titleRows, titleColumns, tableName=None, browsecmd=None)#

Bases: arelle.TkTableWrapper.Table

This class implements all the GUI elements needed for representing the sliced 2D-view of an Xbrl Table

Initialization

The initial size of the table (including the header sizes) must be supplied at table creation time. The contextual menu will have to be created later with a ‘widget.contextMenu()’ command. The Tab and Return key are bound to cell navigation.

TG_PREFIX#

‘cFmt’

TG_TOP_LEFT#

‘top-left-cell’

TG_LEFT_JUSTIFIED#

‘left’

TG_RIGHT_JUSTIFIED#

‘right’

TG_CENTERED#

‘center’

TG_TOP_LEFT_JUSTIFIED#

‘top-left’

ANCHOR_POSITIONS#

None

JUSTIFICATIONS#

None

TG_BG_WHITE#

‘bg-white’

TG_BG_DEFAULT#

None

TG_BG_YELLOW#

‘bg-yellow’

TG_BG_ORANGE#

‘bg-orange’

TG_BG_VIOLET#

‘bg-violet’

TG_BG_GREEN#

‘bg-green’

COLOURS#

None

TG_DISABLED#

‘disabled-cells’

TG_NO_BORDER#

‘no-border’

TG_BORDER_ALL#

‘border-all’

TG_BORDER_LEFT#

‘border-left’

TG_BORDER_TOP#

‘border-top’

TG_BORDER_RIGHT#

‘border-right’

TG_BORDER_BOTTOM#

‘border-bottom’

TG_BORDER_LEFT_TOP#

‘border-left-top’

TG_BORDER_LEFT_RIGHT#

‘border-left-right’

TG_BORDER_LEFT_BOTTOM#

‘border-left-bottom’

TG_BORDER_TOP_RIGHT#

‘border-top-right’

TG_BORDER_TOP_BOTTOM#

‘border-top-bottom’

TG_BORDER_RIGHT_BOTTOM#

‘border-right-bottom’

TG_BORDER_TOP_RIGHT_BOTTOM#

‘border-top-right-bottom’

TG_BORDER_RIGHT_BOTTOM_LEFT#

‘border-right-bottom-left’

TG_BORDER_BOTTOM_LEFT_TOP#

‘border-bottom-left-top’

TG_BORDER_LEFT_TOP_RIGHT#

‘border-left-top-right’

BORDERWIDTHS#

None

BORDER_NAMES#

None

MAX_COLUMN_WIDTH#

20

MAX_ROW_HEIGHT#

50

MAX_COLUMN_WIDTH_PLUS_1#

None

DEFAULT_COLUMN_WIDTH#

6

DEFAULT_ROW_HEIGHT#

2

mouseMotion(event)#
getCoordinatesFromEventXY(event)#
cellRight(event, *args)#
cellDown(event, *args)#
_valueCommand(event)#
_applyFormat(tagname, option)#
format_cell(option, index)#
set(rc=None, index=None, objectId=None, *args, **kwargs)#
clearModificationStatus()#
getObjectId(coordinate)#
setObjectId(coordinate, objectId)#
getTableValue(coordinate)#
isHeaderCell(coordinate)#
getCoordinatesOfModifiedCells()#
getCurrentCellCoordinates()#
initCellValue(value, x, y, backgroundColourTag='bg-white', justification='left', objectId=None)#

Initialise the content of a cell. The resulting cell will be writable.

_setValueFromCombobox(event)#
initCellCombobox(value, values, x, y, isOpen=False, objectId=None, selectindex=None, comboboxselected=None, codes=dict())#

Initialise the content of a cell as a combobox. If isOpen=False, the combobox will be read-only, no new value can be added to the combobox.

initReadonlyCell(x, y)#

Make the specified cell read-only

_updateMaxSizes(value, x, y, colspan, rowspan, minWidth=0)#
Parameters:
  • value – object

  • x – int

  • y – int

  • colspan – int

  • rowspan – int Here, we compute the size of the current header cell. The computation takes into account the colspan and the rowspan. If there is a row- or columnspan, the length is gathered uniformly among all spanned cells. We base our computations on the length of value (converted to a string). We keep everything on a line except when the width exceeds self.MAX_COLUMN_WIDTH. In the later case, we start wrapping the text on subsequent lines and thus the height of the line increases.

_updateMaxComboboxSizes(codes, x, y, colspan, rowspan)#

This method works like _updateMaxSizes, but for a list of values

Parameters:
  • codes – list()

  • x – int

  • y – int

  • colspan – int

  • rowspan – int

initHeaderCellValue(value, x, y, colspan, rowspan, justification, objectId=None, hasLeftBorder=True, hasTopBorder=True, hasRightBorder=True, hasBottomBorder=True, width=None)#

Initialise the read-only content of a header cell.

initCellSpan(x, y, colspan, rowspan)#

Set the row and column span for the given cell

initHeaderCombobox(x, y, value='', values=(), colspan=0, rowspan=0, isOpen=True, objectId=None, selectindex=None, comboboxselected=None, codes=dict(), isRollUp=False)#

Initialise the read-only content of a header cell as a combobox. New values can be added to the combobox if isOpen==True.

drawBordersAroundCell(x, y, borders)#

The borders are coded in an integer: 2^0 = bottom 2^1 = top 2^2 = right 2^3 = left

initHeaderBorder(x, y, cellsToTheRight=0, cellsBelow=0, hasLeftBorder=False, hasTopBorder=False, hasRightBorder=False, hasBottomBorder=False)#

Set the border around a group of header cells. The rectangular group of cells will start at position (x,y) and possibly extend cellsToTheRight cells to the right and/or cellsBelow cells below the given position. The border will always have the same size.

resizeTable(rows, columns, titleRows=-1, titleColumns=-1, clearData=True)#

Resize a table. Only positive increases are allowed. Negative increases will be ignored. All numbers are absolute numbers and the actual increase will be computed by this method. If titleRows or titleColumns is less than 0, the corresponding axis will not be updated either.

clearSpans()#
clearTags()#
disableUnusedCells()#
resizeTableCells()#
class arelle.UITkTable.ScrolledTkTableFrame(parent, browseCmd, *args, **kw)#

Bases: tkinter.Frame

clearGrid()#