You've already forked lazarus-ccr
tvplanit: Add property ShowDetails to resource groups in order to control the level of detail visible for overlayed events.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@5152 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@@ -413,11 +413,18 @@ var
|
|||||||
begin
|
begin
|
||||||
datastore := VpControlLink1.Datastore;
|
datastore := VpControlLink1.Datastore;
|
||||||
grp := datastore.Resources.AddResourceGroup([1, 2], NAME_OF_GROUP);
|
grp := datastore.Resources.AddResourceGroup([1, 2], NAME_OF_GROUP);
|
||||||
grp.ReadOnly := true;
|
|
||||||
grp.Pattern := opDiagCross;
|
grp.Pattern := opDiagCross;
|
||||||
|
|
||||||
|
// Optionally uncomment these lines to get not-default behavior:
|
||||||
|
//grp.ReadOnly := false;
|
||||||
|
//grp.ShowDetails := [odResource, odEventDescription, odEventCategory];
|
||||||
|
|
||||||
|
// Assign the resource group to the active resource of the datastore.
|
||||||
if datastore.Resource <> nil then
|
if datastore.Resource <> nil then
|
||||||
datastore.Resource.Group := grp else
|
datastore.Resource.Group := grp
|
||||||
|
else
|
||||||
datastore.Resource.Group := nil;
|
datastore.Resource.Group := nil;
|
||||||
|
|
||||||
// Important: This is not called internally so far!
|
// Important: This is not called internally so far!
|
||||||
datastore.RefreshEvents; // or: datastore.UpdateGroupEvents;
|
datastore.RefreshEvents; // or: datastore.UpdateGroupEvents;
|
||||||
end;
|
end;
|
||||||
@@ -449,6 +456,8 @@ begin
|
|||||||
CategoryColorMap.Category0.BackgroundColor := clSkyBlue;
|
CategoryColorMap.Category0.BackgroundColor := clSkyBlue;
|
||||||
CategoryColorMap.Category0.Color := clNavy;
|
CategoryColorMap.Category0.Color := clNavy;
|
||||||
CategoryColorMap.Category0.Description := 'Appointment';
|
CategoryColorMap.Category0.Description := 'Appointment';
|
||||||
|
// CategoryColorMap.Category0.Bitmap.Transparent := true; // <-- not working
|
||||||
|
CategoryColorMap.Category0.Bitmap.LoadFromResourceName(HINSTANCE, 'VPUPARROW');
|
||||||
CategoryColorMap.Category1.BackgroundColor := 13290239;
|
CategoryColorMap.Category1.BackgroundColor := 13290239;
|
||||||
CategoryColorMap.Category1.Color := clRed;
|
CategoryColorMap.Category1.Color := clRed;
|
||||||
CategoryColorMap.Category1.Description := 'Urgent';
|
CategoryColorMap.Category1.Description := 'Urgent';
|
||||||
|
@@ -729,6 +729,10 @@ msgstr "Außerhalb des zulässigen Bereichs"
|
|||||||
msgid "OVERDUE!"
|
msgid "OVERDUE!"
|
||||||
msgstr "ABGELAUFEN!"
|
msgstr "ABGELAUFEN!"
|
||||||
|
|
||||||
|
#: vpsr.rsoverlayedevent
|
||||||
|
msgid "overlayed"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: vpsr.rsownernotwinctrl
|
#: vpsr.rsownernotwinctrl
|
||||||
msgid "Owner must be a TWinControl descendent"
|
msgid "Owner must be a TWinControl descendent"
|
||||||
msgstr "Owner muss von TWinControl abstammen"
|
msgstr "Owner muss von TWinControl abstammen"
|
||||||
@@ -1494,3 +1498,4 @@ msgstr "Unbekannte Achsen-Spezifikation: %s"
|
|||||||
#: vpsr.sxmldecnotatbeg
|
#: vpsr.sxmldecnotatbeg
|
||||||
msgid "The XML declaration must appear before the first element"
|
msgid "The XML declaration must appear before the first element"
|
||||||
msgstr "Die XML-Deklaration muss vor dem ersten Element erscheinen."
|
msgstr "Die XML-Deklaration muss vor dem ersten Element erscheinen."
|
||||||
|
|
||||||
|
@@ -735,6 +735,10 @@ msgstr "Hors de portée"
|
|||||||
msgid "OVERDUE!"
|
msgid "OVERDUE!"
|
||||||
msgstr "EN RETARD!"
|
msgstr "EN RETARD!"
|
||||||
|
|
||||||
|
#: vpsr.rsoverlayedevent
|
||||||
|
msgid "overlayed"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: vpsr.rsownernotwinctrl
|
#: vpsr.rsownernotwinctrl
|
||||||
msgid "Owner must be a TWinControl descendent"
|
msgid "Owner must be a TWinControl descendent"
|
||||||
msgstr "Le propriétaire doit être un descendant de TWinControl"
|
msgstr "Le propriétaire doit être un descendant de TWinControl"
|
||||||
|
@@ -729,6 +729,10 @@ msgstr "Buiten geldig bereik"
|
|||||||
msgid "OVERDUE!"
|
msgid "OVERDUE!"
|
||||||
msgstr "OVER TIJD!"
|
msgstr "OVER TIJD!"
|
||||||
|
|
||||||
|
#: vpsr.rsoverlayedevent
|
||||||
|
msgid "overlayed"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: vpsr.rsownernotwinctrl
|
#: vpsr.rsownernotwinctrl
|
||||||
msgid "Owner must be a TWinControl descendent"
|
msgid "Owner must be a TWinControl descendent"
|
||||||
msgstr "Owner moet van TWinControl afstammen"
|
msgstr "Owner moet van TWinControl afstammen"
|
||||||
|
@@ -719,6 +719,10 @@ msgstr ""
|
|||||||
msgid "OVERDUE!"
|
msgid "OVERDUE!"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: vpsr.rsoverlayedevent
|
||||||
|
msgid "overlayed"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: vpsr.rsownernotwinctrl
|
#: vpsr.rsownernotwinctrl
|
||||||
msgid "Owner must be a TWinControl descendent"
|
msgid "Owner must be a TWinControl descendent"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
@@ -729,6 +729,10 @@ msgstr "За пределами диапазона"
|
|||||||
msgid "OVERDUE!"
|
msgid "OVERDUE!"
|
||||||
msgstr "ПРОСРОЧЕНО!"
|
msgstr "ПРОСРОЧЕНО!"
|
||||||
|
|
||||||
|
#: vpsr.rsoverlayedevent
|
||||||
|
msgid "overlayed"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: vpsr.rsownernotwinctrl
|
#: vpsr.rsownernotwinctrl
|
||||||
msgid "Owner must be a TWinControl descendent"
|
msgid "Owner must be a TWinControl descendent"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
@@ -202,8 +202,8 @@ type
|
|||||||
FDescription: string;
|
FDescription: string;
|
||||||
FIndex: Integer;
|
FIndex: Integer;
|
||||||
FBitmap: TBitmap;
|
FBitmap: TBitmap;
|
||||||
procedure SetBackgroundColor (const v : TColor);
|
procedure SetBackgroundColor(const v: TColor);
|
||||||
procedure SetBitmap (v : TBitmap);
|
procedure SetBitmap(v: TBitmap);
|
||||||
procedure SetColor(Value: TColor);
|
procedure SetColor(Value: TColor);
|
||||||
procedure SetDescription(Value: string);
|
procedure SetDescription(Value: string);
|
||||||
public
|
public
|
||||||
@@ -212,7 +212,7 @@ type
|
|||||||
published
|
published
|
||||||
property BackgroundColor: TColor
|
property BackgroundColor: TColor
|
||||||
read FBackgroundColor write SetBackgroundColor default clWindow;
|
read FBackgroundColor write SetBackgroundColor default clWindow;
|
||||||
property Bitmap : TBitmap read FBitmap write SetBitmap;
|
property Bitmap: TBitmap read FBitmap write SetBitmap;
|
||||||
property Color: TColor read FColor write SetColor;
|
property Color: TColor read FColor write SetColor;
|
||||||
property Description: string read FDescription write SetDescription;
|
property Description: string read FDescription write SetDescription;
|
||||||
property CategoryIndex: Integer read FCategoryIndex;
|
property CategoryIndex: Integer read FCategoryIndex;
|
||||||
|
@@ -210,6 +210,7 @@ type
|
|||||||
FAutoConnect : Boolean;
|
FAutoConnect : Boolean;
|
||||||
FLoading : Boolean;
|
FLoading : Boolean;
|
||||||
FCategoryColorMap : TVpCategoryColorMap;
|
FCategoryColorMap : TVpCategoryColorMap;
|
||||||
|
FHiddenCategories : TVpCategoryInfo;
|
||||||
FResources : TVpResources;
|
FResources : TVpResources;
|
||||||
FTimeRange : TVpTimeRange;
|
FTimeRange : TVpTimeRange;
|
||||||
FActiveDate : TDateTime;
|
FActiveDate : TDateTime;
|
||||||
@@ -298,6 +299,8 @@ type
|
|||||||
published
|
published
|
||||||
property CategoryColorMap: TVpCategoryColorMap
|
property CategoryColorMap: TVpCategoryColorMap
|
||||||
read FCategoryColorMap write FCategoryColorMap;
|
read FCategoryColorMap write FCategoryColorMap;
|
||||||
|
property HiddenCategories: TVpCategoryInfo
|
||||||
|
read FHiddenCategories write FHiddenCategories;
|
||||||
property DefaultEventSound: string
|
property DefaultEventSound: string
|
||||||
read FDefaultEventSound write FDefaultEventSound;
|
read FDefaultEventSound write FDefaultEventSound;
|
||||||
property EnableEventTimer: Boolean
|
property EnableEventTimer: Boolean
|
||||||
@@ -434,7 +437,14 @@ begin
|
|||||||
FAutoCreate := true;
|
FAutoCreate := true;
|
||||||
FResources := TVpResources.Create(Self);
|
FResources := TVpResources.Create(Self);
|
||||||
FTimeRange := TVpTimeRange.Create(Self);
|
FTimeRange := TVpTimeRange.Create(Self);
|
||||||
|
|
||||||
FCategoryColorMap := TVpCategoryColorMap.Create;
|
FCategoryColorMap := TVpCategoryColorMap.Create;
|
||||||
|
FHiddenCategories := TVpCategoryInfo.Create;
|
||||||
|
with FHiddenCategories do begin
|
||||||
|
BackgroundColor := clSilver;
|
||||||
|
Color := clGray;
|
||||||
|
end;
|
||||||
|
|
||||||
FActiveDate := Now;
|
FActiveDate := Now;
|
||||||
FDayBuffer := 31; {One full month before and after the current date. }
|
FDayBuffer := 31; {One full month before and after the current date. }
|
||||||
FTimeRange.StartTime := Now - FDayBuffer;
|
FTimeRange.StartTime := Now - FDayBuffer;
|
||||||
@@ -453,7 +463,6 @@ begin
|
|||||||
dsAlertTimer.Interval := 500;
|
dsAlertTimer.Interval := 500;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
{ If the DataStore is being dropped onto a form for the first time... }
|
{ If the DataStore is being dropped onto a form for the first time... }
|
||||||
if (csDesigning in ComponentState) and not (csLoading in ComponentState) then
|
if (csDesigning in ComponentState) and not (csLoading in ComponentState) then
|
||||||
LinkToControls(Owner);
|
LinkToControls(Owner);
|
||||||
@@ -476,6 +485,7 @@ begin
|
|||||||
FResources.Free;
|
FResources.Free;
|
||||||
FTimeRange.Free;
|
FTimeRange.Free;
|
||||||
FCategoryColorMap.Free;
|
FCategoryColorMap.Free;
|
||||||
|
FHiddenCategories.Free;
|
||||||
|
|
||||||
if dsAlertTimer <> nil then
|
if dsAlertTimer <> nil then
|
||||||
dsAlertTimer.Free;
|
dsAlertTimer.Free;
|
||||||
|
@@ -60,8 +60,12 @@ type
|
|||||||
|
|
||||||
TVpContactSort = (csLastFirst, csFirstLast);
|
TVpContactSort = (csLastFirst, csFirstLast);
|
||||||
|
|
||||||
TVpOverlayPattern = (opHorizontal=2, opVertical, opFDiagonal,
|
TVpOverlayPattern = (opSolid, opClear, opHorizontal, opVertical,
|
||||||
opBDiagonal, opCross, opDiagCross);
|
opFDiagonal, opBDiagonal, opCross, opDiagCross);
|
||||||
|
|
||||||
|
TVpOverlayDetail = (odResource, odEventDescription, odEventCategory);
|
||||||
|
TVpOverlayDetails = set of TVpOverlayDetail;
|
||||||
|
|
||||||
|
|
||||||
{ forward declarations }
|
{ forward declarations }
|
||||||
TVpResource = class;
|
TVpResource = class;
|
||||||
@@ -191,9 +195,11 @@ type
|
|||||||
FIDs: Array of Integer;
|
FIDs: Array of Integer;
|
||||||
FReadOnly: Boolean;
|
FReadOnly: Boolean;
|
||||||
FPattern: TVpOverlayPattern;
|
FPattern: TVpOverlayPattern;
|
||||||
|
FShowDetails: TVpOverlayDetails;
|
||||||
function GetCount: integer;
|
function GetCount: integer;
|
||||||
function GetItem(AIndex: Integer): TVpResource;
|
function GetItem(AIndex: Integer): TVpResource;
|
||||||
procedure SetPattern(AValue: TVpOverlayPattern);
|
procedure SetPattern(AValue: TVpOverlayPattern);
|
||||||
|
procedure SetShowDetails(AValue: TVpOverlayDetails);
|
||||||
public
|
public
|
||||||
constructor Create(AOwner: TVpResources; AResourceID: Integer; ACaption: String);
|
constructor Create(AOwner: TVpResources; AResourceID: Integer; ACaption: String);
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
@@ -205,9 +211,10 @@ type
|
|||||||
property Caption: String read FCaption;
|
property Caption: String read FCaption;
|
||||||
property Count: Integer read GetCount;
|
property Count: Integer read GetCount;
|
||||||
property Items[AIndex: Integer]: TVpResource read GetItem; default;
|
property Items[AIndex: Integer]: TVpResource read GetItem; default;
|
||||||
|
property Pattern: TVpOverlayPattern read FPattern write SetPattern;
|
||||||
property ResourceID: Integer read FResourceID;
|
property ResourceID: Integer read FResourceID;
|
||||||
property ReadOnly: boolean read FReadOnly write FReadOnly;
|
property ReadOnly: boolean read FReadOnly write FReadOnly;
|
||||||
property Pattern: TVpOverlayPattern read FPattern write SetPattern;
|
property ShowDetails: TVpOverlayDetails read FShowDetails write SetShowDetails;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
TVpSchedule = class
|
TVpSchedule = class
|
||||||
@@ -1001,6 +1008,7 @@ begin
|
|||||||
FCaption := ACaption;
|
FCaption := ACaption;
|
||||||
FPattern := opBDiagonal;
|
FPattern := opBDiagonal;
|
||||||
FReadOnly := true;
|
FReadOnly := true;
|
||||||
|
FShowDetails := [odResource];
|
||||||
Clear;
|
Clear;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@@ -1098,8 +1106,16 @@ begin
|
|||||||
if FPattern = AValue then
|
if FPattern = AValue then
|
||||||
exit;
|
exit;
|
||||||
FPattern := AValue;
|
FPattern := AValue;
|
||||||
|
// to do: repaint the controls
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TVpResourceGroup.SetShowDetails(AValue: TVpOverlayDetails);
|
||||||
|
begin
|
||||||
|
if FShowDetails = AValue then
|
||||||
|
exit;
|
||||||
|
FShowDetails := AValue;
|
||||||
|
// To do: repaint the controls
|
||||||
|
end;
|
||||||
|
|
||||||
(*****************************************************************************)
|
(*****************************************************************************)
|
||||||
{ TVpEvent }
|
{ TVpEvent }
|
||||||
|
@@ -76,7 +76,7 @@ type
|
|||||||
OldFont: TFont;
|
OldFont: TFont;
|
||||||
|
|
||||||
protected
|
protected
|
||||||
function BuildEventString(AEvent: TVpEvent; const AEventRect, AIconRect: TRect): String;
|
function BuildEventString(AEvent: TVpEvent): String;
|
||||||
procedure CalcRowHeadRect(out ARect: TRect);
|
procedure CalcRowHeadRect(out ARect: TRect);
|
||||||
function CalcRowHeadWidth: Integer;
|
function CalcRowHeadWidth: Integer;
|
||||||
function CountOverlappingEvents(Event: TVpEvent; const EArray: TVpDvEventArray): Integer;
|
function CountOverlappingEvents(Event: TVpEvent; const EArray: TVpDvEventArray): Integer;
|
||||||
@@ -128,7 +128,7 @@ implementation
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
StrUtils, Math, LazUtf8,
|
StrUtils, Math, LazUtf8,
|
||||||
VpCanvasUtils, VpMisc;
|
VpSR, VpCanvasUtils, VpMisc;
|
||||||
|
|
||||||
const
|
const
|
||||||
ICON_MARGIN = 4;
|
ICON_MARGIN = 4;
|
||||||
@@ -145,35 +145,41 @@ begin
|
|||||||
FDayView := ADayView;
|
FDayView := ADayView;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TVpDayViewPainter.BuildEventString(AEvent: TVpEvent;
|
function TVpDayViewPainter.BuildEventString(AEvent: TVpEvent): String;
|
||||||
const AEventRect, AIconRect: TRect): String;
|
|
||||||
var
|
var
|
||||||
maxW: Integer;
|
maxW: Integer;
|
||||||
timeFmt: String;
|
timeFmt: String;
|
||||||
res: TVpResource;
|
res: TVpResource;
|
||||||
|
grp: TVpResourceGroup;
|
||||||
|
isOverlayed: Boolean;
|
||||||
begin
|
begin
|
||||||
|
Result := '';
|
||||||
|
|
||||||
|
grp := FDayView.Datastore.Resource.Group;
|
||||||
|
isOverlayed := AEvent.IsOverlayed;
|
||||||
|
|
||||||
|
if isOverlayed then begin
|
||||||
|
if (grp <> nil) and (odResource in grp.ShowDetails) then begin
|
||||||
|
res := FDayView.Datastore.Resources.GetResource(AEvent.ResourceID);
|
||||||
|
if res <> nil then
|
||||||
|
Result := '[' + res.Description + '] ';
|
||||||
|
end else
|
||||||
|
Result := '[' + RSOverlayedEvent + '] ';
|
||||||
|
end;
|
||||||
|
|
||||||
|
if (not isOverlayed) or ((grp <> nil) and (odEventDescription in grp.ShowDetails)) then
|
||||||
|
begin
|
||||||
|
if Result <> '' then
|
||||||
|
Result := Result + ' ';
|
||||||
if FDayView.ShowEventTimes then begin
|
if FDayView.ShowEventTimes then begin
|
||||||
timeFmt := IfThen(FDayView.TimeFormat = tf24Hour, 'h:nn', 'h:nnam/pm');
|
timeFmt := IfThen(FDayView.TimeFormat = tf24Hour, 'h:nn', 'h:nnam/pm');
|
||||||
Result := Format('%s - %s: %s', [
|
Result := Result + Format('%s - %s: %s', [
|
||||||
FormatDateTime(timeFmt, AEvent.StartTime),
|
FormatDateTime(timeFmt, AEvent.StartTime),
|
||||||
FormatDateTime(timeFmt, AEvent.EndTime),
|
FormatDateTime(timeFmt, AEvent.EndTime),
|
||||||
AEvent.Description
|
AEvent.Description
|
||||||
]);
|
]);
|
||||||
end else
|
end else
|
||||||
Result := AEvent.Description;
|
Result := Result + AEvent.Description;
|
||||||
|
|
||||||
if AEvent.IsOverlayed then begin
|
|
||||||
res := FDayView.Datastore.Resources.GetResource(AEvent.ResourceID);
|
|
||||||
if res <> nil then
|
|
||||||
Result := Format('[%s] %s', [res.Description, Result]);
|
|
||||||
end;
|
|
||||||
|
|
||||||
if FDayView.WrapStyle = wsNone then begin
|
|
||||||
{ if the string is longer than the availble space then chop off the end
|
|
||||||
and place those little '...'s at the end }
|
|
||||||
maxW := AEventRect.Right - AIconRect.Right - FScaledGutterWidth - TextMargin;
|
|
||||||
if RenderCanvas.TextWidth(Result) > maxW then
|
|
||||||
Result := GetDisplayString(RenderCanvas, Result, 0, maxW);
|
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@@ -788,6 +794,7 @@ procedure TVpDayViewPainter.DrawEvent(AEvent: TVpEvent; var AEventRec: TVpDvEven
|
|||||||
var
|
var
|
||||||
EventCategory: TVpCategoryInfo;
|
EventCategory: TVpCategoryInfo;
|
||||||
EventIsEditing: Boolean;
|
EventIsEditing: Boolean;
|
||||||
|
EventIsOverlayed: Boolean;
|
||||||
EventSTime, EventETime: Double;
|
EventSTime, EventETime: Double;
|
||||||
EventDuration: Double;
|
EventDuration: Double;
|
||||||
EventSLine, EventELine, EventLineCount: Integer;
|
EventSLine, EventELine, EventLineCount: Integer;
|
||||||
@@ -796,9 +803,19 @@ var
|
|||||||
StartOffset, EndOffset: Double;
|
StartOffset, EndOffset: Double;
|
||||||
EventString: String;
|
EventString: String;
|
||||||
tmpRect: TRect;
|
tmpRect: TRect;
|
||||||
|
maxW: Integer;
|
||||||
|
grp: TVpResourceGroup;
|
||||||
begin
|
begin
|
||||||
{ Initialize, collect useful information needed later }
|
{ Initialize, collect useful information needed later }
|
||||||
|
if Assigned(FDayView.Datastore) then
|
||||||
|
begin
|
||||||
EventCategory := FDayView.Datastore.CategoryColorMap.GetCategory(AEvent.Category);
|
EventCategory := FDayView.Datastore.CategoryColorMap.GetCategory(AEvent.Category);
|
||||||
|
grp := FDayView.Datastore.Resource.Group;
|
||||||
|
end else begin
|
||||||
|
EventCategory := nil;
|
||||||
|
grp := nil;
|
||||||
|
end;
|
||||||
|
EventIsOverlayed := AEvent.IsOverlayed;
|
||||||
|
|
||||||
with TVpDayViewOpener(FDayView) do
|
with TVpDayViewOpener(FDayView) do
|
||||||
if (dvInplaceEditor <> nil) and dvInplaceEditor.Visible then
|
if (dvInplaceEditor <> nil) and dvInplaceEditor.Visible then
|
||||||
@@ -812,8 +829,8 @@ begin
|
|||||||
AEventRec.RealEndTime := EventETime;
|
AEventRec.RealEndTime := EventETime;
|
||||||
|
|
||||||
{ Find the lines on which this event starts and ends }
|
{ Find the lines on which this event starts and ends }
|
||||||
EventSLine := GetStartLine(EventSTime, UseGran); //FDayView.Granularity);
|
EventSLine := GetStartLine(EventSTime, UseGran);
|
||||||
EventELine := GetEndLine(EventETime, UseGran); //FDayView.Granularity);
|
EventELine := GetEndLine(EventETime, UseGran);
|
||||||
|
|
||||||
{ If the event doesn't occupy area that is currently visible, then skip it. }
|
{ If the event doesn't occupy area that is currently visible, then skip it. }
|
||||||
if (EventELine < StartLine) or (EventSLine > StartLine + RealVisibleLines + 1) then
|
if (EventELine < StartLine) or (EventSLine > StartLine + RealVisibleLines + 1) then
|
||||||
@@ -829,22 +846,32 @@ begin
|
|||||||
PrepareEventRect(AEventRec.WidthDivisor, AEventRec.Level, EventRect);
|
PrepareEventRect(AEventRec.WidthDivisor, AEventRec.Level, EventRect);
|
||||||
|
|
||||||
{ Draw the event rectangle }
|
{ Draw the event rectangle }
|
||||||
|
RenderCanvas.Brush.Color := WindowColor;
|
||||||
if Assigned(FDayView.DataStore) then begin
|
if Assigned(FDayView.DataStore) then begin
|
||||||
if EventIsEditing then
|
if EventIsEditing then
|
||||||
RenderCanvas.Brush.Color := WindowColor
|
RenderCanvas.Brush.Color := WindowColor
|
||||||
else
|
else
|
||||||
|
if Assigned(EventCategory) then
|
||||||
RenderCanvas.Brush.Color := EventCategory.BackgroundColor
|
RenderCanvas.Brush.Color := EventCategory.BackgroundColor
|
||||||
end else
|
end;
|
||||||
RenderCanvas.Brush.Color := WindowColor;
|
if EventIsOverlayed then begin
|
||||||
if AEvent.IsOverlayed then
|
if (grp <> nil) and (not (odEventCategory in grp.ShowDetails)) then
|
||||||
|
RenderCanvas.Brush.Color := FDayView.Datastore.HiddenCategories.BackgroundColor
|
||||||
|
else
|
||||||
RenderCanvas.Brush.Style := OverlayPatternToBrushStyle(AEvent.GetResource.Group.Pattern);
|
RenderCanvas.Brush.Style := OverlayPatternToBrushStyle(AEvent.GetResource.Group.Pattern);
|
||||||
|
end;
|
||||||
TPSFillRect(RenderCanvas, Angle, RenderIn, EventRect);
|
TPSFillRect(RenderCanvas, Angle, RenderIn, EventRect);
|
||||||
RenderCanvas.Brush.Style := bsSolid;
|
RenderCanvas.Brush.Style := bsSolid;
|
||||||
|
|
||||||
{ Paint the little area to the left of the text the color corresponding to
|
{ Paint the little area to the left of the text the color corresponding to
|
||||||
the event's category. These colors are used even when printing }
|
the event's category. These colors are used even when printing }
|
||||||
if Assigned(FDayView.DataStore) then
|
RenderCanvas.Brush.Color := clNavy;
|
||||||
|
if Assigned(FDayView.Datastore) then
|
||||||
|
begin
|
||||||
RenderCanvas.Brush.Color := EventCategory.Color;
|
RenderCanvas.Brush.Color := EventCategory.Color;
|
||||||
|
if EventIsOverlayed and (grp <> nil) and (not (odEventCategory in grp.ShowDetails)) then
|
||||||
|
RenderCanvas.Brush.Color := FDayView.Datastore.HiddenCategories.Color;
|
||||||
|
end;
|
||||||
|
|
||||||
{ find the pixel offset to use for determining where to start and }
|
{ find the pixel offset to use for determining where to start and }
|
||||||
{ stop drawing colored area according to the start time and end time of the event. }
|
{ stop drawing colored area according to the start time and end time of the event. }
|
||||||
@@ -914,10 +941,18 @@ begin
|
|||||||
if FDayView.IconAttributes.ShowInPrint then
|
if FDayView.IconAttributes.ShowInPrint then
|
||||||
DrawIcons(IconRect);
|
DrawIcons(IconRect);
|
||||||
|
|
||||||
{ build the event string }
|
{ Build the event string }
|
||||||
EventString := BuildEventString(AEvent, EventRect, IconRect);
|
EventString := BuildEventString(AEvent);
|
||||||
|
|
||||||
{ draw the event string }
|
{ If the string is longer than the availble space then chop off the end
|
||||||
|
and place those little '...'s at the end }
|
||||||
|
if FDayView.WrapStyle = wsNone then begin
|
||||||
|
maxW := EventRect.Right - IconRect.Right - FScaledGutterWidth - TextMargin;
|
||||||
|
if RenderCanvas.TextWidth(EventString) > maxW then
|
||||||
|
EventString := GetDisplayString(RenderCanvas, EventString, 0, maxW);
|
||||||
|
end;
|
||||||
|
|
||||||
|
{ Draw the event string }
|
||||||
DrawEventText(EventString, EventRect, IconRect, AEventRec.Level);
|
DrawEventText(EventString, EventRect, IconRect, AEventRec.Level);
|
||||||
|
|
||||||
{ paint the borders around the event text area }
|
{ paint the borders around the event text area }
|
||||||
@@ -1587,6 +1622,8 @@ var
|
|||||||
cat: TVpCategoryInfo;
|
cat: TVpCategoryInfo;
|
||||||
w, h: Integer;
|
w, h: Integer;
|
||||||
R: TRect;
|
R: TRect;
|
||||||
|
isOverlayed: Boolean;
|
||||||
|
grp: TVpResourceGroup;
|
||||||
begin
|
begin
|
||||||
ShowAlarm := False;
|
ShowAlarm := False;
|
||||||
ShowRecurring := False;
|
ShowRecurring := False;
|
||||||
@@ -1601,13 +1638,23 @@ begin
|
|||||||
ShowAlarm := (dvBmpAlarm.Width <> 0) and (dvBmpAlarm.Height <> 0);
|
ShowAlarm := (dvBmpAlarm.Width <> 0) and (dvBmpAlarm.Height <> 0);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if Event.RepeatCode <> rtNone then begin
|
if Event.RepeatCode <> rtNone then
|
||||||
|
begin
|
||||||
dvBmpRecurring.Assign(FDayView.IconAttributes.RecurringBitmap);
|
dvBmpRecurring.Assign(FDayView.IconAttributes.RecurringBitmap);
|
||||||
ShowRecurring := (dvBmpRecurring.Width <> 0) and (dvBmpRecurring.Height <> 0);
|
ShowRecurring := (dvBmpRecurring.Width <> 0) and (dvBmpRecurring.Height <> 0);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if Assigned(FDayView.DataStore) then begin
|
if Assigned(FDayView.DataStore) then
|
||||||
if Event.Category < 10 then begin
|
begin
|
||||||
|
isOverlayed := Event.IsOverlayed;
|
||||||
|
grp := FDayView.Datastore.Resource.Group;
|
||||||
|
if isOverlayed and (grp <> nil) and (not (odEventCategory in grp.ShowDetails)) then
|
||||||
|
begin
|
||||||
|
dvBmpCategory.Width := 0;
|
||||||
|
dvBmpCategory.Height := 0;
|
||||||
|
end else
|
||||||
|
if Event.Category < 10 then
|
||||||
|
begin
|
||||||
cat := FDayView.Datastore.CategoryColorMap.GetCategory(Event.Category);
|
cat := FDayView.Datastore.CategoryColorMap.GetCategory(Event.Category);
|
||||||
w := cat.Bitmap.Width;
|
w := cat.Bitmap.Width;
|
||||||
h := cat.Bitmap.Height;
|
h := cat.Bitmap.Height;
|
||||||
|
@@ -155,6 +155,7 @@ resourcestring
|
|||||||
'Do you want to flip them?';
|
'Do you want to flip them?';
|
||||||
RSCannotEditOverlayedEvent= 'Cannot edit this overlayed event.';
|
RSCannotEditOverlayedEvent= 'Cannot edit this overlayed event.';
|
||||||
RSNoOverlayedEvents = 'none';
|
RSNoOverlayedEvents = 'none';
|
||||||
|
RSOverlayedEvent = 'overlayed';
|
||||||
|
|
||||||
{Task Specific}
|
{Task Specific}
|
||||||
RSConfirmDeleteTask = 'Delete this task from your list?';
|
RSConfirmDeleteTask = 'Delete this task from your list?';
|
||||||
|
@@ -80,23 +80,37 @@ function TVpWeekViewPainter.BuildEventString(AEvent: TVpEvent;
|
|||||||
var
|
var
|
||||||
timeFmt: String;
|
timeFmt: String;
|
||||||
res: TVpResource;
|
res: TVpResource;
|
||||||
|
grp: TVpResourceGroup;
|
||||||
|
isOverlayed: Boolean;
|
||||||
begin
|
begin
|
||||||
if FWeekView.ShowEventTime then
|
grp := FWeekView.Datastore.Resource.Group;
|
||||||
begin
|
isOverlayed := AEvent.IsOverlayed;
|
||||||
timefmt := IfThen(FWeekView.TimeFormat = tf24Hour, 'hh:nn', 'hh:nn AM/PM');
|
|
||||||
Result := Format('%s - %s: ', [
|
|
||||||
FormatDateTime(timeFmt, AStartTime),
|
|
||||||
FormatDateTime(timeFmt, AEndTime)
|
|
||||||
]);
|
|
||||||
Result := Result + ' ' + AEvent.Description;
|
|
||||||
end else
|
|
||||||
Result := AEvent.Description;
|
|
||||||
|
|
||||||
if AEvent.IsOverlayed then
|
if isOverlayed then
|
||||||
|
begin
|
||||||
|
if (grp <> nil) and (odResource in grp.ShowDetails) then
|
||||||
begin
|
begin
|
||||||
res := FWeekView.Datastore.Resources.GetResource(AEvent.ResourceID);
|
res := FWeekView.Datastore.Resources.GetResource(AEvent.ResourceID);
|
||||||
if res <> nil then
|
if res <> nil then
|
||||||
Result := Format('[%s] %s', [res.Description, Result]);
|
Result := '[' + res.Description + ']';
|
||||||
|
end else
|
||||||
|
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;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user