Class TableView | Terminal.Gui v1 (original) (raw)
Namespace
Assembly
Terminal.Gui.dll
public class TableView : View, IDisposable, ISupportInitializeNotification, ISupportInitialize
Inheritance
TableView
Implements
Inherited Members
Constructors
Initialzies a TableView class using Computed layout. Set the Table property to begin editing
Initialzies a TableView class using Computed layout.
Fields
The default maximum cell width for MaxCellWidth and MaxWidth
The default minimum cell width for MinAcceptableWidth
Properties
The key which when pressed should trigger CellActivated event. Defaults to Enter.
Horizontal scroll offset. The index of the first column in Table to display when when rendering the view.
True to select the entire row at once. False to select individual cells. Defaults to false
The maximum number of characters to render in any given column. This prevents one long column from pushing out all the others
True to allow regions to be selected
When MultiSelect is enabled this property contain all rectangles of selected cells. Rectangles describe column/rows selected in Table (not screen coordinates)
The text representation that should be rendered for cells with the value Value
Vertical scroll offset. The index of the first row in Table to display in the first non header line of the control when rendering the view.
The index of Columns in Table that the user has currently selected
The index of Rows in Table that the user has currently selected
The symbol to add after each cell value and header value to visually seperate values (if not using vertical gridlines)
Contains options for changing how the table is rendered
The data table to render in the view. Setting this property automatically updates and redraws the control.
Methods
Returns the screen position (relative to the control client area) that the given cell is rendered or null if it is outside the current scroll area or no table is loaded
ChangeSelectionByOffset(int, int, bool)
Moves the SelectedRow and SelectedColumn by the provided offsets. Optionally starting a box selection (see MultiSelect)
ChangeSelectionToEndOfRow(bool)
Moves or extends the selection to the last cell in the current row
ChangeSelectionToEndOfTable(bool)
Moves or extends the selection to the final cell in the table (nX,nY). If FullRowSelect is enabled then selection instead moves to (SelectedColumn,nY) i.e. no horizontal scrolling.
ChangeSelectionToStartOfRow(bool)
Moves or extends the selection to the first cell in the current row
ChangeSelectionToStartOfTable(bool)
Moves or extends the selection to the first cell in the table (0,0). If FullRowSelect is enabled then selection instead moves to (SelectedColumn,0) i.e. no horizontal scrolling.
Updates scroll offsets to ensure that the selected cell is visible. Has no effect if Table has not been set.
Updates ColumnOffset and RowOffset where they are outside the bounds of the table (by adjusting them to the nearest existing cell). Has no effect if Table has not been set.
Updates SelectedColumn, SelectedRow and MultiSelectedRegions where they are outside the bounds of the table (by adjusting them to the nearest existing cell). Has no effect if Table has not been set.
Returns all cells in any MultiSelectedRegions (if MultiSelect is enabled) and the selected cell
Returns true if the given cell is selected either because it is the active cell or part of a multi cell selection (e.g. FullRowSelect).
Returns false if Visible is false.
Method invoked when a mouse event is generated
OnCellActivated(CellActivatedEventArgs)
Invokes the CellActivated event
OnSelectedCellChanged(SelectedCellChangedEventArgs)
Invokes the SelectedCellChanged event
Moves the selection down by one page
Moves the selection up by one page
Positions the cursor in the area of the screen in which the start of the active cell is rendered. Calls base implementation if active cell is not visible due to scrolling or table is loaded etc
If the view is focused, gives the view a chance to process the keystroke.
Redraws this view and its subviews; only redraws the views that have been flagged for a re-display.
RenderCell(Attribute, string, bool)
Override to provide custom multi colouring to cells. Use Driver to with AddStr(ustring). The driver will already be in the correct place when rendering and you must render the full render
or the view will not look right. For simpler provision of color use ColorGetterFor changing the content that is rendered use RepresentationGetter
. Returns the column and row of Table that corresponds to a given point on the screen (relative to the control client area). Returns null if the point is in the header, no table is loaded or outside the control bounds.
ScreenToCell(int, int, out DataColumn)
. Returns the column and row of Table that corresponds to a given point on the screen (relative to the control client area). Returns null if the point is in the header, no table is loaded or outside the control bounds.
When MultiSelect is on, creates selection over all cells in the table (replacing any old selection regions)
Moves the SelectedRow and SelectedColumn to the given col/row in Table. Optionally starting a box selection (see MultiSelect)
Updates the view to reflect changes to Table and to (ColumnOffset / RowOffset) etc
Events
This event is raised when a cell is activated e.g. by double clicking or pressing CellActivationKey
This event is raised when the selected cell in the table changes.