tvplanit: Improved assembly of event text in WeekView.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@5153 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2016-09-11 13:46:45 +00:00
parent cd23d554eb
commit 30ece2b296
2 changed files with 14 additions and 17 deletions

View File

@ -413,9 +413,9 @@ var
begin
datastore := VpControlLink1.Datastore;
grp := datastore.Resources.AddResourceGroup([1, 2], NAME_OF_GROUP);
grp.Pattern := opDiagCross;
// Optionally uncomment these lines to get not-default behavior:
//grp.Pattern := opDiagCross;
//grp.ReadOnly := false;
//grp.ShowDetails := [odResource, odEventDescription, odEventCategory];

View File

@ -86,32 +86,29 @@ begin
grp := FWeekView.Datastore.Resource.Group;
isOverlayed := AEvent.IsOverlayed;
if FWeekView.ShowEventTime then
begin
timefmt := IfThen(FWeekView.TimeFormat = tf24Hour, 'hh:nn', 'hh:nn AM/PM');
Result := Result + Format('%s - %s: ', [
FormatDateTime(timeFmt, AStartTime),
FormatDateTime(timeFmt, AEndTime)
]);
end else
Result := '';
if isOverlayed then
begin
if (grp <> nil) and (odResource in grp.ShowDetails) then
begin
res := FWeekView.Datastore.Resources.GetResource(AEvent.ResourceID);
if res <> nil then
Result := '[' + res.Description + ']';
Result := Result + '[' + res.Description + '] ';
end else
Result := '[' + RSOverlayedEvent + ']';
Result := Result + '[' + RSOverlayedEvent + '] ';
end;
if (not isOverlayed) or ((grp <> nil) and (odEventDescription in grp.ShowDetails)) then
begin
if Result <> '' then
Result := Result + ' ';
if FWeekView.ShowEventTime then
begin
timefmt := IfThen(FWeekView.TimeFormat = tf24Hour, 'hh:nn', 'hh:nn AM/PM');
Result := Result + Format('%s - %s: %s', [
FormatDateTime(timeFmt, AStartTime),
FormatDateTime(timeFmt, AEndTime),
AEvent.Description
]);
end else
Result := Result + AEvent.Description;
end;
end;
procedure TVpWeekViewPainter.Clear;