Components for Delphi and C++ Builder.

Go to Russian forum
Go to EhLib.com
It is currently 23 Apr 2024, 19:26

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: 17 Aug 2020, 04:22 
Offline

Joined: 22 May 2017, 05:14
Posts: 3
Hello,

Evaluating EhLib.VCL 9.5 on Delphi 10.3, I used your examples to created a small planification app.
PlanItems are created / edited using CustomPlannerItemDialog.pas file and the custom field (category) is used to select a fill color.
On Form show, the planview (PlannerWeekViewEh1) is filled with all PlanItem in database for the displayed period, and the correct fillcolor is displayed as well.

After creation / modification of a planitem, the corresponing database record shows the correct color value, but the planview does not update. Everything is correct (title, start and end date/time...) but not the color wich is always default. But if I reloads the whole planing, then the color is displayed correctly.

My question is : is there a way to update / refresh a single planitem after creation / edition if this planitem, or do we have to reload the whole plan completely ?

Thanks in advance

Math


Top
 Profile  
 
PostPosted: 17 Aug 2020, 21:40 
Offline

Joined: 08 May 2014, 18:06
Posts: 663
Hello

I tried to reproduce the error using EhLib Demos\PlannerEh.MainDemo\ project.
But I can't.

Here are the steps:

1. Create new event

Code:
procedure TfrFrameOne.Button1Click(Sender: TObject);
var
  StartTime, EndTime: TDateTime;
  PlanItem: TPlannerDataItemEh;
  AResource: TPlannerResourceEh;
begin
  if PlannerControlEh1.NewItemParams(StartTime, EndTime, AResource) then
  begin
    PlanItem := PlannerControlEh1.PlannerDataSource.NewItem;
    PlanItem.Title := 'New Item';
    PlanItem.Body := '';
    PlanItem.AllDay := False;
    PlanItem.StartTime := StartTime;
    PlanItem.FillColor := clGreen;
    PlanItem.EndTime := EndTime;
    PlanItem.EndEdit(True);
  end;
end;


Result:
Attachment:
sshot-132.png
sshot-132.png [ 16.79 KiB | Viewed 890 times ]


Step2 change event color:

Code:
procedure TfrFrameOne.Button2Click(Sender: TObject);
var
  PlanItem: TPlannerDataItemEh;
begin
  PlanItem := PlannerControlEh1.PlannerDataSource.Items[0];
  PlanItem.BeginEdit;
  PlanItem.FillColor := clRed;
  PlanItem.EndEdit(True);
end;


Result:
Attachment:
sshot-133.png
sshot-133.png [ 15.74 KiB | Viewed 890 times ]


Event color changes every time.

_________________
Best regards
EhLib Support Team


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group