CustomDrawGrid#

Qualified name: delphivcl.CustomDrawGrid

class CustomDrawGrid#

Bases: CustomGrid

TCustomDrawGrid is the base class for grids that publish events for painting and manipulating the cells in the grid. Use TCustomDrawGrid as a base class when defining grid components that publish events for painting or manipulating the cells in the grid. TCustomDrawGrid introduces a number of events and methods that take advantage of the tabular organization of the grid in responding to user actions. Do not create instances of TCustomDrawGrid. Instead, put a grid control in a form by instantiating a descendant of TCustomDrawGrid. Use TDrawGrid to represent non-textual material in a tabular grid. For text, use a TStringGrid object. If the text represents field values from a dataset, use TDBGrid. If you are displaying Name/Value pairs, use TValueListEditor.

Methods

CanFocus

Indicates whether a control can receive focus.

CellRect

Returns the screen coordinates of a cell in the grid.

MouseToCell

Returns the column and row of the cell at the position with screen coordinates (X,Y).

SetFocus

Gives the input focus to the control.

Attributes

Action

Specifies the action associated with the control.

Align

Determines how the control aligns within its container (parent control).

AlignDisabled

Indicates child control realignment disabled.

AlignWithMargins

Specifies whether a control should be constrained by margins.

Anchors

Specifies how the control is anchored to its parent.

BiDiMode

Specifies the bidirectional mode for the control.

BoundsRect

Specifies the bounding rectangle of the control, expressed in the coordinate system of the parent control.

Brush

Determines the color and pattern used for painting the background of the control.

Canvas

Specifies the TCanvas object that presents a drawing surface for the control.

CellAlignments

<Delphi indexed property CellAlignments of type TCustomDrawGrid at 21141266E70>

ClassName

Returns the TObject.ClassName

ClientHeight

Specifies the height of the control's client area in pixels.

ClientOrigin

Specifies the screen coordinates (in pixels) of the upper-left corner of a control's client area.

ClientRect

Specifies the size of a control's client area in pixels.

ClientWidth

Specifies the horizontal size of the control's client area in pixels.

Col

Specifies the index of the column that contains the selected cell.

ColAlignments

<Delphi indexed property ColAlignments of type TCustomDrawGrid at 21141266DB0>

ColWidths

<Delphi indexed property ColWidths of type TCustomDrawGrid at 21141266CF0>

ComObject

Specifies the interface reference implemented by the component.

ComponentCount

Indicates the number of components owned by the component.

ComponentIndex

Indicates the position of the component in its owner's Components property array.

ComponentState

Describes the current state of the component, indicating when a component needs to avoid certain actions.

ComponentStyle

Governs the behavior of the component.

Components

<Delphi indexed property Components of type TComponent at 21141642500>

Constraints

Specifies the size constraints for the control.

ControlCount

Returns the count of contained controls

ControlState

Specifies the current state of a control at run time.

ControlStyle

Determines style characteristics of the control.

Controls

Returns an iterator over contained controls

CurrentPPI

Embarcadero Technologies does not currently have any additional information.

Cursor

Specifies the image used to represent the mouse pointer when it passes into the region covered by the control.

CustomHint

CustomHint is a custom hint for the control.

DesignInfo

Contains information used by the Form designer.

DockClientCount

Specifies the number of controls that are docked on the windowed control.

DockClients

<Delphi indexed property DockClients of type TWinControl at 211416EE520>

DockManager

Specifies the control's docking manager interface.

DockOrientation

DockOrientation specifies how the control is docked relative to other controls docked in the same parent.

DockSite

Specifies whether the control can be the target of drag-and-dock operations.

DoubleBuffered

Determines whether the control's image is rendered directly to the window or painted to an in-memory bitmap first.

DrawingStyle

Determines the style used when drawing the grid.

EditorMode

Determines whether the current cell can be edited.

Enabled

Controls whether the control responds to mouse, keyboard, and timer events.

ExplicitHeight

Specifies the explicit vertical size of the control in pixels.

ExplicitLeft

Specifies the explicit horizontal pixel coordinate of the left edge of a component relative to its parent.

ExplicitTop

Specifies the explicit vertical pixel coordinate of the top edge of a component relative to its parent.

ExplicitWidth

Specifies the explicit horizontal size of the control in pixels.

Floating

Specifies whether the control is floating.

FloatingDockSiteClass

