[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] |
[Properties (by Name)] [Methods (by Name)] [Events (by Name)]
Implements the base class for grid controls.
Source position: grids.pas line 722
type TCustomGrid = class(TCustomControl) |
||
protected |
||
|
Member with the current state for the grid (edited, updated, etc.). |
|
function RTLSign; |
|
Gets the positive or negative multiplier used to adjust scroll values for BiDi mode. |
class procedure WSRegisterClass; override; |
|
Registers this component class with the current WidgetSet. |
procedure AddSelectedRange; |
|
Adds the current selection range to the array of rectangles in Selections. |
procedure AdjustClientRect(); override; |
|
Adjusts the client rectangle and sets the grid flag to reflect the change. |
procedure AdjustEditorBounds(); virtual; |
|
Updates the selected cell and sets the bounds for the optional cell Editor. |
procedure AfterMoveSelection(); virtual; |
|
Signals the OnAfterSelection event handler. |
procedure AssignTo(); override; |
|
Stores properties from the current grid class instance to the specified target. |
procedure AutoAdjustColumn(); virtual; |
|
Adjusts column properties to accommodate the largest value in the specified column. |
procedure BeforeMoveSelection(); virtual; |
|
Performs actions needed before a selection is moved. |
procedure BeginAutoDrag; override; |
|
Starts an auto-drag operation in the grid control. |
function BoxRect(); |
|
Gets the rectangle for the box around the cell at the given coordinates. |
procedure CacheMouseDown(); |
|
Updates cached grid information when a mouse click occurs in the grid control. |
procedure CalcAutoSizeColumn(); virtual; |
|
Automatically calculates the size for the column at the specified position. |
procedure CalcCellExtent(); virtual; overload; deprecated ; |
|
Deprecated. |
procedure CalcFocusRect(); |
|
Calculates the bounds for a focus rectangle in the grid control. |
procedure CalcMaxTopLeft; |
|
Updates cached grid information for the visible area and scrollbars in the control. |
procedure CalcScrollbarsRange; |
|
Updates the range, page, and thumb position for visible scrollbars. |
procedure CalculatePreferredSize(); override; |
|
Gets the preferred width and height for the control. |
function CanEditShow; virtual; |
|
Indicates whether the cell editor can be displayed and focused in the current column. |
function CanGridAcceptKey(); virtual; |
|
Returns True if the grid is able to accept the given key. |
procedure CellClick(); virtual; |
|
Processes a mouse click in the cell at the given coordinates. |
procedure CellExtent(); |
|
Gets the last column number for the cell extent at the specified column and row. |
procedure CheckLimits(); |
|
Checks column and row limits for the specified cell. |
procedure CheckLimitsWithError(); |
|
Checks column and row limits for the specified cell, with error trapping. |
procedure CMBiDiModeChanged(); message; |
|
Handles the CM_BIDIMODECHANGED control message for the grid control. |
procedure CMMouseEnter(); message; |
|
Handles the control message posted when the mouse enters a cell in the grid. |
procedure CMMouseLeave(); message; |
|
Handles the control message posted when a mouse leaves a cell. |
procedure ColRowDeleted(); virtual; |
|
Performs actions when a column or a row is deleted from the control. |
procedure ColRowExchanged(); virtual; |
|
Performs a notification when column or row data is exchanged in the grid. |
procedure ColRowInserted(); virtual; |
|
Performs a notification when column or row data is inserted in the grid. |
procedure ColRowMoved(); virtual; |
|
Performs a notification when column or row data is moved in the grid. |
function ColRowToOffset(); |
|
Converts a column or row index to starting and ending pixels coordinates. |
function ColumnIndexFromGridColumn(); |
|
Gets the position of the specified column relative to the first column in the grid. |
function ColumnFromGridColumn(); |
|
Returns the actual grid column given its index. |
procedure ColumnsChanged(); |
|
Performs actions needed when one or more columns in the grid are changed. |
procedure ColWidthsChanged; virtual; |
|
Performs actions needed when the widths for grid columns have been changed. |
function CreateColumns; virtual; |
|
Allocates and configures resources for the Columns collection. |
procedure CheckNewCachedSizes(); virtual; |
|
Checks the values for cached column sizes when have been reset in the grid. |
procedure CreateWnd; override; |
|
Creates and configures the widgetset handle for the grid control. |
procedure CreateParams(); override; |
|
Initializes the window creation parameter record with the settings for the control. |
procedure Click; override; |
|
Performs actions when a mouse click occurs in the grid control. |
procedure DblClick; override; |
|
Performs actions needed to handle mouse double click events in the control. |
function DefaultColWidthIsStored; |
|
Indicates if the DefaultColWidth property is available in component streaming. |
function DefaultRowHeightIsStored; |
|
Indicates if the DefaultRowHeight property is available in component streaming. |
procedure DefineProperties(); override; |
|
Defines non-published properties included during LCL component streaming. |
procedure DestroyHandle; override; |
|
Destroys the handle for the control and all child controls. |
function DialogChar(); override; |
|
Applies an accelerator key for a column in the grid. |
function DoCompareCells(); virtual; |
|
Performs a comparison between the specified cells in the grid control. |
procedure DoCopyToClipboard; virtual; |
|
Copies the selected data to the clipboard. |
procedure DoCutToClipboard; virtual; |
|
Cuts the data from its current site and places it in the clipboard. |
procedure DoEditButtonClick(); virtual; |
|
Performs actions needed when the button for editor control is clicked. |
procedure DoEditorHide; virtual; |
|
Performs actions needed to hide the cell Editor in the grid control. |
procedure DoEditorShow; virtual; |
|
Performs actions needed to show the cell Editor for the grid control. |
procedure DoExit; override; |
|
Signals the OnExit event handler (when assigned) when the control loses focus. |
procedure DoEnter; override; |
|
Signals the OnEnter event handler (when assigned) when the control receives focus. |
procedure DoLoadColumn(); virtual; |
|
Signals the OnLoadColumn event handler for the grid control. |
procedure DoSaveColumn(); virtual; |
|
Signals the OnSaveColumn event handler for the grid control. |
function DoMouseWheel(); override; |
|
Applies mouse wheel options and handles a mouse wheel operation. |
function DoMouseWheelDown(); override; |
|
Invokes the OnMouseWheelDown handler. |
function DoMouseWheelUp(); override; |
|
Invokes the OnMouseWheelUp handler. |
function DoMouseWheelLeft(); override; |
|
Performs the OnMouseWheelLeft event handler. |
function DoMouseWheelRight(); override; |
|
Performs the OnMouseWheelRight event handler. |
procedure DoAutoAdjustLayout(); override; |
|
Performs actions to apply the auto-layout policy with the specified scaling. |
procedure DoOnChangeBounds; override; |
|
Signals OnChangeBounds event handlers for the control. |
procedure DoOPDeleteColRow(); |
|
Performs a delete operation for a column or a row. |
procedure DoOPExchangeColRow(); |
|
Performs an exchange for the columns or rows with the specified indexes. |
procedure DoOPInsertColRow(); |
|
Performs an inserting for a column or a row at the specified position. |
procedure DoOPMoveColRow(); |
|
Performs a move operation for the column or row at the specified position. |
procedure DoPasteFromClipboard; virtual; |
|
Pastes data from the clipboard into the current cell. |
procedure DoPrepareCanvas(); virtual; |
|
Performs actions needed to prepare the canvas for a drawing operation. |
procedure DoOnResize; override; |
|
Performs actions needed when the grid control is resized. |
procedure DoSetBounds(); override; |
|
Internal function to set the control's bounds (Left, Top, Height, Width). |
function DoUTF8KeyPress(); override; |
|
Applies a UTF-8-encoded character to the active cell editor in the control. |
procedure DrawBorder; |
|
Draws the border for the grid control. |
procedure DrawAllRows; virtual; |
|
Draws all of the rows for the grid. |
procedure DrawFillRect(); |
|
Draws the fill rectangle on the specified canvas. |
procedure DrawCell(); virtual; |
|
Draws a cell using a given state at the specified grid location (Col, Row, rectangle). |
procedure DrawCellGrid(); virtual; |
|
Draws cell grid lines for the control. |
procedure DrawTextInCell(); virtual; |
|
Draws the text for a non-fixed cell in the grid. |
procedure DrawThemedCell(); |
|
Draws a cell using the theme services for the specified grid drawing state. |
procedure DrawCellText(); virtual; |
|
Draws the specified text in the given text rectangle. |
procedure DrawGridCheckboxBitmaps(); virtual; |
|
Draws a checkbox bitmap which represents the given state in a cell. |
procedure DrawButtonCell(); |
|
Draws a cell in a button-style column. |
procedure DrawColRowMoving; |
|
Draws a column or row when dragging is in effect. |
procedure DrawColumnText(); virtual; |
|
Draws the text and image for a grid column title at the specified cell coordinates. |
procedure DrawColumnTitleImage(); |
|
Draws the image(s) used in the column title at the specified index in the grid. |
procedure DrawEdges; |
|
Draws the edges (and filled background) of the client area for the control. |
procedure DrawFocusRect(); virtual; |
|
Draws the focus rectangle for the specified cell. |
procedure DrawRow(); virtual; |
|
Draws the columns for the specified row in the grid control. |
procedure EditButtonClicked(); |
|
Signals the OnEditButtonClick or OnButtonClick event handler (when assigned). |
procedure EditordoGetValue; virtual; |
|
Gets the value for the cell Editor. |
procedure EditordoResetValue; virtual; |
|
Resets the value in the selected cell when a visible editor is cancelled or hidden. |
procedure EditordoSetValue; virtual; |
|
Sets the mask and value for a visible cell editor in the grid control. |
function EditorCanAcceptKey(); virtual; |
|
Returns True if the Editor is able to accept the specified UTF-8 key. |
function EditorIsReadOnly; virtual; |
|
Determines if the current column number is defined as read-only. |
procedure EditorHide; virtual; |
|
Hides a visible cell editor in the grid control. |
function EditorLocked; |
|
Returns True if the Editor is locked, i.e. unable to accept input or make changes. |
function EditingAllowed(); virtual; |
|
Indicates if the grid and specified column allow editing. |
procedure EditorSelectAll; |
|
Performs actions to select the entire content in the current cell. |
procedure EditorShow(); virtual; |
|
Displays the Editor for the selected cell. |
procedure EditorShowInCell(); virtual; |
|
Shows the cell content for the Editorin situ. |
procedure EditorWidthChanged(); virtual; |
|
Performs actions needed when the width for a cell Editor has been changed. |
function FirstGridColumn; virtual; |
|
Gets the position of the first column after any fixed columns in the grid. |
function FixedGrid; |
|
Determines if all columns or all rows in the grid are fixed. |
procedure FontChanged(); override; |
|
Performs actions needed when the font for the control is changed. |
procedure GetAutoFillColumnInfo(); virtual; |
|
Gets auto-fill information for the specified column. |
function GetCellHintText(); virtual; |
|
Gets the hint for the specified cell using the Options enabled in the grid control. |
function GetCells(); virtual; |
|
Gets the cell content at the specified column and row numbers. |
function GetColumnAlignment(); |
|
Gets the horizontal Alignment for the specified column. |
function GetColumnColor(); |
|
Gets the Color used to render the background for the specified column number. |
function GetColumnFont(); |
|
Gets the font used to render values for the specified column. |
function GetColumnLayout(); |
|
Gets the vertical text Layout value for the specified column. |
function GetColumnReadonly(); |
|
Returns True if the column is marked as ReadOnly. |
function GetColumnTitle(); |
|
Gets the text displayed as the column title for the specified column number. |
function GetColumnWidth(); |
|
Gets the width of the column at the specified column number. |
function GetDeltaMoveNext(); virtual; |
|
Returns the relative cell coordinates for the next cell in the grid navigation order. |
function GetDefaultColumnAlignment(); virtual; |
|
Gets the default horizontal alignment used for values in the grid control. |
function GetDefaultColumnWidth(); virtual; |
|
Gets the default width used for the specified column. |
function GetDefaultColumnLayout(); virtual; |
|
Gets the default vertical layout for text in the specified column. |
function GetDefaultColumnReadOnly(); virtual; |
|
Gets the default setting for the ReadOnly flag in the specified column number. |
function GetDefaultColumnTitle(); virtual; |
|
Gets the default text used as the column title for the specified column number. |
function GetDefaultEditor(); virtual; |
|
Gets the default cell editor for the specified column. |
function GetDefaultRowHeight; virtual; |
|
Gets the default height for a row in the grid control. |
function GetGridDrawState(); |
|
Gets the grid drawing state for the cell with the specified column and row numbers. |
procedure GetImageForCheckBox(); virtual; |
|
Gets the bitmap used to draw Checkbox columns in the grid. |
function GetScrollBarPosition(); |
|
Gets the position for the specified scrollbar. |
function GetSmoothScroll(); virtual; |
|
Gets the smooth scroll setting in the Options for the grid. |
procedure GetSBVisibility(); virtual; |
|
Gets the values for the scrollbar visibility flags in the control. |
procedure GetSBRanges(); virtual; |
|
Gets the range values for the scrollbars when visible. |
procedure GetSelectedState(); virtual; |
|
Gets the effective selected state using the control Options and the grid draw state. |
function GetEditMask(); virtual; |
|
Gets the edit mask for the specified cell. |
function GetEditText(); virtual; |
|
Gets the text displayed in the Editor for the specified cell. |
function GetFixedcolor; virtual; |
|
Gets the value for the FixedColor property. |
function GetFirstVisibleColumn; |
|
Gets the column number for the first visible non-fixed column in the grid. |
function GetFirstVisibleRow; |
|
Gets the row number for the first visible non-fixed row in the grid. |
function GetLastVisibleColumn; |
|
Gets the column number for the last visible non-fixed column in the grid. |
function GetLastVisibleRow; |
|
Gets the row number for the last visible non-fixed row in the grid. |
function GetSelectedColor; virtual; |
|
Gets the value for the SelectedColor property. |
function GetTitleShowPrefix(); |
|
Gets the prefix option for the title in the specified column number. |
function GetPxTopLeft; |
|
Gets a TPoint instance with the top and left coordinates for the first visible, non-fixed row in the grid control. |
function GetTruncCellHintText(); virtual; |
|
Gets the truncated version of the hint for the cell at the specified position. |
function GridColumnFromColumnIndex(); |
|
Returns the column number for the column given its index position. |
procedure GridMouseWheel(); virtual; |
|
Performs actions needed when the mouse wheel is scrolled in the grid. |
procedure HeaderClick(); virtual; |
|
Performs actions needed when a mouse click occurs in a header for a grid column. |
procedure HeaderSized(); virtual; |
|
Performs actions needed when a column or a row has been resized. |
procedure HeaderSizing(); virtual; |
|
Performs actions to resize a column or row to the specified size. |
procedure HideCellHintWindow; |
|
Cancels the current hint display and restores the saved hint for the grid control. |
procedure InternalSetColCount(); |
|
Performs actions needed to set the column count in the grid control. |
procedure InvalidateCell(); |
|
Renders a cell invalid, and redraws the cell if required. |
procedure InvalidateFromCol(); |
|
Invalidates cells starting at the specified column number; all rows from the start position are affected. |
procedure InvalidateGrid; |
|
Invalidates the client area for the grid control. |
procedure InvalidateFocused; |
|
Invalidates a focused or highlighted cell or row. |
function IsColumnIndexValid(); |
|
Indicates if the specified index position is valid for the columns in the grid. |
function IsRowIndexValid(); |
|
Indicates if the specified index position is valid for the rows in the grid. |
function IsColumnIndexVariable(); |
|
True when the column index is in the range FixedCols..ColCount-1. |
function IsRowIndexVariable(); |
|
Indicates if the specified row is a valid, non-fixed row in the grid control. |
function GetIsCellTitle(); virtual; |
|
Indicates if the cell at the specified position is a fixed column header. |
function GetIsCellSelected(); virtual; |
|
Gets the value for the indexed IsCellSelected property. |
function IsEmptyRow(); |
|
Indicates if non-fixed cells in the specified row are empty. |
function IsMouseOverCellButton(); |
|
Indicates if the specified mouse position is over a button cell editor. |
procedure KeyDown(); override; |
|
Handles key down events for the grid control. |
procedure KeyUp(); override; |
|
Signals the OnKeyUp event handler (when assigned). |
procedure KeyPress(); override; |
|
Applies the specified key press to the control. |
procedure LoadContent(); virtual; |
|
Loads values for the grid from the specified XML configuration file. |
procedure LoadGridOptions(); virtual; |
|
Loads design-time grid options for an LCL version from an XML configuration file. |
procedure Loaded; override; |
|
Performs actions when the component has been loaded using LCL component streaming. |
procedure LockEditor; |
|
Locks the Editor so that it cannot accept input or changes. |
function MouseButtonAllowed(); virtual; |
|
Indicates if the specified mouse button is a mouse down event used in the control. |
procedure MouseDown(); override; |
|
Handles mouse down events for the grid control. |
procedure MouseMove(); override; |
|
Applies a change in the mouse pointer position to the grid control. |
procedure MouseUp(); override; |
|
Handles a mouse up event for the grid control. |
function MoveExtend(); |
|
Moves the selected cell or extends a selection using the specified column and row values. |
function MoveNextAuto(); |
|
Moves to the next cell in the auto-advance sequence. |
function MoveNextSelectable(); virtual; |
|
Moves to the next selectable cell. |
procedure MoveSelection; virtual; |
|
Signals the OnSelection event handler for a new mouse selection. |
procedure Notification(); override; |
|
Performs actions needed when the specified component is added to or removed from the control. |
function OffsetToColRow(); |
|
Moves to a column or row located at the specified offset. |
procedure Paint; override; |
|
Draws the edges, borders, and rows in the grid control. |
procedure PickListItemSelected(); |
|
Signals the OnPickListSelect event handler when a selection is made in a picklist. |
procedure PrepareCanvas(); virtual; |
|
Prepares the canvas for drawing the cell at the specified location. |
procedure PrepareCellHints(); virtual; |
|
Prepares the control to display hints for a cell. |
procedure ResetDefaultColWidths; virtual; |
|
Restores the default width for columns in the grid. |
procedure ResetEditor; |
|
Resets the value in the cell Editor, and optionally re-displays and selects it content. |
procedure ResetLastMove; |
|
Resets the member used to track the last row or column movement. |
function ResetOffset(); |
|
Resets the offset, checking columns and rows if needed. |
procedure ResetSizes; virtual; |
|
Resets the internal column sizes. |
procedure ResizeColumn(); |
|
Resizes the specified column number to the given width. |
procedure ResizeRow(); |
|
Resizes the specified row number to the given height. |
procedure RowHeightsChanged; virtual; |
|
Performs actions needed when the values in RowHeights have been changed. |
procedure SaveContent(); virtual; |
|
Saves design-time configuration, column, and row settings to an XML file. |
procedure SaveGridOptions(); virtual; |
|
Saves grid options to the specified XML configuration file. |
procedure ScrollBarRange(); |
|
Sets the range for the specified scrollbar. |
procedure ScrollBarPosition(); |
|
Sets the position for the specified scrollbar to the given value. |
function ScrollBarIsVisible(); |
|
Returns True if the specified scrollbar is visible. |
procedure ScrollBarPage(); |
|
Performs a page movement of the specified scrollbar. |
procedure ScrollBarShow(); |
|
ScrollBarShow method. |
function ScrollBarAutomatic(); virtual; |
|
Indicates whether an automatic scroll bar of the given type is used on the grid control. |
procedure ScrollBy(); override; |
|
Scrolls the non-fixed area for the control by the specified delta values. |
procedure SelectEditor; virtual; |
|
Gets the cell editor for the current cell, and sets its PopupMenu. |
function SelectCell(); virtual; |
|
Determines whether the specified cell can be selected in the grid control. |
procedure SetCanvasFont(); |
|
Sets the Canvas font to the specified value. |
procedure SetColCount(); virtual; |
|
Sets the value in the ColCount property. |
procedure SetColor(); override; |
|
Sets the value in the Color property. |
procedure SetColRow(); |
|
Makes the specified column and row the selected cell in the grid. |
procedure SetCursor(); override; |
|
Changes the cursor shape in the grid to the specified value. |
procedure SetEditText(); virtual; |
|
Sets the value used in the cell Editor to the specified text. |
procedure SetBorderStyle(); override; |
|
Sets the value for the BorderStyle property. |
procedure SetFixedcolor(); virtual; |
|
Sets the value for the FixedColor property. |
procedure SetFixedCols(); virtual; |
|
Sets the value for the FixedCols property. |
procedure SetFixedRows(); virtual; |
|
Sets the value for the FixedRows property. |
procedure SetRawColWidths(); |
|
Sets the width for the specified column number in the internal list. |
procedure SetSelectedColor(); virtual; |
|
Sets the value for the SelectedColor property. |
procedure ShowCellHintWindow(); |
|
Gets and displays the cell hint(s) for the current cell in the grid. |
procedure SizeChanged(); virtual; |
|
Performs actions needed when the number or columns or rows has been changed. |
procedure Sort(); virtual; |
|
Sorts rows or columns in the grid. |
procedure StartPushCell; |
|
Starts an operation to render a cell in its "pushed" state. |
procedure TopLeftChanged; virtual; |
|
Signals the OnTopLeftChanged event handler (when assigned) at run-time. |
function TryMoveSelection(); |
|
Tries to move the selection by the specified offset; returns True if successful. |
procedure UnLockEditor; |
|
Decrements the lock count for the cell Editor following a call to LockEditor. |
procedure UnprepareCellHints; virtual; |
|
Re-implemented in descendent classes. |
procedure UpdateHorzScrollBar(); virtual; |
|
Updates the horizontal scrollbar to use the specified range, page, and position. |
procedure UpdateSelectionRange; |
|
Updates the selection range when the grid has changed. |
procedure UpdateVertScrollbar(); virtual; |
|
Updates the vertical scrollbar to use the specified visibility, range, and page values. |
procedure UpdateBorderStyle; |
|
Updates the border style used for the control. |
function ValidateEntry(); virtual; |
|
Validates the value for the specified cell. |
procedure VisualChange; virtual; |
|
Updates the grid after changes to the visual properties in the control. |
procedure WMSize(); message; |
|
Handles a WM_SIZE window message for the control. |
procedure WMHScroll(); message; |
|
Handle the system message for horizontal scrolling. |
procedure WMVScroll(); message; |
|
Handles the system message for vertical scrolling. |
procedure WMKillFocus(); message; |
|
Handles the LM_KILLFOCUS message for the control. |
procedure WMSetFocus(); message; |
|
Handler for receiving Focus event. |
procedure WndProc(); override; |
|
The general message handler for this control. |
property AllowOutboundEvents: Boolean; [rw] |
|
Allows a mouse click on an out-of-bounds cell; moves cursor to nearest valid cell. |
property AlternateColor: TColor; [rws] |
|
Color used for the background in alternate rows in the grid. |
property AutoAdvance: TAutoAdvance; [rw] |
|
Direction used when automatically moving the selection to the next selectable cell. |
property AutoEdit: Boolean; [rw] |
|
Indicates if edit mode is automatically entered when a cell is selected. |
property AutoFillColumns: Boolean; [rw] |
|
Automatically resizes columns so they fill all of the visible area in the grid. |
property BorderStyle: TBorderStyle; [rw] |
|
Drawing style used for the borders on the control. |
property BorderColor: TColor; [rw] |
|
The color used for the border on the control. |
property CellHintPriority: TCellHintPriority; [rw] |
|
Identifies how text is combined to form the Hint property. |
property Col: Integer; [rw] |
|
Column index for the selected grid cell. |
property ColCount: Integer; [rw] |
|
Number of columns in the grid. |
property ColRow: TPoint; [rw] |
|
Provides access to current column and row numbers as a TPoint instance. |
property ColRowDraggingCursor: TCursor; [rw] |
|
Cursor shape displayed when a column is dragged. |
property ColRowDragIndicatorColor: TColor; [rw] |
|
Color used to render the drag cursor when a column or row is dragged in the grid. |
property ColSizingCursor: TCursor; [rw] |
|
Cursor shape displayed when a column is resized. |
property ColumnClickSorts: Boolean; [rw] |
|
Indicates if clicking a column header changes its sort order. |
property Columns: TGridColumns; [rws] |
|
Definitions for the columns in the grid. |
property ColWidths []: Integer; [rw] |
|
Provides indexed access to the Width of the column in the grid. |
property DefaultColWidth: Integer; [rws] |
|
Default width used for newly created grid columns. |
property DefaultRowHeight: Integer; [rws] |
|
Default row height for newly created grid rows. |
property DefaultDrawing: Boolean; [rw] |
|
Indicates if the default drawing mechanism is used to draw the background for cells. |
property DefaultTextStyle: TTextStyle; [rw] |
|
Default style used to display text; includes alignment, layout, and wrapping. |
property DisabledFontColor: TColor; [rw] |
|
Color used to draw text in the grid when Enabled is set to False. |
property DragDx: Integer; [rw] |
|
The amount (DeltaX) by which an object should be dragged. |
property Editor: TWinControl; [rw] |
|
The editor used to modify the value in the current cell. |
property EditorBorderStyle: TBorderStyle; [rw] |
|
The border style for the Editor control. |
property EditorMode: Boolean; [rw] |
|
True when the Editor is ready to modify the value for the current cell. |
property EditorKey: Boolean; [rw] |
|
Indicates if the last key event was triggered by the cell Editor for the grid control. |
property EditorOptions: Integer; [rw] |
|
The option flags sent to the Editor control in the grid. |
property EditorShowing: Boolean; [rw] |
|
True when the cell Editor for the grid control has been displayed. |
property ExtendedColSizing: Boolean; [rw] |
|
Indicates if extended column sizing is enabled in the grid. |
property ExtendedRowSizing: Boolean; [rw] |
|
Indicates if extended row sizing is enabled for rows in the grid. |
property ExtendedSelect: Boolean; [rw] |
|
Indicates whether a selection can extend beyond the visible boundary for he grid. |
property FastEditing: Boolean; [rw] |
|
Indicates if "Fast Editing" is enabled in the grid. |
property AltColorStartNormal: Boolean; [rw] |
|
Indicates if alternate row coloring starts with the normal row color. |
property FixedCols: Integer; [rw] |
|
The number of fixed columns in the grid. |
property FixedRows: Integer; [rw] |
|
Number of the fixed rows in the grid. |
property FixedColor: TColor; [rw] |
|
The color used for the fixed cells in the grid. |
property FixedGridLineColor: TColor; [rw] |
|
Color used to draw lines around fixed grid cells. |
property FixedHotColor: TColor; [rw] |
|
The color used for selected, hot-lighted, etc. fixed cells in the grid. |
property Flat: Boolean; [rw] |
|
Indicates if cells are displayed using a Flat appearance. |
property FocusColor: TColor; [rw] |
|
The color used for a cell when it has focus. |
property FocusRectVisible: Boolean; [rw] |
|
Indicates if the focus rectangle is visible for the control. |
property GCache: TGridDataCache; [r] |
|
Contains cached data about the visual layout and state for the grid control. |
property GridFlags: TGridFlags; [rw] |
|
Contains grid-specific state flags active for the control. |
property GridHeight: Integer; [r] |
|
Total height for all of the rows in the grid control. |
property GridLineColor: TColor; [rw] |
|
Color used for the grid lines on the control. |
property GridLineStyle: TPenStyle; [rw] |
|
Style used to draw the grid lines on the control. |
property GridLineWidth: Integer; [rw] |
|
Width (thickness) for grid lines drawn on the control. |
property GridWidth: Integer; [r] |
|
Total width for all columns in the Grid including non-visible columns. |
property HeaderHotZones: TGridZoneSet; [rw] |
|
'Hot' zones for cell headers that can be selected, clicked, or ignored. |
property HeaderPushZones: TGridZoneSet; [rw] |
|
"Hot" zones for cell headers that have been selected or "pushed" in the grid. |
property ImageIndexSortAsc: TImageIndex; [rw] |
|
Ordinal position for the image used for columns sorted in ascending order. |
property ImageIndexSortDesc: TImageIndex; [rw] |
|
Ordinal position of the image used for columns sorted in descending order. |
property TabAdvance: TAutoAdvance; [rw] |
|
Controls the behavior for Tab navigation in the grid control. |
property TitleImageList: TImageList; [rw] |
|
The list with images displayed in column titles. |
property TitleImageListWidth: Integer; [rw] |
|
Stores the default width for images used in the title area for fixed cells. |
property InplaceEditor: TWinControl; [r] |
|
Cell editor for the grid control. |
property IsCellSelected []: Boolean; [r] |
|
Provides indexed access to the selected state for a cell by its column and row number. |
property LeftCol: Integer; [rw] |
|
Column number for the first visible column on the left edge of the grid. |
property MouseWheelOption: TMouseWheelOption; [rw] |
|
Sets the mouse wheel behavior for the grid control. |
property Options: TGridOptions; [rw] |
|
Contains the set of optional features and/or behaviors enabled for the grid. |
property Options2: TGridOptions2; [rw] |
|
Contains additional options enabled for the grid control. |
property RangeSelectMode: TRangeSelectMode; [rw] |
|
Controls the range selection mode used for the grid. |
property Row: Integer; [rw] |
|
Row number for the selected grid cell. |
property RowCount: Integer; [rw] |
|
Number of rows in the grid. |
property RowSizingCursor: TCursor; [rw] |
|
Cursor shape displayed when the row height is changed. |
property RowHeights []: Integer; [rw] |
|
Provides indexed access to the height for each row in the grid. |
property SaveOptions: TSaveOptions; [rw] |
|
Options which control the information saved and loaded for the grid control. |
property SelectActive: Boolean; [rw] |
|
Indicates if a Selection is active in the grid control. |
property SelectedColor: TColor; [rw] |
|
Color used for selected cells in the grid. |
property SelectedColumn: TGridColumn; [r] |
|
The column instance for the currently selected cell in the grid control. |
|
Rectangle with the current cell selections in the grid control. |
|
property ScrollBars: TScrollStyle; [rw] |
|
Scrollbars displayed for the grid control. |
property StrictSort: Boolean; [rw] |
|
Indicates if strict sorting is used. |
|
The font used for text in a column title. |
|
property TitleStyle: TTitleStyle; [rw] |
|
The drawing style used for the fixed column titles. |
property TopRow: Integer; [rw] |
|
The first visible row in the grid. |
property UseXORFeatures: Boolean; [rw] |
|
When True, the dotted focus rectangle is painted using an XOR raster operation. |
property ValidateOnSetSelection: Boolean; [rw] |
|
Controls validation when the text for the selected cell is changed. |
property VisibleColCount: Integer; [rs] |
|
The number of visible columns in the grid control. |
property VisibleRowCount: Integer; [rs] |
|
The number of visible rows in the grid control. |
property OnAfterSelection: TOnSelectEvent; [rw] |
|
Event handler signalled after a new Selection is made in the grid. |
property OnBeforeSelection: TOnSelectEvent; [rw] |
|
Event handler signalled before changing the Selection in the grid control. |
property OnCheckboxToggled: TToggledCheckboxEvent; [rw] |
|
Event handler signalled when the value for a Checkbox cell is toggled. |
property OnCompareCells: TOnCompareCells; [rw] |
|
Event handler signalled to compare the content in grid cells. |
property OnPrepareCanvas: TOnPrepareCanvasEvent; [rw] |
|
Event handler signalled to prepare the Canvas for drawing. |
property OnDrawCell: TOnDrawCell; [rw] |
|
Event handler signalled to draw a cell in the grid control. |
property OnEditButtonClick: TNotifyEvent; [rw] deprecated ; |
|
Event handler signalled when the button in an Editor is clicked. |
property OnButtonClick: TOnSelectEvent; [rw] |
|
Event handler signalled when a button in a column header is clicked. |
property OnPickListSelect: TNotifyEvent; [rw] |
|
Event handler signalled when an item is selected from a pick list. |
property OnSelection: TOnSelectEvent; [rw] |
|
Event handler signalled when an area is selected in the grid control. |
property OnSelectEditor: TSelectEditorEvent; [rw] |
|
Event handler signalled to select a cell Editor for the current cell. |
property OnTopLeftChanged: TNotifyEvent; [rw] |
|
Event handler signalled when the top left cell is changed. |
property OnUserCheckboxBitmap: TUserCheckBoxBitmapEvent; [rw] |
|
Event handler signalled to get the user-defined bitmap used for a checkbox cell. |
property OnUserCheckboxImage: TUserCheckBoxImageEvent; [rw] |
|
Event handler signalled to get the user-defined image used for a checkbox cell. |
property OnValidateEntry: TValidateEntryEvent; [rw] |
|
Event handler signalled to perform validation for a cell value. |
function FlipRect(); |
|
Flips coordinates in the cell rectangle when BiDi mode or RTL alignment is used. |
function FlipPoint(); |
|
Flips cell coordinates in the specified point when BiDi mode or RTL alignment is used. |
function FlipX(); |
|
Flips the horizontal position in the client when BiDi mode or RTL alignment is used. |
property OnGetCellHint: TGetCellHintEvent; [rw] |
|
Gets the hint text for a cell. |
property OnSaveColumn: TSaveColumnEvent; [rw] |
|
Event handler signalled when a column is saved in the SaveColumns method. |
property OnLoadColumn: TSaveColumnEvent; [rw] |
|
Event handler signalled when a column is loaded in the LoadColumns method. |
public |
||
constructor Create(); override; |
|
Constructor for the class instance. |
destructor Destroy; override; |
|
Destructor for the class instance. |
procedure Invalidate; override; |
|
Force a delayed Repaint of the control, by marking its visible area of the control as invalid. |
procedure EditingDone; override; |
|
Signals the OnEditingDone event handler. |
procedure AdjustInnerCellRect(); |
|
Adjusts the cell rectangle to account for grid lines drawn around a cell. |
procedure AutoAdjustColumns; virtual; |
|
Automatically adjusts columns sizes to the width of their content. |
procedure BeginUpdate; |
|
Begins an update to the grid control. |
function CellRect(); |
|
The coordinates for the specified cell (ACol, ARow) as a standard rectangle (TRect). |
function CellToGridZone(); |
|
Determines the grid zone for the specified cell. |
procedure CheckPosition; |
|
Determines if the cell can be selected, or gets a suitable position using auto-advance. |
function ClearCols; |
|
Clears the values in the FixedCols and Cols properties. |
function ClearRows; |
|
Clears the cached fixed rows and row count values for the grid control. |
procedure Clear; |
|
Clear all cells in the grid. |
procedure ClearSelections; |
|
Clears the current range selection(s) and redraws the grid control. |
function EditorByStyle(); virtual; |
|
Select a cell editor control with the specified style. |
procedure EditorKeyDown(); |
|
Implements the OnKeyDown event handler for the cell editor. |
procedure EditorKeyPress(); |
|
Implements the OnKeyPress event handler for the cell editor. |
procedure EditorUTF8KeyPress(); |
|
Implements the UTF-8 key press handler for the editor in the grid control. |
procedure EditorKeyUp(); |
|
Implements the OnKeyUp event handler for the cell editor. |
procedure EditorTextChanged(); virtual; |
|
Updates the grid control when the value in a cell Editor is changed. |
procedure EndUpdate(); |
|
Finishes an update to the grid control. |
procedure EraseBackground(); override; |
|
Clears the background for the grid control. |
procedure FixDesignFontsPPI(); override; |
|
Adjusts fonts in the control to the specified design-time PixelsPerInch. |
function Focused; override; |
|
Indicates if the grid is focused or has an active focused cell Editor. |
function HasMultiSelection; |
|
Indicates if multi-select range selection mode is enabled and in use for the grid. |
procedure HideSortArrow; |
|
Hides the arrow drawn as the sort indicator for a column. |
procedure InvalidateCol(); |
|
Invalidates all cells in the specified column, and causes them to be redrawn. |
procedure InvalidateRange(); |
|
Invalidates a cell range in the grid invalid, and causes it to be redrawn. |
procedure InvalidateRow(); |
|
Invalidates the drawing rectangle for the specified row number. |
function IsCellVisible(); |
|
Determines whether the specified cell is visible. |
function IsFixedCellVisible(); |
|
Determines if the specified cell is a visible fixed cell in the grid. |
procedure LoadFromFile(); virtual; |
|
Loads grid data from a file with the specified file name. |
procedure LoadFromStream(); virtual; |
|
Loads grid data from the specified stream. |
function MouseCoord(); |
|
Finds the mouse coordinates relative to the grid origin. |
function MouseToCell(); |
|
Converts mouse coordinates to the grid coordinates for a cell in the grid. |
function MouseToLogcell(); |
|
Converts mouse coordinates to the position for a logical cell in the grid. |
function MouseToGridZone(); |
|
Converts mouse position and cell coordinates to a grid zone. |
procedure SaveToFile(); virtual; |
|
Saves grid information to a file with the specified name. |
procedure SaveToStream(); virtual; |
|
Saves grid information to the specified stream. |
procedure ScaleFontsPPI(); override; |
|
Resizes fonts using a target PPI and a scaling factor. |
procedure SetFocus; override; |
|
Gives focus to the grid control. |
property CursorState: TGridCursorState; [r] |
|
Current cursor state for the grid control. |
property SelectedRange []: TGridRect; [r] |
|
Provides indexed access to TGridRect values in the currently selected range. |
property SelectedRangeCount: Integer; [r] |
|
Number of cell rectangles in the selected range for the grid. |
property SortOrder: TSortOrder; [rw] |
|
Controls the order used for the sort column (ascending or descending). |
property SortColumn: Integer; [r] |
|
Column number used to sort the rows in the grid. |
property TabStop: Boolean; |
|
Allows the user to navigate to this control, by pressing the Tab key. |
end; |
|
Implements the base class for grid controls. |
|
| | ||
|
The base class for windowed controls which paint themselves. |
|
| | ||
|
Implements a windowed control which can contain other child controls. |
|
| | ||
|
The base class for visible controls. |
|
| | ||
|
The base class for LCL components which have an associated widget. |
|
| | ||
TComponent |
||
? | ||
TObject |
A grid is a collection of cells that are organized in columns and rows. Grids are suitable for showing data that using a tabular layout. For example: tables in a database, or formulae and data in a spreadsheet.
Key properties:
The ColCount and RowCount properties contain the column and row count of the grid.
The FixedCols and FixedRows properties specify the count of fixed columns or rows that are used for headings.
The column widths and row heights of the grid are accessible with the ColWidths and RowHeights properties.
The DefaultColWidth and DefaultRowHeight properties are used to specify default column widths or row heights respectively.
The colors of the cells and the grid elements are specified with the AlternateColor, BorderColor, FixedColor, FixedHotColor, FocusColor, GridLineColor and SelectedColor properties. The GridWidth and GridHeight properties contain the dimension of the entire grid.
The ScrollBars controls the creation of scrollbars for the grid.
The LeftCol, TopRow, VisibleColCount and VisibleRowCount properties contain information about the visible area of the grid.
The Options controls options for the grid.
Key methods and events:
If the user highlights a cell of the grid, the SelectCell method is called that triggers the OnSelectCell event. The position of the highlighted cell is stored within the Col and Row property.
The MouseToCell method calculates a grid cell from a given screen position.
Huge changes to the grid should be encapsulated in calls to BeginUpdate and EndUpdate to speed up the application.
Component developers must override the DrawCell method in customized grids.
|
Implements a specialized grid for displaying textual content. |
|
|
Implements a custom-drawn grid control. |
|
|
How to use Grids including StringGrids, DrawGrids and DbGrids. |