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

TCustomGrid.MouseMove

Applies a change in the mouse pointer position to the grid control.

Declaration

Source position: grids.pas line 1153

protected procedure TCustomGrid.MouseMove(

  Shift: TShiftState;

  X: Integer;

  Y: Integer

); override;

Arguments

Shift

  

Ctrl, Alt, or Shift modifier for the mouse event.

X

  

Horizontal coordinate for the mouse pointer.

Y

  

Vertical coordinate for the mouse pointer.

Description

MouseMove is an overridden method in TCustomGrid. It calls the inherited method on entry to update the DragManager when it is active, and to signal the OnMouseMove event handler (when assigned). No additional actions are performed in the method if a drag operation is already active in the DragManager.

If the mouse coordinates are located in the fixed headers for the control, hot tracking and cell down / pushed drawing are applied to the grid control when enabled in Options.

Cell selections are handled for the mouse movement depending on grid state values and Options set for the control. No additional actions are performed in the method when gsHeaderClicking or gsButtonColumnClicking are in the grid state for the control. Performs the following for a corresponding mouse movement:

Extend an active selection in the control when needed.
Calls MoveExtend when the mouse pointer is not in the current selection, not in a fixed header area for the control, and editing is not active or allowed. Occurs when gsSelecting is in the grid state values for the control.
Move the column under the mouse pointer.
Occurs when goColMoving is in Options.
Resize the column under the mouse pointer.
Occurs when goColSizing is in Options.
Resize the row under the mouse pointer.
Occurs when goRowSizing is in Options.

MouseMove sets the Hint displayed for the cell under the mouse pointer when ShowHint is enabled. Values in Hint, CellHintPriority, Options, and the OnGetCellHint event handler are used for the purpose. If the mouse pointer is not over a cell, the Hint for the application is reset to a previous hint or an empty string ('') when saved hint text is not available.

Called from WMMouseMove when a LM_MOUSEMOVE window message is handled for the grid control.

See also

TControl.MouseMove

  

Handler for MouseMove events.

TControl.WMMouseMove

  

Message handler for mouse move events.


Version 4.0 Generated 2025-05-03 Home