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

TCustomDrawGrid

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

TCustomDrawGrid - Base Class for drawn grids including TDrawGrid and TStringGrid

Declaration

Source position: grids.pas line 1308

type TCustomDrawGrid = class(TCustomGrid) end;

protected

  FGrid: TVirtualGrid;

  

FGrid - local variable holding a virtual grid on which to work

  procedure CalcCellExtent(); virtual;

  

CalcCellExtent - calculate the dimensions required for the cell specified by aCol, aRow

  procedure CellClick(); override;

  procedure ColRowDeleted(); override;

  

ColRowDeleted - method for dealing with deletion of either a column or a row (depending on value of IsCol)

  procedure ColRowExchanged(); override;

  

ColRowExchanged - method for exchanging the current Column or Row (depending on value of IsCol) with the indexed other column or row

  procedure ColRowInserted(); override;

  

ColRowInserted - method for dealing with insertion of a column or row (depending on value of IsCol)

  procedure ColRowMoved(); override;

  

ColRowMoved - the column or row (determined by IsColumn) is moved from one index to another

  function CreateVirtualGrid; virtual;

  

CreateVirtualGrid - returns the created virtual grid

  procedure DrawCell(); override;

  

DrawCell - draws a cell at the given grid location (Col, Row) or in the specified Rectangle

  procedure DrawCellAutonumbering(); virtual;

  

DrawCellAutonumbering - draws a cell using auto numbering

  procedure DrawFocusRect(); override;

  

DrawFocusRect - draws the rectangle currently receiving focus

  procedure GetCheckBoxState(); virtual;

  

GetCheckBoxState - returns the state of the checkbox at the specified position

  function GetEditMask(); override;

  

GetEditMask - returns the edit mask string for the specified cell

  function GetEditText(); override;

  

GetEditText - returns the Edit text string for the specified cell

  procedure GridMouseWheel(); override;

  procedure HeaderClick(); override;

  

HeaderClick - method to deal with a click on the column (if IsColumn is True) or row Header

  procedure HeaderSized(); override;

  

HeaderSized - method to deal with re-sizing of a column (IsColumn True) or row header

  procedure HeaderSizing(); override;

  procedure KeyDown(); override;

  procedure NotifyColRowChange();

  

NotifyColRowChange tells the system that a column or row has been changed (determined by IsColumn) and whether this was an Insert

  function SelectCell(); override;

  

Is called if a grid cell is highlighted.

  procedure SetColor(); override;

  

SetColor to specified value

  procedure SetCheckboxState(); virtual;

  

SetCheckboxState - specifies the state of the checkbox in the nominated cell

  procedure SetEditText(); override;

  

SetEditText - specifies the text-string to be placed in the Editor for processing

  procedure SizeChanged(); override;

  

SizeChanged - specifies the old number of columns and rows

  procedure ToggleCheckbox; virtual;

  

ToggleCheckbox - toggles checkbox state between checked and unchecked

  property OnGetCheckboxState: TGetCheckboxStateEvent; [rw]

  

OnGetCheckboxState - event handler for finding checkbox state

  property OnSetCheckboxState: TSetCheckboxStateEvent; [rw]

  

OnSetCheckboxState - event handler for specifying checkbox state

public

  constructor Create(); override;

  

Create - constructor for TCustomDrawGrid: attaches a virtual grid then calls inherited Create

  destructor Destroy; override;

  

Destroy - destructor for TCustomDrawGrid: frees the grid then calls inherited Destroy

  procedure DeleteColRow();

  

Delete either a column or a row (specified by index), depending on the value of the boolean IsColumn

  procedure DeleteCol(); virtual;

  procedure DeleteRow(); virtual;

  procedure ExchangeColRow();

  

Exchange either a column or a row, specified by index, with the col or row specified by WithIndex; boolean IsColumn determines whether rows or columns are to be exchanged

  procedure InsertColRow();

  

InsertColRow inserts a column or row (specified by Iscolumn) at the stated index location

  procedure MoveColRow();

  

Move column or row from FromIndex to ToIndex; boolean IsColumn specifies whether col or row is to be moved

  procedure SortColRow();

  

Sort column or row specified by index and optionally by FromIndex and ToIndex; IsColumn specifies whether col or row is to be sorted

  procedure DefaultDrawCell(); virtual;

  

Use the default method for drawing a cell specified by aCol, aRow, at location aRect with state aState

  property AllowOutboundEvents: Boolean;

  

AllowOutboundEvents - permits mouse click on an imaginary (out-of-bounds) cell; moves cursor to nearest valid cell

  property BorderColor: TColor;

  

The colour of the border for this control

  property Canvas: TCanvas;

  

The drawing surface for the control, see TCanvas for details.

  property Col: Integer;

  

Current column index.

  property ColWidths: Integer;

  

Column widths for the grid.

  property ColRow: TPoint;

  property Editor: TWinControl;

  

