RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TCustomCategoryPanel.DrawHeaderBackground Method

Draws the background of the header of the category panel.

Pascal
procedure DrawHeaderBackground(ACanvas: TCanvas); virtual;
C++
virtual __fastcall DrawHeaderBackground(TCanvas ACanvas);

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

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!