Vcl.ComCtrls.TCustomDrawState
Delphi
TCustomDrawState = set of TCustomDrawStateItem;
C++
typedef System::Set<TCustomDrawStateItem, TCustomDrawStateItem::cdsSelected, TCustomDrawStateItem::cdsDropHilited> TCustomDrawState;
Properties
| Type | Visibility | Source | Unit | Parent |
|---|---|---|---|---|
set typedef |
public | Vcl.ComCtrls.pas Vcl.ComCtrls.hpp |
Vcl.ComCtrls | Vcl.ComCtrls |
Description
TCustomDrawState specifies a custom drawing state.
TCustomDrawState indicates state information that can affect how a control is drawn.
It includes a set drawn from the following values:
| Value | Meaning |
|---|---|
|
cdsSelected |
The control or item is selected. |
|
cdsGrayed |
The control or item appears unavailable. |
|
cdsDisabled |
The control or item is disabled. |
|
cdsChecked |
The item appears checked. |
|
cdsFocused |
The control or item has input focus. |
|
cdsDefault |
The item is the default item. |
|
cdsHot |
The item is under the mouse and the HotTrack property is True. |
|
cdsMarked |
The item is marked (marked items appear shaded by default.) |
|
cdsIndeterminate |
The item is neither selected, nor unselected. |
|
cdsShowKeyboardCues |
The item uses the keyboard cues when being drawn. |
|
cdsNearHot |
The item is part of a control that is in an "under the mouse" state, but the item is not "under the mouse" itself. |
|
cdsOtherSideHot |
The item is part of a split button that is in an "under the mouse" state, but the item is not "under the mouse" itself. |
|
cdsDropHilited |
The item is the drop target of a drag-and-drop operation. |
To test the state—for example of an item of the type TListView—you should write the following code for Delphi.
procedure TForm1.ListView1CustomDrawItem(Sender: TCustomListView;
Item: TListItem; State: TCustomDrawState; var DefaultDraw: Boolean);
begin
//get the state
if (cdsFocused in State) then
ShowMessage('ok');
//set the state
State := [cdsSelected];
end;