RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TToolBar.IsCustomDrawn Method

Indicates whether an event handler exists to respond at a particular stage in the paint process.

Pascal
function IsCustomDrawn(Target: TCustomDrawTarget; Stage: TCustomDrawStage): Boolean; virtual;
C++
virtual __fastcall Boolean IsCustomDrawn(TCustomDrawTarget Target, TCustomDrawStage Stage);

TToolBar uses IsCustomDrawn internally to determine whether it needs generate the various custom draw events. 

Target indicates what object is currently being painted. If Target is dtControl, it is the background of the toolbar, and IsCustomDrawn checks whether there is an OnCustomDraw or OnAdvancedCustomDraw event handler. If Target is dtItem, it is one of the tool buttons, and IsCustomDrawn checks for an OnCustomDrawButton or OnAdvancedCustomDrawButton event handler. TToolBar does not use dtSubItem as a target. 

Stage indicates the current stage of the paint process. If stage is not cdPrePaint, then the tool bar only generates an event if it has one of the advanced custom draw event handlers. 

IsCustomDrawn returns true if the toolbar should generate an event (there is an event handler to respond.) IsCustomDrawn returns false if there is no need to generate a custom draw event. 

 

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