Sign in Join
FPDoc Onlineexperiment

TToolButton.Down property

Member of TToolButtonpublishedIn unit ComCtrls

Indicates whether the button is in the "Down" state, i. e. has it been selected or clicked.

Declaration

pascal
property Down: Boolean read FDown write SetDown stored IsCheckedStored default False;

Description

Down is a Boolean property which indicates if the tool button is in a "pressed" or "down" state. The default value for the property is False, and causes the button to be drawn in its normal non-pressed state. Down is updated when mouse down or up messages are handled for the button.

The Style property determines whether the Down state is temporary or persistent. When Style contains tsButton, Down is reset to False when a mouse up message occurs for the button. For the tbsCheck style, it is a toggle; mouse down changes the state but mouse up does not automatically release it.

Changing the value for the property causes the control to be redrawn. It may also affect adjacent buttons on the tool bar with their Grouped properties enabled. When Down is enabled for a Grouped button, the other buttons in the group are updated to set their Down states to False.

Set Grouped to True to include the button in a group of adjacent buttons where only one of them can be in the Down state at any given time. The group does not extend beyond separator or divider buttons defined on the tool bar. Use AllowAllUp to control whether all of the buttons in a group can have their Down properties set to False.

Changing the property to True at design-time (or in program code) causes a non-grouped tool button to be drawn in the pressed state regardless of the setting in style. Display logic for the Style is reapplied when mouse messages are handled for the control.

The implementation was modified in LCL version 3.0 to ensure that an endless loop is avoided when Down is changed for grouped button, or when GroupAllUpAllowed is called.

See also

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