The editor to be used for modifying information in the cells of the grid

  property EditorBorderStyle: TBorderStyle;

  

The border style for the editor used in this grid

  property EditorMode: Boolean;

  

Is grid ready to accept edits? (EditorMode True)

  property ExtendedColSizing: Boolean;

  

ExtendedColSizing - the sizing to be used for extended columns

  property AltColorStartNormal: Boolean;

  

AltColorStartNormal - using a second colour to display alternate rows, but starting the first row with the normal colour

  property FastEditing: Boolean;

  

Is the FastEditing method being used?

  property FixedGridLineColor: TColor;

  property FocusColor: TColor;

  

The colour to be used for the cell receiving focus

  property FocusRectVisible: Boolean;

  

FocusRectVisible - is the rectangle receiving focus visible?

  property GridHeight: Integer;

  

GridHeight - the height of the grid

  property GridLineColor: TColor;

  

Colour to be used for GridLines

  property GridLineStyle: TPenStyle;

  

Style to be used for GridLines

  property GridWidth: Integer;

  

Width of the whole Grid

  property IsCellSelected: Boolean;

  

IsCellSelected - is the cell specified by aCol, aRow selected?

  property LeftCol: Integer;

  

LeftCol - the left-most column

  property Row: Integer;

  

The current Row (record) within the grid

  property RowHeights: Integer;

  

The row heights for the grid.

  property SaveOptions: TSaveOptions;

  

The set of options for saving information from the grid (design, attributes, content or position)

  property SelectedColor: TColor;

  

Colour to be used for selected cells

  property SelectedColumn: TGridColumn;

  

The column (field) currently selected

  property Selection: TGridRect;

  

The current selection (rows and columns) in the grid

  property StrictSort: Boolean;

  

StrictSort - is strict sorting to be used?

  property TopRow: Integer;

  

The first row (record) in the grid

  property UseXORFeatures: Boolean;

  

UseXORFeatures: When True, the dotted focus rectangle is painted using the XOR raster operation

  property Align: TAlign;

  

Specifies the placement of the control inside its Parent.

  property Anchors: TAnchors;

  

The set of anchor definitions for this control.

  property AutoAdvance: TAutoAdvance;

  

Automatically advance down the grid on successive mouse clicks or presses of the ENTER or TAB key

  property AutoFillColumns: Boolean;

  

Automatically resize columns so they fill all grid's visible area

  property BorderSpacing: TControlBorderSpacing;

  

Determines the inner and outer border spacing for this control.

  property BorderStyle: TBorderStyle;

  

Allows to show a border (line) around the control,

  property Color: TColor;

  

The background color of the control.

  property ColCount: Integer;

  

Number of columns of the grid.

  property Columns: TGridColumns;

  

The properties of the columns in this grid

  property Constraints: TSizeConstraints;

  

The minimal and maximal Width and Height of this control.

  property DefaultColWidth: Integer;

  

Default value for the width of newly created grid columns.

  property DefaultDrawing: Boolean;

  

Is the default drawing method to be used for this grid? Default is TRUE

  property DefaultRowHeight: Integer;

  

Default value for the height of newly created grid rows.

  property Enabled: Boolean;

  

Determines whether the control reacts on mouse or keyboard input.

  property FixedColor: TColor;

  

The color for the fixed cells of the grid.

  property FixedCols: Integer;

  

