Vcl.ExtCtrls.TCustomCategoryPanel.DrawHeaderBackground

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

procedure DrawHeaderBackground(ACanvas: TCanvas); virtual;

C++

virtual void __fastcall DrawHeaderBackground(Vcl::Graphics::TCanvas* ACanvas);

Properties

Type Visibility Source Unit Parent
procedure
function
protected
Vcl.ExtCtrls.pas
Vcl.ExtCtrls.hpp
Vcl.ExtCtrls TCustomCategoryPanel

Description

Draws the background of the header of the category panel.

Use DrawHeaderBackground to draw the background of the category panel according to properties of the parent category panel group. The ACanvas parameter requires a TCanvas instance created with the window's device context assigned to the canvas's Handle property. This canvas instance should be freed after the DrawHeaderBackground is called.

The rectangle drawn by DrawHeaderBackground is specified in the ClientRect of this control with the bottom of the rectangle set to the HeaderHeight. The header is drawn according to the properties of the category panel's group parent.

If the category panel group's HeaderStyle property is set to hsGradient, then the GraphUtil function GradientFillCanvas is called with the category panel group's GradientBaseColor property, GradientColor property, and GradientDirection property.

If the category panel group's HeaderStyle property is set to hsThemed, then the ACanvas is filled with the Color of this category panel instance in the rectangle specified by the ClientRect of this category panel. The canvas is then passed to the Windows DrawThemeBackground procedure.

If the category panel group's HeaderStyle property is set to hsImage, and the category panel group's HeaderImage property contains an image, then the image is drawn in the ClientRect with the canvas's StretchDraw procedure. If the HeaderImage is empty, then GradientFillCanvas is called.

DrawHeaderBackground is a protected method and so can only be called in the implementation of an extended class of TCustomCategoryPanel.

See Also