[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] |
Toggles the state for a checkbox cell between the checked and unchecked values.
Source position: grids.pas line 1413
protected procedure TCustomDrawGrid.ToggleCheckbox; virtual; |
ToggleCheckbox is a method used to toggle the state for a checkbox located in the cell at Col and Row in the grid control.
No actions are performed in the method when Col is not an editable column in the grid. This can occur when goEditing has not been included in the Options for the control. It can also occur if the column definition in Columns has its ReadOnly property set to True.
ToggleCheckbox determines the TCheckboxState value for the cell. The default state is cbGrayed. GetCheckboxState is called to get the current state using the OnGetCheckboxState event handler (when assigned). The value is toggled (cbChecked becomes cbUnchecked, and vice versa). SetCheckboxState is called to apply the toggled value using the OnSetCheckboxState event handler (when assigned), and to redraw the cell.
The OnCheckboxToggled event handler is signalled (when assigned) prior to exiting from the method.
ToggleCheckbox is called from the CellClick method when a left mouse button click occurs in the cell. It is also called from the KeyDown method when the Space (VK_SPACE) key is applied for the cell.
lazarus-ccr.sourceforge.net |