From 4cb75a89cc72f14707c6f387a8f2272eab80b064 Mon Sep 17 00:00:00 2001 From: wp_xxyyzz Date: Thu, 17 May 2018 15:37:37 +0000 Subject: [PATCH] tvplanit: Add additional parameters "IsNewEvent", "IsNewContact", "IsNewTask" to the events "OnOwnerEditEvent", "OnOwnerEditContact" and "OnOwnerEditTask" of TVpDayView/TVpWeekView/TVpMontView, TVpContactGrid and TVpTaskList, respectively (extended patch by linux-man, issue #33750). git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6429 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- components/tvplanit/source/vpbaseds.pas | 12 ++++++------ components/tvplanit/source/vpcontactgrid.pas | 4 ++-- components/tvplanit/source/vpdayview.pas | 2 +- components/tvplanit/source/vpeventrpt.pas | 2 +- components/tvplanit/source/vpmonthview.pas | 2 +- components/tvplanit/source/vptasklist.pas | 2 +- components/tvplanit/source/vpweekview.pas | 2 +- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/components/tvplanit/source/vpbaseds.pas b/components/tvplanit/source/vpbaseds.pas index 0361487bd..ec6d7514b 100644 --- a/components/tvplanit/source/vpbaseds.pas +++ b/components/tvplanit/source/vpbaseds.pas @@ -81,8 +81,8 @@ type { contact events } TVpContactEvent = procedure(Sender: TObject; Contact: TVpContact) of object; - TVpEditContactEvent = procedure(Sender: TObject; Contact: TVpContact; - Resource: TVpResource; var AllowIt: Boolean) of object; + TVpEditContactEvent = procedure(Sender: TObject; AContact: TVpContact; + IsNewContact: Boolean; AResource: TVpResource; var AllowIt: Boolean) of object; TVpOwnerDrawContactEvent = procedure(Sender: TObject; const Canvas: TCanvas; R: TRect; Contact: TVpContact; var Drawn: Boolean) of object; @@ -96,8 +96,8 @@ type TVpAfterEditTask = procedure(Sender: TObject; Task: TVpTask) of object; - TVpEditTask = procedure(Sender: TObject; Task: TVpTask; - Resource: TVpResource; var AllowIt: Boolean) of object; + TVpEditTask = procedure(Sender: TObject; ATask: TVpTask; IsNewTask: Boolean; + AResource: TVpResource; var AllowIt: Boolean) of object; TVpOwnerDrawTask = procedure(Sender: TObject; const Canvas: TCanvas; R: TRect; Task: TVpTask; var Drawn: Boolean) of object; @@ -110,8 +110,8 @@ type TVpAfterEditEvent = procedure(Sender: TObject; Event: TVpEvent) of object; - TVpEditEvent = procedure(Sender: TObject; Event: TVpEvent; - Resource:TVpResource; var AllowIt: Boolean) of object; + TVpEditEvent = procedure(Sender: TObject; AEvent: TVpEvent; + IsNewEvent: Boolean; AResource:TVpResource; var AllowIt: Boolean) of object; TVpOnAddNewEvent = procedure (Sender: TObject; Event: TVpEvent) of object; diff --git a/components/tvplanit/source/vpcontactgrid.pas b/components/tvplanit/source/vpcontactgrid.pas index 6895d2c6d..d7335424a 100644 --- a/components/tvplanit/source/vpcontactgrid.pas +++ b/components/tvplanit/source/vpcontactgrid.pas @@ -1209,7 +1209,7 @@ var begin AllowIt := false; if Assigned(FOwnerEditContact) then - FOwnerEditContact(self, FActiveContact, DataStore.Resource, AllowIt) + FOwnerEditContact(self, FActiveContact, NewContact, DataStore.Resource, AllowIt) else begin Dlg := TVpContactEditDialog.Create(Owner); try @@ -1255,7 +1255,7 @@ begin AllowIt := true; { call the user defined BeforeEdit contact } if Assigned(FBeforeEdit) then - FBeforeEdit(Self, FActiveContact, DataStore.Resource, AllowIt); + FBeforeEdit(Self, FActiveContact, false, DataStore.Resource, AllowIt); if AllowIt then begin { find the field to edit } diff --git a/components/tvplanit/source/vpdayview.pas b/components/tvplanit/source/vpdayview.pas index 9b3fa40cf..b45dc0314 100644 --- a/components/tvplanit/source/vpdayview.pas +++ b/components/tvplanit/source/vpdayview.pas @@ -2068,7 +2068,7 @@ begin AllowIt := false; if Assigned(FOwnerEditEvent) then - FOwnerEditEvent(self, FActiveEvent, DataStore.Resource, AllowIt) + FOwnerEditEvent(self, FActiveEvent, NewEvent, DataStore.Resource, AllowIt) else begin EventDlg := TVpEventEditDialog.Create(nil); try diff --git a/components/tvplanit/source/vpeventrpt.pas b/components/tvplanit/source/vpeventrpt.pas index 29f609d76..0317a8582 100644 --- a/components/tvplanit/source/vpeventrpt.pas +++ b/components/tvplanit/source/vpeventrpt.pas @@ -731,7 +731,7 @@ begin AllowIt := false; if Assigned (FOwnerEditEvent) then - FOwnerEditEvent(self, FActiveEvent, DataStore.Resource, AllowIt) + FOwnerEditEvent(self, FActiveEvent, NewEvent, DataStore.Resource, AllowIt) else begin EventDlg := TVpEventEditDialog.Create(nil); try diff --git a/components/tvplanit/source/vpmonthview.pas b/components/tvplanit/source/vpmonthview.pas index 0279454d5..1dcc67304 100644 --- a/components/tvplanit/source/vpmonthview.pas +++ b/components/tvplanit/source/vpmonthview.pas @@ -700,7 +700,7 @@ begin AllowIt := false; if Assigned(FOwnerEditEvent) then - FOwnerEditEvent(self, mvActiveEvent, DataStore.Resource, AllowIt) + FOwnerEditEvent(self, mvActiveEvent, NewEvent, DataStore.Resource, AllowIt) else begin EventDlg := TVpEventEditDialog.Create(nil); try diff --git a/components/tvplanit/source/vptasklist.pas b/components/tvplanit/source/vptasklist.pas index bb678e6f6..e4c8c4206 100644 --- a/components/tvplanit/source/vptasklist.pas +++ b/components/tvplanit/source/vptasklist.pas @@ -928,7 +928,7 @@ begin Task := FActiveTask; if Assigned(FOwnerEditTask) then - FOwnerEditTask(self, Task, DataStore.Resource, AllowIt) + FOwnerEditTask(self, Task, NewTask, DataStore.Resource, AllowIt) else begin TaskDlg := TVpTaskEditDialog.Create(nil); try diff --git a/components/tvplanit/source/vpweekview.pas b/components/tvplanit/source/vpweekview.pas index 85d9bb48d..00384d92c 100644 --- a/components/tvplanit/source/vpweekview.pas +++ b/components/tvplanit/source/vpweekview.pas @@ -1351,7 +1351,7 @@ begin AllowIt := false; if Assigned(FOwnerEditEvent) then - FOwnerEditEvent(self, ActiveEvent, DataStore.Resource, AllowIt) + FOwnerEditEvent(self, ActiveEvent, NewEvent, DataStore.Resource, AllowIt) else begin EventDlg := TVpEventEditDialog.Create(nil); try