Class TGUITable

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type TGUITable = class(TGUIElement)

Description

Default list box GUI element.

Hierarchy

Overview

Methods

Public function AddRow(RowIndex: LongWord): LongWord; inline;
Public function GetCellData(RowIndex, ColumnIndex: LongWord): Pointer; inline;
Public function GetCellText(RowIndex, ColumnIndex: LongWord): StringType; inline;
Public procedure AddColumn(const Caption: StringType; ColumnIndex: LongInt=-1); inline;
Public procedure Clear; inline;
Public procedure ClearRows; inline;
Public procedure OrderRows(ColumnIndex: LongInt = -1; OrderingMode: TGUIOrderingMode=omNone); inline;
Public procedure RemoveColumn(ColumnIndex: LongWord); inline;
Public procedure RemoveRow(RowIndex: LongWord); inline;
Public procedure SetActiveColumn(NColumn: LongInt; DoOrder: Boolean); overload; inline;
Public procedure SetCellColor(RowIndex, ColumnIndex: LongWord; Color: TARGBColor); inline;
Public procedure SetCellData(RowIndex, ColumnIndex: LongWord; Data: Pointer); inline;
Public procedure SetCellText(RowIndex, ColumnIndex: LongWord; const Text: StringType); overload; inline;
Public procedure SetCellText(RowIndex, ColumnIndex: LongWord; const Text: StringType; Color: TARGBColor); overload; inline;
Public procedure SetColumnOrdering(ColumnIndex: LongWord; OrderingMode: TGUIColumnOrdering); inline;
Public procedure SetColumnWidth(ColumnIndex, Width: LongWord); inline;
Public procedure SwapRows(Index1, Index2: LongWord); inline;

Properties

Public property ActiveColumn: LongInt read GetActiveColumn write SetActiveColumn;
Public property ActiveColumnOrdering: TGUIOrderingMode read GetActiveColumnOrdering write SetActiveColumnOrdering;
Public property ColumnCount: LongInt read GetColumnCount;
Public property DrawFlags: LongWord read GetDrawFlags write SetDrawFlags;
Public property ResizableColumns: Boolean read HasResizableColumns write SetResizableColumns;
Public property RowCount: LongInt read GetRowCount;
Public property SelectedRow: LongInt read GetSelected write SetSelected;

Description

Methods

Public function AddRow(RowIndex: LongWord): LongWord; inline;

Adds a new row to the table.

Parameters
RowIndex
Index after which the row will be inserted. If a row already exists at this position, the new one will be placed after it. If the index exceeds the current number of rows by more than 1, no action is performed. Note that adding a row at any position but the end might yield performance issues.
Returns

The index of the newly inserted row.

Public function GetCellData(RowIndex, ColumnIndex: LongWord): Pointer; inline;

Returns the user-defined data associated with a cell.
This value may be set using SetCellData.

Parameters
RowIndex
The cell's row index.
ColumnIndex
The cell's column index.
Returns

The data pointer.

Public function GetCellText(RowIndex, ColumnIndex: LongWord): StringType; inline;

Returns the content of a cell.
This value may be set using SetCellText.

Parameters
RowIndex
The cell's row index.
ColumnIndex
The cell's column index.
Returns

The content.

Public procedure AddColumn(const Caption: StringType; ColumnIndex: LongInt=-1); inline;

Adds a new column.

Parameters
Caption
the head line of the new column.
ColumnIndex
The index at which the column will be insertet. If this parameter is outside the current range, the new colum will be added at the end.
Public procedure Clear; inline;

Clears the table, deleting all rows and columns

Public procedure ClearRows; inline;

Deletes all rows, but preserves the columns

Public procedure OrderRows(ColumnIndex: LongInt = -1; OrderingMode: TGUIOrderingMode=omNone); inline;

Sorts the table by a column.
You need to explicitly tell the table to re order the rows when a new row is added or the cells data is changed. This makes the system more flexible and doesn't make you pay the cost of ordering when adding a lot of rows.

Parameters
ColumnIndex
The index of the column to sort by. When set to -1, the active column is used.
OrderingMode
Overrides the column's ActiveColumnOrdering if set to any value but omNone.
Public procedure RemoveColumn(ColumnIndex: LongWord); inline;

Removes a column from the table.

Parameters
ColumnIndex
The zero-based index of the column.
Public procedure RemoveRow(RowIndex: LongWord); inline;

Removes a row from the table.

Parameters
RowIndex
The zero-based index of the row.
Public procedure SetActiveColumn(NColumn: LongInt; DoOrder: Boolean); overload; inline;

Makes a column active. This will trigger an ordering process.

Parameters
NColumn
The id of the column to activate.
DoOrder
Order the table by the ordering mode of the activated column. See OrderRows for details.
Public procedure SetCellColor(RowIndex, ColumnIndex: LongWord; Color: TARGBColor); inline;

Sets a cell's text color.

Parameters
RowIndex
The cell's row index.
ColumnIndex
The cell's column index.
Color
The color to set.
Public procedure SetCellData(RowIndex, ColumnIndex: LongWord; Data: Pointer); inline;

Sets a cell's user-defined data tag.

Parameters
RowIndex
The cell's row index.
ColumnIndex
The cell's column index.
Data
The data tag. This pointer is never dereferenced, so it may safely contain an invalid value like a casted Integer.
Public procedure SetCellText(RowIndex, ColumnIndex: LongWord; const Text: StringType); overload; inline;

Sets a cell's text.

Parameters
RowIndex
The cell's row index.
ColumnIndex
The cell's column index.
Text
The text to set.
Public procedure SetCellText(RowIndex, ColumnIndex: LongWord; const Text: StringType; Color: TARGBColor); overload; inline;

Sets a cell's text and text color.

Parameters
RowIndex
The cell's row index.
ColumnIndex
The cell's column index.
Text
the new text.
Color
The new color.
Public procedure SetColumnOrdering(ColumnIndex: LongWord; OrderingMode: TGUIColumnOrdering); inline;

This tells the table control which ordering mode should be used when a column header is clicked.

Parameters
ColumnIndex
The index of the column header.
OrderingMode
The new column ordering.
Public procedure SetColumnWidth(ColumnIndex, Width: LongWord); inline;

Sets the width of a column.

Parameters
ColumnIndex
The column's index.
Width
The new width in pixels.
Public procedure SwapRows(Index1, Index2: LongWord); inline;

Swaps two rows.
This may be useful for custom sorting algorithms.

Properties

Public property ActiveColumn: LongInt read GetActiveColumn write SetActiveColumn;

The currently active column header.
Setting this property equals calling SetActiveColumn(Column, False).

Public property ActiveColumnOrdering: TGUIOrderingMode read GetActiveColumnOrdering write SetActiveColumnOrdering;

Specifies the method used to sort the column when OrderRows is called.

Public property ColumnCount: LongInt read GetColumnCount;

The currrent number of columns.

Public property DrawFlags: LongWord read GetDrawFlags write SetDrawFlags;

A combination of TGUITableDrawFlags specifying the layout.
Example: DrawFlags := tdfRows or tdfColumns;

Public property ResizableColumns: Boolean read HasResizableColumns write SetResizableColumns;

Specifies whether the column width can be adjusted by the user using drag'n'drop.

Public property RowCount: LongInt read GetRowCount;

The current number of rows.

Public property SelectedRow: LongInt read GetSelected write SetSelected;

The index of the selected row.


Generated by PasDoc 0.12.1 on 2012-09-14 17:32:22