Skip to main content

TcxSchedulerCustomDrawEventEvent Type

The custom draw event handler for user events.

Declaration

TcxSchedulerCustomDrawEventEvent = procedure(Sender: TObject; ACanvas: TcxCanvas; AViewInfo: TcxSchedulerEventCellViewInfo; var ADone: Boolean) of object;

Parameters

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.

Remarks

Cast the Sender parameter value to the actual class to access all class-specific members.

Code Example

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; 

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