Sign in Join
FPDoc Onlineexperiment

TCustomGrid.EditorKeyPress procedure

Member of TCustomGridpublicIn unit Grids

Implements the OnKeyPress event handler for the cell editor.

Declaration

pascal
procedure EditorKeyPress(Sender: TObject; var Key: char)

Arguments

Sender

Object (TCustomGrid) for the event notification.

Key

Key press examined in the method.

Description

EditorKeyPress is assigned as the OnKeyPress event handler when in the Editor control when it is configured and stored in the Editor property. EditorKeyPress calls the KeyPress method to apply the value in Key to the grid control.

A value not handled in KeyPress is checked for a control or UTF-8-encoded character value. When found, the following actions are performed:

^M (Enter or Shift+Enter)
Moves to the next (or previous) cell in the AutoAdvance direction, and Resets the Editor control. Key is set to #0.
UTF-8-encoded characters
Calls EditorCanAcceptKey and EditorIsReadOnly. If Key cannot be handled, it is set to #0. Otherwise, it is retained and passed as an editor key press.

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.