You've already forked lazarus-ccr
TvPlanIt: Add OnModifyEvent. Replace double LineEndings by new const LineEnding2.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8292 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -118,8 +118,8 @@ type
|
||||
TVpEditEvent = procedure(Sender: TObject; AEvent: TVpEvent;
|
||||
IsNewEvent: Boolean; AResource:TVpResource; var AllowIt: Boolean) of object;
|
||||
|
||||
TVpOnAddNewEvent = procedure (Sender: TObject;
|
||||
Event: TVpEvent) of object;
|
||||
TVpOnAddNewEvent = procedure (Sender: TObject; Event: TVpEvent) of object;
|
||||
TVpOnModifyEvent = procedure (Sender: TObject; Event: TVpEvent) of object;
|
||||
|
||||
{ resource events }
|
||||
|
||||
|
@ -286,6 +286,9 @@ const
|
||||
{$ENDIF}
|
||||
|
||||
DROPDOWN_COUNT = 24;
|
||||
|
||||
LineEnding2 = LineEnding + LineEnding;
|
||||
|
||||
|
||||
implementation
|
||||
|
||||
|
@ -724,7 +724,7 @@ begin
|
||||
Str := FActiveContact.LastName;
|
||||
|
||||
if Verify then
|
||||
DoIt := (MessageDlg(Format(RSConfirmDeleteContact, [Str]) + #13#10#10 + RSPermanent,
|
||||
DoIt := (MessageDlg(Format(RSConfirmDeleteContact, [Str]) + LineEnding2 + RSPermanent,
|
||||
mtConfirmation, [mbYes, mbNo], 0) = mrYes);
|
||||
|
||||
if DoIt then begin
|
||||
|
@ -289,6 +289,7 @@ type
|
||||
FOnBeforeDrawEvent: TVpOnDVBeforeDrawEvent;
|
||||
FOnAfterDrawEvent: TVpOnDVAfterDrawEvent;
|
||||
FOnAddEvent: TVpOnAddNewEvent;
|
||||
FOnModifyEvent: TVpOnModifyEvent;
|
||||
{ internal variables }
|
||||
dvClickTimer: TTimer;
|
||||
dvLoaded: Boolean;
|
||||
@ -528,6 +529,7 @@ type
|
||||
property OnBeforeDrawEvent: TVpOnDVBeforeDrawEvent read FOnBeforeDrawEvent write FOnBeforeDrawEvent;
|
||||
property OnDrawIcons: TVpOnDVDrawIcons read FOnDrawIcons Write FOnDrawIcons;
|
||||
property OnHoliday: TVpHolidayEvent read FOnHoliday write FOnHoliday;
|
||||
property OnModifyEvent: TVpOnModifyEvent read FOnModifyEvent write FOnModifyEvent;
|
||||
property OnOwnerEditEvent: TVpEditEvent read FOwnerEditEvent write FOwnerEditEvent;
|
||||
property OnClick;
|
||||
end;
|
||||
@ -955,20 +957,20 @@ begin
|
||||
|
||||
if showDetails then begin
|
||||
// Event description
|
||||
Result := Result + LineEnding + LineEnding +
|
||||
Result := Result + LineEnding2 +
|
||||
RSEvent + ':' + LineEnding + AEvent.Description;
|
||||
|
||||
// Event notes
|
||||
if (AEvent.Notes <> '') then begin
|
||||
s := WrapText(AEvent.Notes, MAX_HINT_WIDTH);
|
||||
s := StripLastLineEnding(s);
|
||||
Result := Result + LineEnding + LineEnding +
|
||||
Result := Result + LineEnding2 +
|
||||
RSNotes + ':' + LineEnding + s;
|
||||
end;
|
||||
|
||||
// Event location
|
||||
if (AEvent.Location <> '') then
|
||||
Result := Result + LineEnding + LineEnding +
|
||||
Result := Result + LineEnding2 +
|
||||
RSLocation + ':' + LineEnding + AEvent.Location;
|
||||
end;
|
||||
end
|
||||
@ -1030,7 +1032,7 @@ begin
|
||||
|
||||
if FActiveEvent <> nil then begin
|
||||
if Verify then
|
||||
DoIt := (MessageDlg(RSConfirmDeleteEvent + #13#10#10 + RSPermanent,
|
||||
DoIt := (MessageDlg(RSConfirmDeleteEvent + LineEnding2 + RSPermanent,
|
||||
mtConfirmation, [mbYes, mbNo], 0) = mrYes);
|
||||
|
||||
if DoIt then begin
|
||||
@ -2180,6 +2182,8 @@ begin
|
||||
DataStore.PostEvents;
|
||||
if IsNewEvent and Assigned(FOnAddEvent) then
|
||||
FOnAddEvent(self, FActiveEvent);
|
||||
if not IsNewEvent and Assigned(FOnModifyEvent) then
|
||||
FOnModifyEvent(self, FActiveEvent);
|
||||
end else begin
|
||||
if IsNewEvent then begin
|
||||
FActiveEvent.Deleted := true;
|
||||
|
@ -179,6 +179,7 @@ type
|
||||
|
||||
{ event variables }
|
||||
FOnAddEvent: TVpOnAddNewEvent;
|
||||
FOnModifyEvent: TVpOnModifyEvent;
|
||||
FOwnerDrawCells: TVpOwnerDrawDayEvent;
|
||||
FOwnerEditEvent: TVpEditEvent;
|
||||
FOnEventClick: TVpOnEventClick;
|
||||
@ -343,6 +344,7 @@ type
|
||||
property OnEventClick: TVpOnEventClick read FOnEventClick write FOnEventClick;
|
||||
property OnEventDblClick: TVpOnEventClick read FOnEventDblClick write FOnEventDblClick;
|
||||
property OnHoliday: TVpHolidayEvent read FOnHoliday write FOnHoliday;
|
||||
property OnModifyEvent: TVpOnModifyEvent read FOnModifyEvent write FOnModifyEvent;
|
||||
property OnOwnerEditEvent: TVpEditEvent read FOwnerEditEvent write FOwnerEditEvent;
|
||||
end;
|
||||
|
||||
@ -725,6 +727,8 @@ begin
|
||||
DataStore.PostEvents;
|
||||
if IsNewEvent and Assigned(FOnAddEvent) then
|
||||
FOnAddEvent(self, mvActiveEvent);
|
||||
if not IsNewEvent and Assigned(FOnModifyEvent) then
|
||||
FOnModifyEvent(self, mvActiveEvent);
|
||||
end else begin
|
||||
if IsNewEvent then begin
|
||||
DataStore.Resource.Schedule.DeleteEvent(mvActiveEvent);
|
||||
|
@ -559,7 +559,7 @@ begin
|
||||
DoIt := not Verify;
|
||||
if FActiveTask <> nil then begin
|
||||
if Verify then
|
||||
DoIt := (MessageDlg(RSConfirmDeleteTask + #13#10#10 + RSPermanent,
|
||||
DoIt := (MessageDlg(RSConfirmDeleteTask + LineEnding2 + RSPermanent,
|
||||
mtConfirmation, [mbYes, mbNo], 0) = mrYes);
|
||||
|
||||
if DoIt then begin
|
||||
|
@ -159,6 +159,7 @@ type
|
||||
FAfterEdit: TVpAfterEditEvent;
|
||||
FOwnerEditEvent: TVpEditEvent;
|
||||
FOnAddEvent: TVpOnAddNewEvent;
|
||||
FOnModifyEvent: TVpOnModifyEvent;
|
||||
{ internal variables }
|
||||
wvInLinkHandler: Boolean;
|
||||
wvClickTimer: TTimer;
|
||||
@ -320,6 +321,7 @@ type
|
||||
property BeforeEdit: TVpBeforeEditEvent read FBeforeEdit write FBeforeEdit;
|
||||
property OnAddEvent: TVpOnAddNewEvent read FOnAddEvent write FOnAddEvent;
|
||||
property OnHoliday: TVpHolidayEvent read FOnHoliday write FOnHoliday;
|
||||
property OnModifyEvent: TVpOnModifyEvent read FOnModifyEvent write FOnModifyEvent;
|
||||
property OnOwnerEditEvent: TVpEditEvent read FOwnerEditEvent write FOwnerEditEvent;
|
||||
end;
|
||||
|
||||
@ -588,20 +590,20 @@ begin
|
||||
|
||||
if showDetails then begin
|
||||
// Event description
|
||||
Result := Result + LineEnding + LineEnding +
|
||||
Result := Result + LineEnding2 +
|
||||
RSEvent + ':' + LineEnding + AEvent.Description;
|
||||
|
||||
// Event notes
|
||||
if (AEvent.Notes <> '') then begin
|
||||
s := WrapText(AEvent.Notes, MAX_HINT_WIDTH);
|
||||
s := StripLastLineEnding(s);
|
||||
Result := Result + LineEnding + LineEnding +
|
||||
Result := Result + LineEnding2 +
|
||||
RSNotes + ':' + LineEnding + s;
|
||||
end;
|
||||
|
||||
// Event location
|
||||
if (AEvent.Location <> '') then
|
||||
Result := Result + LineEnding + LineEnding +
|
||||
Result := Result + LineEnding2 +
|
||||
RSLocation + ':' + LineEnding + AEvent.Location;
|
||||
end;
|
||||
end
|
||||
@ -761,7 +763,7 @@ begin
|
||||
|
||||
if ActiveEvent <> nil then begin
|
||||
if Verify then
|
||||
DoIt := (MessageDlg(RSConfirmDeleteEvent + #13#10#10 + RSPermanent,
|
||||
DoIt := (MessageDlg(RSConfirmDeleteEvent + LineEnding2 + RSPermanent,
|
||||
mtConfirmation, [mbYes, mbNo], 0) = mrYes);
|
||||
|
||||
if DoIt then begin
|
||||
@ -1440,6 +1442,8 @@ begin
|
||||
DataStore.PostEvents;
|
||||
if IsNewEvent and Assigned(FOnAddEvent) then
|
||||
FOnAddEvent(self, ActiveEvent);
|
||||
if not IsNewEvent and Assigned(FOnModifyEvent) then
|
||||
FOnModifyEvent(self, ActiveEvent);
|
||||
end else begin
|
||||
if IsNewEvent then begin
|
||||
DataStore.Resource.Schedule.DeleteEvent(ActiveEvent);
|
||||
|
Reference in New Issue
Block a user