[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] Reference for unit 'Grids' (#lcl)

TDrawGrid

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Implements a custom-drawn grid control.

Declaration

Source position: grids.pas line 1591

type TDrawGrid = class(TCustomDrawGrid)

public

  property InplaceEditor: TWinControl;

  

Cell editor for the grid control.

published

  property Align: TAlign;

  

Specifies the placement of the control on its Parent control.

  property AlternateColor: TColor;

  

Color used for the background in alternate rows in the grid.

  property Anchors: TAnchors;

  

The set of anchor definitions for this control.

  property AutoAdvance: TAutoAdvance;

  

Direction used when automatically moving the selection to the next selectable cell.

  property AutoEdit: Boolean;

  

Indicates if edit mode is automatically entered when a cell is selected.

  property AutoFillColumns: Boolean;

  

Indicates whether columns are automatically resized to fill the visible area in the grid.

  property BorderSpacing: TControlBorderSpacing;

  

Determines the inner and outer border spacing for this control.

  property BorderStyle: TBorderStyle;

  

Indicates the border style displayed around the control.

  property Color: TColor;

  

The background color for the control.

  property ColCount: Integer;

  

Number of columns in the grid.

  property ColRowDraggingCursor: TCursor;

  

Cursor shape displayed when a column or row is dragged in the grid control.

  property ColRowDragIndicatorColor: TColor;

  

Color used to render the drag cursor when a column or row is dragged in the grid.

  property ColSizingCursor: TCursor;

  

Cursor shape displayed when a column is resized.

  property ColumnClickSorts: Boolean;

  

Indicates if clicking a column header changes its sort order.

  property Columns: TGridColumns;

  

Definitions for the columns displayed the grid.

  property Constraints: TSizeConstraints;

  

Contains the minimum and maximum Width and Height for the control.

  property DefaultColWidth: Integer;

  

Default width used for grid columns.

  property DefaultDrawing: Boolean;

  

Indicates if the default drawing mechanism is used to draw the background and text for cells.

  property DefaultRowHeight: Integer;

  

Default row height for newly created grid rows.

  property DoubleBuffered: Boolean;

  

When enabled, it reduces flicker when the control is painted.

  property DragCursor: TCursor;

  

The cursor shape shown during a drag operation.

  property DragKind: TDragKind;

  

Indicates the action performed for a drag operation: drag-and-drop or drag-and-dock.

  property DragMode: TDragMode;

  

Determines how a drag operation is started for the control.

  property Enabled: Boolean;

  

Determines whether the control responds to mouse or keyboard input.

  property ExtendedSelect: Boolean;

  

Indicates whether a selection can extend beyond the visible boundary for the grid.

  property FadeUnfocusedSelection: Boolean;

  

Indicates if a special color is used for selected cells when the control loses focus.

  property FixedColor: TColor;

  

The color used for the fixed cells in the grid.

  property FixedCols: Integer;

  

The number of fixed columns in the grid.

  property FixedRows: Integer;

  

Number of the fixed rows in the grid.

  property Flat: Boolean;

  

Indicates if cells are displayed using a Flat appearance.

  property Font: TFont;

  

The font to be used for text display in this control.

  property GridLineColor: TColor;

  

Color used for the grid lines on the control.

  property GridLineStyle: TPenStyle;

  

Style used to draw the grid lines on the control.

  property GridLineWidth: Integer;

  

Width (thickness) for grid lines drawn on the control.

  property HeaderHotZones: TGridZoneSet;

  

Contains the grid zones which are hot-lighted (hovered) on the control.

  property HeaderPushZones: TGridZoneSet;

  

Contains the grid zones which are drawn in a "pushed" state on the control.

  property ImageIndexSortAsc: TImageIndex;

  

Ordinal position for the image used when a column is sorted in ascending order.

  property ImageIndexSortDesc: TImageIndex;

  

Ordinal position for the image used when a column is sorted in descending order.

  property MouseWheelOption: TMouseWheelOption;

  

Sets the mouse wheel behavior for the grid control.

  property Options: TGridOptions;

  

Contains the set of optional features and/or behaviors enabled for the grid control.

  property Options2: TGridOptions2;

  

Contains additional options for scrolling and editor behavior enabled in the grid control.

  property ParentColor: Boolean;

  

Uses the Color from the Parent control, when enabled.

  property ParentDoubleBuffered: Boolean;

  

Value for the DoubleBuffered property in a Parent control.

  property ParentFont: Boolean;

  

Indicates if the Font from the Parent control is used in the control.

  property ParentShowHint: Boolean;

  

If True, the value of ShowHint for the control will be the same as the one from the Parent. Default is True.

  property PopupMenu: TPopupMenu;

  

A context-sensitive menu that pops up when the right mouse button is clicked over this control.

  property RangeSelectMode: TRangeSelectMode;

  

Controls the range selection mode used for the grid.

  property RowCount: Integer;

  

Number of rows in the grid.

  property RowSizingCursor: TCursor;

  

Cursor shape displayed when the row height is resized.

  property ScrollBars: TScrollStyle;

  

Scrollbars displayed for the grid control.

  property ShowHint: Boolean;

  

Enables Hint display for the control.

  property TabAdvance: TAutoAdvance;

  

Controls the behavior for Tab navigation in the grid control.

  property TabOrder: TTabOrder;

  

Indicates the navigation order for the control when the user presses the Tab or Shift+Tab key.

  property TabStop: Boolean;

  

Allows the user to navigate to / from the control by pressing the Tab or Shift+Tab keys.

  property TitleFont: TFont;

  

The font used for text in a column title.

  property TitleImageList: TImageList;

  

The list with images displayed in column titles.

  property TitleImageListWidth: Integer;

  

Stores the default width for images used in the title area for fixed cells.

  property TitleStyle: TTitleStyle;

  

The drawing style used for the fixed column titles.

  property UseXORFeatures: Boolean;

  

When True, the dotted focus rectangle is painted using an XOR raster operation.

  property Visible: Boolean;

  

Allows the control, and all of its children, to be displayed or hidden.

  property VisibleColCount: Integer;

  

The number of visible columns in the grid control.

  property VisibleRowCount: Integer;

  

The number of visible rows in the grid control.

  property OnAfterSelection: TOnSelectEvent;

  

Event handler signalled after a new Selection is made in the grid.

  property OnBeforeSelection: TOnSelectEvent;

  

Event handler signalled before changing the Selection in the grid control.

  property OnCheckboxToggled: TToggledCheckboxEvent;

  

Event handler signalled when the value for a check box cell is toggled.

  property OnClick: TNotifyEvent;

  

Notification handler for mouse clicks.

  property OnColRowDeleted: TGridOperationEvent;

  

Event handler signalled when a grid column or row is deleted.

  property OnColRowExchanged: TGridOperationEvent;

  

Event handler signalled when a column or row has been exchanged with another.

  property OnColRowInserted: TGridOperationEvent;

  

Event handler signalled when a column or row is inserted into the grid.

  property OnColRowMoved: TGridOperationEvent;

  

Event handler signalled when a column or row in the grid is moved.

  property OnCompareCells: TOnCompareCells;

  

Event handler signalled to compare the content in grid cells.

  property OnContextPopup: TContextPopupEvent;

  

Invoked when a context-sensitive pop-up menu is requested.

  property OnDblClick: TNotifyEvent;

  

Event handler signalled when a mouse double click occurs in the control.

  property OnDragDrop: TDragDropEvent;

  

Event handler signalled when an object is dropped onto the control.

  property OnDragOver: TDragOverEvent;

  

Event handler signalled when a control is dragged over the control instance.

  property OnDrawCell: TOnDrawCell;

  

Event handler signalled to draw a cell in the grid control.

  property OnEditButtonClick: TNotifyEvent; deprecated ;

  

Event handler signalled when the button in a cell Editor is clicked. Deprecated.

  property OnButtonClick: TOnSelectEvent;

  

Event handler signalled when a button-style cell Editor control is clicked.

  property OnEditingDone: TNotifyEvent;

  

Event handler signalled when editing is completed for the control.

  property OnEndDock: TEndDragEvent;

  

Event handler signalled for the end of a drag-dock operation.

  property OnEndDrag: TEndDragEvent;

  

Event handler signalled for the end of a drag-drop operation.

  property OnEnter: TNotifyEvent;

  

Event handler signalled when the control receives focus.

  property OnExit: TNotifyEvent;

  

Event handler signalled when the control loses focus.

  property OnGetCellHint: TGetCellHintEvent;

  

Gets the hint text for a cell.

  property OnGetCheckboxState: TGetCheckboxStateEvent;

  

Event handler signalled to get the state for a check box cell.

  property OnGetEditMask: TGetEditEvent;

  

Event handler signalled to get the edit mask used for a grid cell.

  property OnGetEditText: TGetEditEvent;

  

Event handler signalled to get the value for a cell editor in the grid.

  property OnHeaderClick: THdrEvent;

  

Event handler signalled when the fixed header for a column or row is clicked.

  property OnHeaderSized: THdrEvent;

  

Event handler signalled when a column or row header has been resized.

  property OnHeaderSizing: THeaderSizingEvent;

  

Event handler signalled when a column or row header sizing action is started.

  property OnKeyDown: TKeyEvent;

  

Event handler signalled for key down keyboard events.

  property OnKeyPress: TKeyPressEvent;

  

Event handler signalled for character data entered by the user.

  property OnKeyUp: TKeyEvent;

  

Event handler signalled when a key up event has occurred for the control.

  property OnMouseDown: TMouseEvent;

  

Event handler signalled when a mouse down event is handled for the control.

  property OnMouseEnter: TNotifyEvent;

  

Event handler signalled when the mouse pointer has entered the control.

  property OnMouseLeave: TNotifyEvent;

  

Event handler signalled when the mouse pointer has left the control.

  property OnMouseMove: TMouseMoveEvent;

  

Event handler signalled when the mouse pointer is moved in the control.

  property OnMouseUp: TMouseEvent;

  

Event handler signalled when a mouse up event is handled for the control.

  property OnMouseWheel: TMouseWheelEvent;

  

Event handler for mouse wheel turned.

  property OnMouseWheelDown: TMouseWheelUpDownEvent;

  

Event handler signalled for a downward movement of the mouse wheel.

  property OnMouseWheelUp: TMouseWheelUpDownEvent;

  

Event handler signalled for an upward movement of the mouse wheel.

  property OnMouseWheelHorz: TMouseWheelEvent;

  

Event handler signalled for a horizontal movement of the mouse wheel.

  property OnMouseWheelLeft: TMouseWheelUpDownEvent;

  

Event handler signalled for a leftward movement of the mouse wheel.

  property OnMouseWheelRight: TMouseWheelUpDownEvent;

  

Event handler signalled for a rightward movement of the mouse wheel.

  property OnPickListSelect: TNotifyEvent;

  

Event handler signalled when an item is selected from a pick list-style Editor control.

  property OnPrepareCanvas: TOnPrepareCanvasEvent;

  

Event handler signalled to prepare the Canvas to draw the grid.

  property OnSelectEditor: TSelectEditorEvent;

  

Event handler signalled to select an Editor control for the current grid cell.

  property OnSelection: TOnSelectEvent;

  

Event handler signalled when an area is selected in the grid control.

  property OnSelectCell: TOnSelectCellEvent;

  

Event handler signalled when a grid cell is selected.

  property OnSetCheckboxState: TSetCheckboxStateEvent;

  

Event handler signalled to set the state for a check box cell.

  property OnSetEditText: TSetEditEvent;

  

Event handler signalled when the text in the cell Editor is assigned.

  property OnStartDock: TStartDockEvent;

  

Event handler for the start of a docking operation.

  property OnStartDrag: TStartDragEvent;

  

Event handler signalled for the start of a dragging operation.

  property OnTopleftChanged: TNotifyEvent;

  

Event handler signalled when the top left cell in the visible area of the control is changed.

  property OnUserCheckboxBitmap: TUserCheckBoxBitmapEvent;

  

Event handler signalled to get the user-defined bitmap used for a check box cell.

  property OnUserCheckboxImage: TUserCheckBoxImageEvent;

  

Event handler signalled to get the user-defined image used for a check box cell.

  property OnUTF8KeyPress: TUTF8KeyPressEvent;

  

Handler for a character entered by the user.

  property OnValidateEntry: TValidateEntryEvent;

  

Event handler signalled to perform validation for a cell value.

end;

Inheritance

TDrawGrid

  

Implements a custom-drawn grid control.

|

TCustomDrawGrid

  

The base class for a custom-drawn grid control.

|

TCustomGrid

  

Implements the base class for grid controls.

|

TCustomControl

  

The base class for windowed controls which paint themselves.

|

TWinControl

  

Implements a windowed control which can contain other child controls.

|

TControl

  

The base class for visible controls.

|

TLCLComponent

  

The base class for LCL components which have an associated widget.

|

TComponent,IUnknown,IInterfaceComponentReference

|

TPersistent,IFPObserved

|

TObject

Description

TDrawGrid is a TCustomDrawGrid descendant which implements a custom-drawn grid control. The control represents it information as a matrix of rows and columns, and is oriented towards rendering both graphical information and textual content.

The OnDrawCell event handler is used to render the cell content in the grid, and can be used to render images or directly access the Canvas for the control. Default cell drawing logic is also implemented using the properties and methods from the ancestor class.

TDrawGrid sets the visibility for properties introduced in the TCustomDrawGrid ancestor, and does not provide any new functionality.

Additional information about grid usage is available on the Lazarus wiki in the following pages:

See also

HowToUseGrids

  

How to use Grids including StringGrids, DrawGrids and DbGrids.

TCustomGrid

  

Implements the base class for grid controls.

TCustomDrawGrid

  

The base class for a custom-drawn grid control.

TOnDrawCell

  

Defines the event handler signalled to draw a cell on a grid control.


Version 3.2 Generated 2024-02-25 Home