From 5bade4a47a4700ffab3c1a0b003218eb39e25fb8 Mon Sep 17 00:00:00 2001 From: dsiders Date: Sun, 30 Jan 2022 15:11:39 +0000 Subject: [PATCH] Docs: LCL/grids. Updates content for TCustomGrid topics. --- docs/xml/lcl/grids.xml | 184 ++++++++++++++++++++++++++++++++++++----- 1 file changed, 162 insertions(+), 22 deletions(-) diff --git a/docs/xml/lcl/grids.xml b/docs/xml/lcl/grids.xml index 8496154f7c..4c5395b938 100644 --- a/docs/xml/lcl/grids.xml +++ b/docs/xml/lcl/grids.xml @@ -9690,55 +9690,192 @@ Vertical coordinate for the mouse event. - - - - + + Applies a change in the mouse pointer position to the grid control. + +

+ 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 hander 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. +

+
+ + TControl.MouseMove + TControl.WMMouseMove +
- + Ctrl, Alt, or Shift modifier for the mouse event. - + Horizontal coordinate for the mouse pointer. - + Vertical coordinate for the mouse pointer. - - - - + + + Handles a mouse up event for the grid control. + + +

+ 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. +

+
+ + + + TControl.MouseUp + TControl.OnMouseUp + TControl.WMLButtonUp + TControl.WMRButtonUp + TControl.WMXButtonUp +
- + Mouse button for the event notification. - + Ctrl, Alt, or Shift modifier for the mouse event. - + Horizontal coordinate for the mouse pointer. - + Vertical coordinate for the mouse pointer. - Moves an extended selection. - - + Moves the selected cell or extends a selection using the specified column and row values. + +

+ Calls TryMoveSelection to perform the selection change using the specified arguments. No actions are performed in the method when: +

+
    +
  • + FixedGrid is True. All cells are fixed and cannot be selected. +
  • +
  • + DCol and DRow are not valid for the Col, Row, ColCount or RowCount for the grid control. +
  • +
+
+ + + + + + + + +
- + True if the selection was moved or extended in the method. - + + True if the selection is extended by the relative number of columns and rows. False to move the selection to the specified cell coordinates. + - + Column number for the selection, or the delta when a selection is extended. - + Row number for the selection, or the delta when a selection is extended. + + + True if the cell in DCol and DRow must be fully visible after the selection change. @@ -9963,6 +10100,9 @@

Calls UpdateCachedSizes to recalculate the cached grid information in GCache. Calls CacheVisibleGrid to cache the current visible grid (excluding fixed cells).

+

+ Called from the Paint method when the client width or height has changed for the control. +