Class TableView | Terminal.Gui v2 (original) (raw)
Namespace
Assembly
Terminal.Gui.dll
public class TableView : View, IDisposable, ISupportInitializeNotification, ISupportInitialize, IDesignable
Inheritance
TableView
Implements
Inherited Members
Constructors
Initializes a TableView class. Set theTable property to begin editing
Initializes a TableView class.
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.
Navigator for cycling the selected item in the table by typing. Set to null to disable this feature.
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
The minimum number of characters to render in any given column.
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 separate 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
Generates a new demo DataTable with the given number of cols
(min 5) androws
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 ifTable 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.
OnCellActivated(CellActivatedEventArgs)
Invokes the CellActivated event
OnCellToggled(CellToggledEventArgs)
Invokes the CellToggled event
Called when the View's content is to be drawn. The default implementation does nothing.
Called when the user presses a key, allowing subscribers to pre-process the key down event. Called before key bindings are invoked and KeyDownNotHandled is raised. SetHandledto true to stop the key from being processed further.
Called when a mouse event occurs within the view's Viewport.
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
RenderCell(Attribute, string, bool)
Override to provide custom multi colouring to cells. Use Driver to withAddStr(string). 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 useColorGetter For changing the content that is rendered useRepresentationGetter
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.
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(Point, out int?, out int?)
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.
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 int?)
. 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 int?, out int?)
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 inTable. 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 pressingCellActivationKey
This event is raised when a cell is toggled (see Select
This event is raised when the selected cell in the table changes.