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

TCustomGrid.MouseUp

Handles a mouse up event for the grid control.

Declaration

Source position: grids.pas line 1154

protected procedure TCustomGrid.MouseUp(

  Button: TMouseButton;

  Shift: TShiftState;

  X: Integer;

  Y: Integer

); override;

Arguments

Button

  

Mouse button for the event notification.

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

MouseUp is an overridden method in TCustomGrid used to perform actions needed when a mouse up event has been received for the grid control. It calls the inherited method on entry to signal the OnMouseUp event handler (when assigned). MouseUp performs additional actions based on the grid zone where the mouse up event occurred and the current grid state flags for the control.

For example:

Mouse event on a fixed header for the grid.
Calls HeaderClick for the column header under the mouse pointer. Changes the sort order in the column when enabled. Occurs when gsHeaderClicking is in the grid state flags.
Mouse event on a column button in the grid header.
Calls DoEditButton to signal the OnEditButtonClick or OnButtonClick event handlers (when assigned). Occurs when gsButtonColumnClicking is in the grid state flags.
Mouse event on a non-fixed cell in the grid control.
Selects and displays an editor for the cell, and calls the CellClick method to apply the mouse event to the cell. If a selection is already active in the control, it is extended to include the range of cells ending at the mouse pointer. Occurs when gsNormal or gsSelecting is in the grid state flags.
The mouse event occurs when dragging a column header.
Moves the dragged column to the column position under the mouse pointer. Calls HeaderClick to refresh the sort order for cells in the column. Occurs when gsColMoving is in the grid state flags.
The mouse event occurs when dragging a row header.
Moves the dragged row to the row position under the mouse pointer. Calls HeaderClick to refresh the sort order for cells in the row. Occurs when gsRowMoving is in the grid state flags.
The mouse event occurs when resizing a column header.
Calls ResizeColumn to apply the new column size, and calls the HeaderSized method for the resized column number. Occurs when gsColSizing is in the grid state flags.
The mouse event occurs when resizing a row header.
Calls ResizeRow to apply the new row size, and calls the HeaderSized method for the resized row number. Occurs when gsRowSizing is in the grid state flags.

Values in GridFlags are updated to remove flag values for the handled actions, and the grid state is set to gsNormal prior to exit.

MouseUp is called when window messages are handled in the WMLButtonUp, WMRButtonUp, and WMXButtonUp methods in the ancestor class.

See also

TCustomGrid.GridFlags

  

Contains grid-specific state flags active for the control.

TGridState

  

Enumerated type with grid state values.

TGridScroller

  

Scrolls an associated grid when a column or row is dragged beyond the client area for the control.

TControl.MouseUp

  

Signals the OnMouseUp handler.

TControl.OnMouseUp

  

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

TControl.WMLButtonUp

  

Message handler for left mouse button up events.

TControl.WMRButtonUp

  

Message handler for right mouse button up events.

TControl.WMXButtonUp

  

Message handler for extra mouse button up events.


Version 4.0 Generated 2025-05-03 Home