Skip to main content

TdxNavBarCustomButtonPainter.DrawButton(TCanvas,TRect,TPicture,TColor,TColor,Byte,Byte,TdxBarStyleGradientMode,TColor,TdxNavBarObjectStates,TdxScaleFactor) Method

Renders a button within a NavBar group header.

Declaration

class procedure DrawButton(ACanvas: TCanvas; ARect: TRect; APicture: TPicture; AColor1: TColor; AColor2: TColor; AAlphaBlend1: Byte; AAlphaBlend2: Byte; AGradientMode: TdxBarStyleGradientMode; ABorderColor: TColor; AState: TdxNavBarObjectStates; AScaleFactor: TdxScaleFactor);

Parameters

Name Type
ACanvas TCanvas
ARect TRect
APicture TPicture
AColor1 TColor
AColor2 TColor
AAlphaBlend1 Byte
AAlphaBlend2 Byte
AGradientMode TdxBarStyleGradientMode
ABorderColor TColor
AState TdxNavBarObjectStates
AScaleFactor TdxScaleFactor

Remarks

You can use this method to custom paint NavBar group headers via the OnCustomDraw.GroupCaption event.

Standard TdxNavBarCustomButtonPainter descendants draw a button on the ACanvas surface within the rectangular region specified by the ARect parameter. The inner button region is filled with a linear gradient brush (gradual change of colors). If the picture is specified via the APicture parameter, it is tiled before the gradient filling. In this case, the gradual filling is blended with the picture depending on the AAlphaBlend1 and AAlphaBlend2 parameters.

Use the AState parameter to specify the state of the button to draw. The button can be drawn active, disabled, pressed, etc. To specify the button’s scaling factor, pass it as the AScaleFactor parameter.

The filling of the inner button region is performed by the TdxNavBarCustomBackgroundPainter.DrawBackground class method. Refer to its description for more details.

If XP themes are enabled, the TdxNavBarXPButtonPainter and TdxNavBarXPExplorerBarButtonPainter painters ignore the parameters specifying the fill colors and gradient and alpha-blending settings. In this case, they fill the button inner region based on the system settings (the current XP theme). Otherwise, buttons are rendered by the TdxNavBarXPButtonPainter and TdxNavBarXPExplorerBarButtonPainter ancestors (TdxNavBarOfficeButtonPainter and TdxNavBarCustomButtonPainter, respectively).

See Also