- This topic has 4 replies, 2 voices, and was last updated 6 years, 4 months ago by HeDiBo.
-
AuthorPosts
-
May 22, 2018 at 3:49 pm #37856HeDiBoParticipant
If OnAcceptDate event sets CanAccept to False, you would expect that this is shown visually in the calendar..
That does not happen, the date is just not clickable..
I suppose I'll have to do something in OnGetCellParams. Which skin enabled colors should I use for Font and Background?
May 31, 2018 at 9:09 am #40442SupportKeymasterThe 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?
May 31, 2018 at 1:07 pm #40445HeDiBoParticipant'Support' wrote: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
July 1, 2018 at 2:57 pm #58092HeDiBoParticipantYou're implementation of DimUnacceptedCells is perfect 👌
July 17, 2018 at 12:07 pm #58175HeDiBoParticipantYou changed the default for DimUnacceptedCells. This may be unexpected for some. A warning about this should have been in the release notes.
-
AuthorPosts
- You must be logged in to reply to this topic.