Hi,
Fixed background items are currently not supported, but you can accomplish this with custom drawing:
procedure TForm1.TMSFMXPlanner1AfterDrawCell(Sender: TObject; ACanvas: TCanvas;
ARect: TRectF; ACol, ARow: Integer; AStartTime, AEndTime: TDateTime;
APosition: Integer; AKind: TTMSFMXPlannerCacheItemKind);
begin
if (HourOf(AStartTime) = 12) and (HourOf(AEndTime) = 13) then
begin
ACanvas.Fill.Color := claWhite;
ACanvas.Font.Size := 20;
ACanvas.FillText(ARect, 'LUNCH', False, 1, [], TTextAlign.Center, TTextAlign.Center);
end;
end;
procedure TForm1.TMSFMXPlanner1BeforeDrawCell(Sender: TObject; ACanvas: TCanvas;
ARect: TRectF; ACol, ARow: Integer; AStartTime, AEndTime: TDateTime;
APosition: Integer; AKind: TTMSFMXPlannerCacheItemKind; var AAllow,
ADefaultDraw: Boolean);
begin
if (HourOf(AStartTime) = 12) and (HourOf(AEndTime) = 13) then
begin
ACanvas.Fill.Color := claSteelBlue;
ACanvas.Fill.Kind := TBrushKind.Solid;
end;
end;
If you mean different visual active start and end times for each resource that are still selectable you need to override the OnIsDateTimeInactive event and return different values depending on the position.
procedure TForm1.TMSFMXPlanner1IsDateTimeInActive(Sender: TObject;
ADateTime: TDateTime; APosition: Integer; var AInActive: Boolean);
begin
case APosition of
0: AInactive := not ((HourOf(ADateTime) >= 8) and (HourOf(ADateTime) <= 18));
1: AInactive := not ((HourOf(ADateTime) >= 10) and (HourOf(ADateTime) <= 20));
2: AInactive := not ((HourOf(ADateTime) >= 9) and (HourOf(ADateTime) <= 15));
end;
end;
If you meant to disable dates then you can change the event handler to OnIsDateTimeDisabled.
Kind Regards,
Pieter