Hi,
is there an example how I can create an own Editor? Did I have to compile/install the tmsd2010.dpk new to add an Item Editor?
Thanks
Hi,
thanks for your answer. I've done so, but I got one last question: how can I register MyEditForm to the Planner?
Best regards ...
Hi,
ok. Executing works, but now I got another problem. If I use my Editor, the Item is not updated (If I use no Editor it works correct). My Editor is like the code in #2. The changes of an item are displayed in the item, but there's no update to the database? I register the Editor like:
public
ScheduleEditor : TSimpleItemEditor;
....
// OnCreate
ScheduleEditor := TSimpleItemEditor.Create(self);
planner.DefaultItem.Editor := ScheduleEditor;
//OnDestroy
FreeAndNil(ScheduleEditor);
Best regards ....
Did you implement the override of the method:
Hi,
yes, it looks:
procedure TSimpleItemEditor.EditToPlannerItem(APlannerItem: TPlannerItem);
begin
inherited;
FEditForm.AssignToPlannerItem(APlannerItem);
end;
and
procedure Tdateedit.AssignToPlannerItem(PlannerItem: TPlannerItem);
begin
PlannerItem.CaptionText := edSubject.Text;
PlannerItem.Text := TStringList(edMemo.Lines);
PlannerItem.ItemStartTime := Int(PlanDate.Date) + Frac(StartTime.Time);
PlannerItem.ItemEndTime := Int(PlanDate.Date) + Frac(EndTime.Time);
PlannerItem.ItemRealStartTime := Int(PlanDate.Date) + Frac(StartTime.Time);
PlannerItem.ItemRealEndTime := Int(PlanDate.Date) + Frac(EndTime.Time);
end;
and this works, but only to the item. Not to the database!
If I drag and drop the item without using an editor changes to the database are made.
Best regards ...
Call Item.Update after setting the properties.
Hi,
that was simple :-) . Great!
Best regards ...