Sign in Join
FPDoc Onlineexperiment

TCustomColorListBox.DrawItem procedure

Member of TCustomColorListBoxprotectedIn unit ColorBox

Draws the color preview and name for an item in list box control.

Declaration

pascal
procedure DrawItem(Index: Integer; Rect: TRect; State: TOwnerDrawState)
 ; override

Description

DrawItem is an overridden method used to custom draw an item in the control.

A color preview is drawn using the value in Colors. For clNone and clDefault, the value in NoneColorColor and DefaultColorColor are used to draw the color preview. The value in State is updated to include odBackgroundPainted in the state flags.

The item rectangle is made smaller and passed to the inherited method to draw the text for the item.

The Brush color and Pen color for the control Canvas are reset to their original values after drawing the item.

See also

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