vcl-cxschedulercustomresourceview-a0e0861e.md
The custom draw event handler for user events.
TcxSchedulerCustomDrawEventEvent = procedure(Sender: TObject; ACanvas: TcxCanvas; AViewInfo: TcxSchedulerEventCellViewInfo; var ADone: Boolean) of object;
| Name | Type | Description |
|---|---|---|
| Sender | TObject |
The View that raised the event.
| | ACanvas | TcxCanvas |
The target user event’s canvas.
| | AViewInfo | TcxSchedulerEventCellViewInfo |
The target user event’s ViewInfo information.
| | ADone | Boolean |
Assign True to this parameter if you override the built-in event draw routine. Do not change the parameter value if you need only to complement the built-in draw routine with custom draw operations.
|
Cast the Sender parameter value to the actual class to access all class-specific members.
The following OnCustomDrawEvent event handler draws unchanged recurring user events in red:
procedure TForm1.cxScheduler1CustomDrawEvent(Sender: TObject;
ACanvas: TcxCanvas; AViewInfo: TcxSchedulerEventCellViewInfo;
var ADone: Boolean);
begin
if AViewInfo.Event.EventType = etOccurrence then
begin
AViewInfo.Transparent := True;
ACanvas.FillRect(AViewInfo.Bounds, clRed);
end;
end;
void __fastcall TForm1::cxScheduler1CustomDrawEvent(TObject *Sender,
TcxCanvas *ACanvas, TcxSchedulerEventCellViewInfo *AViewInfo,
bool &ADone)
{
if (AViewInfo->Event->EventType == etOccurrence)
{
AViewInfo->Transparent = true;
ACanvas->FillRect(AViewInfo->Bounds, clRed);
}
}
Note
You can custom draw individual parts of user events. Refer to the following topic for detailed information: Custom Drawing.
The scheduler control’s OnCustomDrawEvent event references the TcxSchedulerCustomDrawEventEvent type.
See Also