Back to Devexpress

TcxSchedulerCustomDrawEventEvent Type

vcl-cxschedulercustomresourceview-a0e0861e.md

latest2.6 KB
Original Source

TcxSchedulerCustomDrawEventEvent Type

The custom draw event handler for user events.

Declaration

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

Parameters

NameTypeDescription
SenderTObject

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:

delphi
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;
cpp
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

cxSchedulerCustomResourceView Unit