Specifies the class of the temporary control that hosts the control when it is floating.

Focused

Determines whether the control has input focus.

GridHeight

Specifies the height of the grid in pixels.

GridWidth

Specifies the width of the grid in pixels.

Handle

Provides access to the underlying Windows screen object for the control.

HandleAllocated

Reports whether a screen object handle exists for the control.

Height

Specifies the vertical size of the control in pixels.

HelpContext

The HelpContext property contains the numeric context ID that identifies the Help topic for the control.

HelpKeyword

The HelpKeyword property contains the keyword string that identifies the Help topic for the control.

HelpType

Specifies whether the control's context-sensitive Help topic is identified by a context ID or by keyword.

Hint

Hint contains the text string that appears when the user moves the mouse over the control.

HostDockSite

Specifies the control in which the control is docked.

IsDrawingLocked

IsDrawingLocked property returns True when redrawing for this control is locked.

IsUpdating

Embarcadero Technologies does not currently have any additional information.

LRDockWidth

Specifies the width of the control when it is docked horizontally.

Left

Specifies the horizontal coordinate of the left edge of a component relative to its parent.

LeftCol

Specifies the index of the first visible scrollable column in the grid.

Margins

Specifies the margins of the control.

MouseInClient

Indicates whether the mouse pointer is currently in the client area of the control.

Name

Specifies the name of the component as referenced in code.

Observers

Indicates the TObservers object added to the TComponent.

OnGesture

<Delphi property OnGesture of type TControl at 211418EC500>

Owner

Indicates the component that is responsible for streaming and freeing this component.

Padding

Specifies the padding of a control.

Parent

Returns/Sets the Control Parent

ParentCustomHint

Specifies where a control looks for its custom hint.

ParentDoubleBuffered

ParentDoubleBuffered defers the DoubleBuffered property of this component to the value of the parent's DoubleBuffered property.

ParentWindow

Reference to parent's underlying control.

PixelsPerInch

Embarcadero Technologies does not currently have any additional information.

RedrawDisabled

RedrawDisabled property returns True when redrawing for this control is locked.

Row

Specifies the index of the row that contains the selected cell.

RowHeights

<Delphi indexed property RowHeights of type TCustomDrawGrid at 21141266F30>

ScaleFactor

Embarcadero Technologies does not currently have any additional information.

Selection

Indicates the boundaries of the current selection.

ShowHint

ShowHint specifies whether to show the Help Hint when the mouse pointer moves over the control.

Showing

Indicates whether the control is showing on the screen.

StyleElements

Specifies the style elements that are used by the control.

StyleName

Embarcadero Technologies does not currently have any additional information.

TBDockHeight

Specifies the height of the control when it is docked vertically.

TabOrder

Indicates the position of the control in its parent's tab order.

TabStop

Determines whether the user can tab to a control.

TabStops

<Delphi indexed property TabStops of type TCustomDrawGrid at 21141266FF0>

Tag

Stores a NativeInt integral value as a part of a component.

Top

Specifies the Y coordinate of the upper-left corner of a control, relative to its parent or containing control in pixels.

TopRow

Specifies the index of the first visible scrollable row in the grid.

Touch

Specifies the touch manager component associated with the control.

UndockHeight

Specifies the height of the control when it is floating.

UndockWidth

Specifies the width of the control when it is floating.

UseDockManager

Specifies whether the docking manager is used in drag-and-dock operations.

VCLComObject

Represents information used internally by components that support COM.

Visible

Specifies whether the component appears onscreen.

VisibleDockClientCount

Specifies the number of visible controls that are docked on the windowed control.

Width

Specifies the horizontal size of the control or form in pixels.

WindowProc

<Delphi property WindowProc of type TControl at 211418EC1C0>

CanFocus()#

Indicates whether a control can receive focus.

Canvas#

Specifies the TCanvas object that presents a drawing surface for the control. Use the properties of the TCanvas object to draw or paint on the surface of the control. Canvas encapsulates a Windows device context, providing all the tools and methods needed for drawing and painting. Canvas is a protected property that is usually redeclared as public in descendants of TCustomControl.

CellAlignments#

<Delphi indexed property CellAlignments of type TCustomDrawGrid at 21141266E70>

CellRect(ACol: Integer, ARow: Integer) Rect#