Number of the fixed columns of the grid (ie the columns containing title or identifier material, that don't get scrolled when the rest of the grid moves).

  property FixedHotColor: TColor;

  

FixedHotColor - the 'Hot' colour for the active (selected, etc) fixed cells of the grid

  property FixedRows: Integer;

  

Number of the fixed rows of the grid (ie the rows containing title or identifier material, that don't get scrolled when the rest of the grid moves).

  property Flat: Boolean;

  

Is the cell to be displayed Flat, ie with no texturing or raised/lowered effect

  property Font: TFont;

  

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

  property GridLineWidth: Integer;

  

Width (thickness) of GridLines

  property Options: TGridOptions;

  

The options available for use in this grid

  property Options2: TGridOptions2;

  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 RowCount: Integer;

  

Number of rows in the grid

  property ScrollBars: TScrollStyle;

  

The ScrollBars to be used with this grid

  property ShowHint: Boolean;

  

Enables the Hint display.

  property TabAdvance: TAutoAdvance;

  property TabOrder: TTabOrder;

  

Determines the sequence of controls, reachable when the user presses the Tab key.

  property TabStop: Boolean;

  

Allows the user to navigate to this control, by pressing the Tab key.

  property Visible: Boolean;

  

Allows to show or hide the control, and all of its children.

  property VisibleColCount: Integer;

  

The number of visible columns

  property VisibleRowCount: Integer;

  

The number of visible rows

  property OnAfterSelection: TOnSelectEvent;

  property OnBeforeSelection: TOnSelectEvent;

  

OnBeforeSelection - event handler for use before a selection is made

  property OnClick: TNotifyEvent;

  

Notification handler for mouse clicks.

  property OnColRowDeleted: TGridOperationEvent; [rw]

  

Event handler when a grid column or row is deleted

  property OnColRowExchanged: TGridOperationEvent; [rw]

  

Event handler when a grid column or row has its position exchanged with another

  property OnColRowInserted: TGridOperationEvent; [rw]

  

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

  property OnColRowMoved: TGridOperationEvent; [rw]

  

Event handler when a grid column or row is moved

  property OnCompareCells: TOnCompareCells;

  

Event handler for comparing the contents of cells

  property OnContextPopup: TContextPopupEvent;

  

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

  property OnDblClick: TNotifyEvent;

  

Event Handler for double mouse clicks.

  property OnDragDrop: TDragDropEvent;

  

This handler determines the action on an drop onto this control, in a drag-drop operation.

  property OnDragOver: TDragOverEvent;

  

Event handler for a control being dragged over this control.

  property OnDrawCell: TOnDrawCell;

  

Event handler for drawing a cell

  property OnEditButtonClick: TNotifyEvent; deprecated ;

  

Event handler for when the Edit button is clicked

  property OnButtonClick: TOnSelectEvent;

  property OnEndDock: TEndDragEvent;

  

Notification handler for the end of a docking operation.

  property OnEndDrag: TEndDragEvent;

  

Notification handler for the end of a dragging operation.

  property OnEnter: TNotifyEvent;

  

Handler for control receiving the focus.

  property OnExit: TNotifyEvent;

  

Handler for control loosing the focus. This is a good place for checking the finished user input.

  property OnGetEditMask: TGetEditEvent; [rw]

  

Event handler for finding the edit mask while editing a grid cell

  property OnGetEditText: TGetEditEvent; [rw]

  

Event handler for finding the text to be edited in a grid cell

  property OnHeaderClick: THdrEvent; [rw]

  

Event handler when a column or row header is clicked

  property OnHeaderSized: THdrEvent; [rw]

  

Event handler when a column or row header is re-sized

  property OnHeaderSizing: THeaderSizingEvent; [rw]

  property OnKeyDown: TKeyEvent;

  

Handler for keyboard key pressed.

  property OnKeyPress: TKeyPressEvent;

  

Handler for a character entered by the user.

  property OnKeyUp: TKeyEvent;

  

Handler for keyboard key released.

  property OnMouseDown: TMouseEvent;

  

Event handler for mouse button going down.

  property OnMouseEnter: TNotifyEvent;

  property OnMouseLeave: TNotifyEvent;

  property OnMouseMove: TMouseMoveEvent;

  

Event handler for mouse movement within the control.

  property OnMouseUp: TMouseEvent;

  

Event handler for mouse button going up.

  property OnMouseWheel: TMouseWheelEvent;

  property OnMouseWheelDown: TMouseWheelUpDownEvent;

  

Notification handler for downward movement of mouse wheel.

  property OnMouseWheelUp: TMouseWheelUpDownEvent;

  

Notification handler for upward movement of mouse wheel.

  property OnPickListSelect: TNotifyEvent;

  

Event handler for selecting an item from a picklist (eg drop-down list in TComboBox)

  property OnPrepareCanvas: TOnPrepareCanvasEvent;

  

Event handler to prepare the Canvas for drawing

  property OnSelectEditor: TSelectEditorEvent;

  

Event handler for selecting an editor

  property OnSelection: TOnSelectEvent;

  

Event handler for when an area of a grid (one or a group of cells) is selected

  property OnSelectCell: TOnSelectCellEvent; [rw]

  

Event handler when a grid cell is selected

  property OnSetEditText: TSetEditEvent; [rw]

  

Event handler for storing the text that has been edited in a cell

  property OnStartDock: TStartDockEvent;

  

Event handler for the start of a docking operation.

  property OnStartDrag: TStartDragEvent;

  

Event handler for the start of a dragging operation.

  property OnTopleftChanged: TNotifyEvent;

  

Event handler when the top left cell is changed (ie the grid has been scrolled so that a different cell occupies top left)

  property OnUTF8KeyPress: TUTF8KeyPressEvent;

  

Handler for a character entered by the user.

Inheritance

TCustomDrawGrid

  

TCustomDrawGrid - Base Class for drawn grids including TDrawGrid and TStringGrid

|

TCustomGrid

  

TCustomGrid - the base class for all grid controls

|

TCustomControl

  

The base class for windowed controls which paint themselves.

|

TWinControl

  

The base class for controls which can contain other (child) controls.

|

TControl

  

The base class for visible controls.

|

TLCLComponent

  

The base class for LCL components associated with widgets.

|

TComponent

?

TObject

See also

HowToUseGrids

  

How to use Grids including StringGrids, DrawGrids and DbGrids

The latest version of this document can be found at lazarus-ccr.sourceforge.net.