The OnGetCellParams event has a constant list of parameters which can't be changed because existing projects will have a problem with compatibility in this case.
The OnAcceptDate event occurs after a clicking and allows to disable an accepting of the custom date.
I think, will be better solution to call the “OnAcceptDate” event twice – before painting of cell and after clicking.
Cells may be marked as unallowed in this case… How you think?
The OnGetCellParams event has a constant list of parameters which can't be changed because existing projects will have a problem with compatibility in this case.
The OnAcceptDate event occurs after a clicking and allows to disable an accepting of the custom date.
I think, will be better solution to call the “OnAcceptDate” event twice – before painting of cell and after clicking.
Cells may be marked as unallowed in this case… How you think?
I've done it as follows:
Code:
procedure TFr_Planner.deDateStartGetCellParams( Sender: TObject;
Date: TDateTime;
AFont: TFont;
var Background: TColor );
var
Accepted: Boolean;
begin
deDateStartAcceptDate( Sender, Date, Accepted ); // Call the OnAcceptDate event
if Accepted then Exit;
AFont.Style := [];
AFont.Color := SysColorToSkin(clGrayText, sFrameAdapter1.SkinData.SkinManager);
BackGround := SysColorToSkin(clBtnShadow, sFrameAdapter1.SkinData.SkinManager);
end;
The font and background setting could have been an optional part of de TsDateEdit control.
One possible implementation is a property DimUnacceptedCells. Paint the cell as above upon receiving Accepted = False in the OnAcceptDate event. No change in parameters for OnGetCellParams