Sign in Join
FPDoc Onlineexperiment

TCustomSpeedButton.PaintBackground procedure

Member of TCustomSpeedButtonprotectedIn unit Buttons

Paints the background for the control to the specified rectangle.

Declaration

pascal
procedure PaintBackground(var PaintRect: TRect); virtual

Arguments

PaintRect

Rectangle where the control is drawn.

Description

PaintBackground is a method used to draw the background for the speed button control on its Canvas. When Transparent is True and the theme element has transparent areas, the value in Color is used to fill the drawing area in PaintRect.

The DrawElement method in ThemeServices is called to render the drawing area to the Canvas for the control. PaintRect is updated following the drawing operation with the reduced content rectangle (the button surface without borders/edges) needed for the control.

PaintBackground is called when the MeasureDraw method is used to render the control. The adjusted rectangle is later used in the method to calculate the drawing areas for the glyph bitmap and caption text.

See also

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