Returns the screen coordinates of a cell in the grid. Call CellRect to obtain the boundaries, in pixels, of the cell in the column and row indicated by the ACol and ARow parameters. The top left cell is specified when ACol and ARow are set to zero. If the indicated cell is not visible, CellRect returns an empty rectangle.

Col#

Specifies the index of the column that contains the selected cell. Use Col at runtime to determine the current column in the grid. Setting Col moves focus to the cell in the current row that is in the new column. The first column has an index of 0, the second column an index of 1, and so on. The selected cell in the grid can be located by reading the Col property and the Row property to obtain the indexes of its column and row. When focus moves to the grid, the selected cell gets input focus.

ColAlignments#

<Delphi indexed property ColAlignments of type TCustomDrawGrid at 21141266DB0>

ColWidths#

<Delphi indexed property ColWidths of type TCustomDrawGrid at 21141266CF0>

DrawingStyle#

Determines the style used when drawing the grid. DrawingStyle determines the style used to draw the grid. The following table lists the possible values of DrawingStyle.

Value

Meaning

gdsClassic

The grid control uses the standard, unthemed style.

gdsThemed

The grid control uses the current operating system theme.

gdsGradient

The grid control uses gradients for styling.

Notes about DrawingStyle for Vcl.Grids.TStringGrid: Setting FixedColor has no effect unless you also set DrawingStyle to gdsClassic. Setting GradientStartColor and GradientEndColor has no effect unless you set the value of DrawingStyle to gdsGradient.

EditorMode#

Determines whether the current cell can be edited. Set EditorMode to true, at runtime, to put the grid in edit mode. When EditorMode is true, the user can edit cells in the grid. When the user presses F2, EditorMode is set to true. When the user presses Enter, the value of EditorMode is toggled.

Note: EditorMode has no effect if the Options property does not include goEditing or if the Options property includes goAlwaysShowEditor.

GridHeight#

Specifies the height of the grid in pixels. Read GridHeight to determine the size of the grid. If GridHeight is less than the value of ClientHeight, all of the rows of the grid appear in the control with an empty region below the grid. If the underlying grid is too tall to appear in the control, GridHeight is the same as ClientHeight, and the user must scroll to see the entire contents of the grid.

GridWidth#

Specifies the width of the grid in pixels. Read GridWidth to determine the size of the grid. If GridWidth is less than the value of ClientWidth, all of the columns of the grid appear in the control with an empty region to the right of the grid. If the underlying grid is too wide to appear in the control, GridWidth is the same as ClientWidth, and the user must scroll to see the entire contents of the grid.

LeftCol#

Specifies the index of the first visible scrollable column in the grid. Read LeftCol to determine the index of the first column in the scrollable region that is visible. Set LeftCol to scroll the columns in the grid so that the column with index LeftCol is the first column after the fixed columns.

MouseToCell(X: Integer, Y: Integer, ACol: Integer, ARow: Integer)#

Returns the column and row of the cell at the position with screen coordinates (X,Y). Call MouseToCell to convert from grid-relative screen coordinates to row and column indexes. The X and Y parameters are the screen coordinates of the point to be converted. MouseToCell returns the ACol parameter as the number of the column over the point (X,Y), and the ARow parameter as the number of the row. Usually the MouseToCell method is used in a mouse event handler, which supplies the mouse coordinates as the X and Y parameters of the method call.

Row#

Specifies the index of the row that contains the selected cell. Use Row at runtime to determine the current row in the grid. Setting Row moves focus to the cell in the current column that is in the new row. The first row has an index of 0, the second row an index of 1, and so on. The selected cell in the grid can be located by reading the Row property and the Col property to obtain the indexes of its row and column. When focus moves to the grid, the selected cell gets input focus.

RowHeights#

<Delphi indexed property RowHeights of type TCustomDrawGrid at 21141266F30>

Selection#

Indicates the boundaries of the current selection. Set Selection to select a range of cells in the grid. Selection can either represent the first column, first row, last column and last row in the grid, or the row and column coordinates of the upper left and bottom right cells in the selected region. Selection can only indicate more than one cell when Options includes goRangeSelect.

SetFocus()#

Gives the input focus to the control.

TabStops#

<Delphi indexed property TabStops of type TCustomDrawGrid at 21141266FF0>

TopRow#

Specifies the index of the first visible scrollable row in the grid. Read TopRow to determine the index of the first row in the scrollable region that is visible. Set TopRow to scroll the rows in the grid so that the row with index TopRow is the first row after the fixed rows.