You've already forked lazarus-ccr
tvplanit: Fix drawing glitches in TVpDayView.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8440 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -2544,7 +2544,11 @@ procedure TVpDayView.SetShowNavButtons(Value: Boolean);
|
|||||||
begin
|
begin
|
||||||
if Value <> FShowNavButtons then begin
|
if Value <> FShowNavButtons then begin
|
||||||
FShowNavButtons := Value;
|
FShowNavButtons := Value;
|
||||||
Invalidate;
|
dvDayUpBtn.Visible := FShowNavButtons;
|
||||||
|
dvDayDownBtn.Visible := FShowNavButtons;
|
||||||
|
dvTodayBtn.Visible := FShowNavButtons;
|
||||||
|
dvWeekUpBtn.Visible := FShowNavButtons;
|
||||||
|
dvWeekDownBtn.Visible := FShowNavButtons;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -253,7 +253,7 @@ begin
|
|||||||
Result := nil;
|
Result := nil;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ returns the maximum OLEvents value from all overlapping neighbors }
|
{ Returns the maximum OLEvents value from all overlapping neighbors }
|
||||||
function TVpDayViewPainter.GetMaxOLEvents(Event: TVpEvent; const EArray: TVpDvEventArray): Integer;
|
function TVpDayViewPainter.GetMaxOLEvents(Event: TVpEvent; const EArray: TVpDvEventArray): Integer;
|
||||||
var
|
var
|
||||||
K: Integer;
|
K: Integer;
|
||||||
@ -454,16 +454,10 @@ var
|
|||||||
begin
|
begin
|
||||||
tmpRect := Rect(RealLeft, RealTop, RealRight-1, RealBottom-1);
|
tmpRect := Rect(RealLeft, RealTop, RealRight-1, RealBottom-1);
|
||||||
tmpRect := TPSRotateRectangle(Angle, RenderIn, tmpRect);
|
tmpRect := TPSRotateRectangle(Angle, RenderIn, tmpRect);
|
||||||
|
case FDayView.DrawingStyle of
|
||||||
if FDayView.DrawingStyle = dsFlat then begin
|
dsNoBorder: ;
|
||||||
{ Draw a simple border }
|
dsFlat: DrawBevelRect(RenderCanvas, tmpRect, BevelShadow, BevelShadow);
|
||||||
DrawBevelRect(RenderCanvas, tmpRect, BevelShadow, BevelShadow);
|
ds3D: DrawBevelRect(RenderCanvas, tmpRect, BevelShadow, BevelHighlight);
|
||||||
end else
|
|
||||||
if FDayView.DrawingStyle = ds3d then begin
|
|
||||||
{ Draw a 3d bevel }
|
|
||||||
DrawBevelRect(RenderCanvas, tmpRect, BevelShadow, BevelHighlight);
|
|
||||||
InflateRect(tmpRect, -1, -1);
|
|
||||||
DrawBevelRect(RenderCanvas, tmpRect, BevelDarkShadow, BevelFace);
|
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -480,24 +474,21 @@ begin
|
|||||||
if StartLine < 0 then
|
if StartLine < 0 then
|
||||||
StartLine := FDayView.TopLine;
|
StartLine := FDayView.TopLine;
|
||||||
|
|
||||||
dec(R.Top);
|
// Set GutterRect size
|
||||||
inc(R.Bottom);
|
|
||||||
|
|
||||||
{ Set GutterRect size }
|
|
||||||
GutterRect.Left := R.Left;
|
GutterRect.Left := R.Left;
|
||||||
GutterRect.Top := R.Top;
|
GutterRect.Top := R.Top;
|
||||||
GutterRect.Bottom := R.Bottom;
|
GutterRect.Bottom := R.Bottom;
|
||||||
GutterRect.Right := GutterRect.Left + FScaledGutterWidth;
|
GutterRect.Right := GutterRect.Left + FScaledGutterWidth;
|
||||||
R.Left := R.Left + FScaledGutterWidth + 1;
|
R.Left := R.Left + FScaledGutterWidth + 1;
|
||||||
|
|
||||||
{ paint gutter area }
|
// Paint gutter area
|
||||||
RenderCanvas.Brush.Color := RealColor;
|
RenderCanvas.Brush.Color := RealColor;
|
||||||
tmpRect := GutterRect;
|
tmpRect := GutterRect;
|
||||||
if FDayView.DrawingStyle = dsNoBorder then
|
if FDayView.DrawingStyle = dsNoBorder then
|
||||||
inc(tmpRect.Bottom);
|
inc(tmpRect.Bottom);
|
||||||
TPSFillRect(RenderCanvas, Angle, RenderIn, tmpRect);
|
TPSFillRect(RenderCanvas, Angle, RenderIn, tmpRect);
|
||||||
|
|
||||||
{ draw the line down the right side of the gutter }
|
// Draw the line down the right side of the gutter
|
||||||
RenderCanvas.Pen.Color := BevelShadow;
|
RenderCanvas.Pen.Color := BevelShadow;
|
||||||
RenderCanvas.Pen.Style := psSolid;
|
RenderCanvas.Pen.Style := psSolid;
|
||||||
TPSMoveTo(RenderCanvas, Angle, RenderIn, GutterRect.Right, GutterRect.Top);
|
TPSMoveTo(RenderCanvas, Angle, RenderIn, GutterRect.Right, GutterRect.Top);
|
||||||
@ -526,7 +517,7 @@ begin
|
|||||||
RenderCanvas.Pen.Style := psSolid;
|
RenderCanvas.Pen.Style := psSolid;
|
||||||
RenderCanvas.Pen.Color := FDayView.LineColor;
|
RenderCanvas.Pen.Color := FDayView.LineColor;
|
||||||
|
|
||||||
{ Paint the client area }
|
// Paint the client area
|
||||||
I := 0;
|
I := 0;
|
||||||
while true do begin
|
while true do begin
|
||||||
lineIndex := StartLine + I;
|
lineIndex := StartLine + I;
|
||||||
@ -600,7 +591,7 @@ begin
|
|||||||
|
|
||||||
TPSFillRect (RenderCanvas, Angle, RenderIn, LineRect);
|
TPSFillRect (RenderCanvas, Angle, RenderIn, LineRect);
|
||||||
|
|
||||||
{ Draw the lines }
|
// Draw the lines
|
||||||
RenderCanvas.Pen.Color := FDayView.LineColor;
|
RenderCanvas.Pen.Color := FDayView.LineColor;
|
||||||
TPSMoveTo(RenderCanvas, Angle, RenderIn, LineRect.Left, LineRect.Bottom - 1);
|
TPSMoveTo(RenderCanvas, Angle, RenderIn, LineRect.Left, LineRect.Bottom - 1);
|
||||||
if (lineIndex + 1) mod FDayView.RowLinesStep = 0 then
|
if (lineIndex + 1) mod FDayView.RowLinesStep = 0 then
|
||||||
@ -608,12 +599,11 @@ begin
|
|||||||
inc(I);
|
inc(I);
|
||||||
end; // while true ...
|
end; // while true ...
|
||||||
|
|
||||||
{ Draw a line down the right side of the column to close the }
|
// Draw a line down the right side of the column to close the cells right sides
|
||||||
{ cells right sides }
|
|
||||||
RenderCanvas.Pen.Color := BevelShadow;
|
RenderCanvas.Pen.Color := BevelShadow;
|
||||||
RenderCanvas.Pen.Style := psSolid;
|
RenderCanvas.Pen.Style := psSolid;
|
||||||
TPSMoveTo(RenderCanvas, Angle, RenderIn, R.Right - 1, R.Bottom);
|
TPSMoveTo(RenderCanvas, Angle, RenderIn, R.Right - 2, R.Bottom);
|
||||||
TPSLineTo(RenderCanvas, Angle, RenderIn, R.Right - 1, R.Top - 1);
|
TPSLineTo(RenderCanvas, Angle, RenderIn, R.Right - 2, R.Top - 1);
|
||||||
|
|
||||||
finally
|
finally
|
||||||
RenderCanvas.Font.Assign(SavedFont);
|
RenderCanvas.Font.Assign(SavedFont);
|
||||||
@ -629,6 +619,7 @@ var
|
|||||||
DateStrLen, ResStrLen: integer;
|
DateStrLen, ResStrLen: integer;
|
||||||
DateStrHt: Integer;
|
DateStrHt: Integer;
|
||||||
TextRect: TRect;
|
TextRect: TRect;
|
||||||
|
wText: Integer;
|
||||||
X, Y: Integer;
|
X, Y: Integer;
|
||||||
tmpRect: TRect;
|
tmpRect: TRect;
|
||||||
begin
|
begin
|
||||||
@ -652,10 +643,9 @@ begin
|
|||||||
RenderCanvas.Pen.Style := psSolid;
|
RenderCanvas.Pen.Style := psSolid;
|
||||||
|
|
||||||
{ Size text rect }
|
{ Size text rect }
|
||||||
TextRect.TopLeft := R.TopLeft;
|
TextRect := R;
|
||||||
TextRect.BottomRight := R.BottomRight;
|
OffsetRect(TextRect, 0, -3);
|
||||||
TextRect.Right := TextRect.Right - 3;
|
wText := WidthOf(TextRect);
|
||||||
TextRect.Left := TextRect.Left + 2;
|
|
||||||
|
|
||||||
{ Fix date string for best usage of the available width }
|
{ Fix date string for best usage of the available width }
|
||||||
DateStr := GetDateDisplayString(RenderCanvas, ARenderDate,
|
DateStr := GetDateDisplayString(RenderCanvas, ARenderDate,
|
||||||
@ -669,49 +659,47 @@ begin
|
|||||||
{ fix Res String }
|
{ fix Res String }
|
||||||
ResStr := FDayView.DataStore.Resource.Description;
|
ResStr := FDayView.DataStore.Resource.Description;
|
||||||
ResStrLen := RenderCanvas.TextWidth(ResStr);
|
ResStrLen := RenderCanvas.TextWidth(ResStr);
|
||||||
if ResStrLen > TextRect.Right - TextRect.Left then begin
|
if ResStrLen > WidthOf(TextRect) then
|
||||||
ResStr := GetDisplayString(RenderCanvas, ResStr, 0, TextRect.Right - TextRect.Left);
|
begin
|
||||||
|
ResStr := GetDisplayString(RenderCanvas, ResStr, 0, wText);
|
||||||
ResStrLen := RenderCanvas.TextWidth(ResStr);
|
ResStrLen := RenderCanvas.TextWidth(ResStr);
|
||||||
end;
|
end;
|
||||||
{ center and write the resource name in the first column }
|
{ center and write the resource name in the first column }
|
||||||
if (Col = 0) then begin
|
if (Col = 0) then begin
|
||||||
X := TextRect.Left + (TextRect.Right - TextRect.Left) div 2 - ResStrLen div 2;
|
X := TextRect.Left + wText div 2 - ResStrLen div 2;
|
||||||
Y := TextRect.Top + FDayView.TextMargin;
|
Y := TextRect.Top + FDayView.TextMargin;
|
||||||
TPSTextOut(RenderCanvas, Angle, RenderIn, X, Y, FDayView.DataStore.Resource.Description);
|
TPSTextOut(RenderCanvas, Angle, RenderIn, X, Y, FDayView.DataStore.Resource.Description);
|
||||||
end;
|
end;
|
||||||
{ center the date string }
|
{ center the date string }
|
||||||
X := TextRect.Left + (TextRect.Right - TextRect.Left) div 2 - DateStrLen div 2;
|
X := TextRect.Left + wText div 2 - DateStrLen div 2;
|
||||||
Y := TextRect.Top + (FDayView.TextMargin * 2) + DateStrHt;
|
Y := TextRect.Top + (FDayView.TextMargin * 2) + DateStrHt;
|
||||||
end else begin
|
end else begin
|
||||||
{ center the date string }
|
{ center the date string }
|
||||||
Y := TextRect.Top + FDayView.TextMargin;
|
Y := TextRect.Top + FDayView.TextMargin;
|
||||||
X := TextRect.Left + (TextRect.Right - TextRect.Left) div 2 - DateStrLen div 2;
|
X := TextRect.Left + wText div 2 - DateStrLen div 2;
|
||||||
end;
|
end;
|
||||||
{ Write the date string }
|
{ Write the date string }
|
||||||
TPSTextOut(RenderCanvas, Angle, RenderIn, X, Y, DateStr);
|
TPSTextOut(RenderCanvas, Angle, RenderIn, X, Y, DateStr);
|
||||||
|
|
||||||
{Draw Column Head Borders }
|
{Draw Column Head Borders }
|
||||||
|
if (Col = FDayView.NumDays - 1) then
|
||||||
|
dec(R.Right);
|
||||||
if FDayView.DrawingStyle = dsFlat then begin
|
if FDayView.DrawingStyle = dsFlat then begin
|
||||||
// bottom
|
// bottom
|
||||||
RenderCanvas.Pen.Color := BevelShadow;
|
RenderCanvas.Pen.Color := BevelShadow;
|
||||||
TPSMoveTo(RenderCanvas, Angle, RenderIn, R.Right, R.Bottom - 1);
|
TPSMoveTo(RenderCanvas, Angle, RenderIn, R.Right, R.Bottom - 1);
|
||||||
TPSLineTo(RenderCanvas, Angle, RenderIn, R.Left - 2, R.Bottom - 1);
|
TPSLineTo(RenderCanvas, Angle, RenderIn, R.Left - 2, R.Bottom - 1);
|
||||||
// right side
|
// right side
|
||||||
TPSMoveTo(RenderCanvas, Angle, RenderIn, R.Right, R.Bottom - 1);
|
if Col < FDayView.NumDays - 1 then
|
||||||
RenderCanvas.Pen.Color := RealHeadAttrColor;
|
InflateRect(R, 0, -6);
|
||||||
TPSLineTo(RenderCanvas, Angle, RenderIn, R.Right, R.Bottom - 4);
|
TPSMoveTo(RenderCanvas, Angle, RenderIn, R.Right, R.Bottom - 1); //-5
|
||||||
RenderCanvas.Pen.Color := BevelShadow;
|
TPSLineTo(RenderCanvas, Angle, RenderIn, R.Right, R.Top - 2); //+6
|
||||||
TPSLineTo(RenderCanvas, Angle, RenderIn, R.Right, R.Top + 2);
|
|
||||||
RenderCanvas.Pen.Color := RealHeadAttrColor;
|
|
||||||
TPSLineTo(RenderCanvas, Angle, RenderIn, R.Right, R.Top);
|
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if FDayView.DrawingStyle = ds3d then begin
|
if FDayView.DrawingStyle = ds3d then begin
|
||||||
dec(R.Bottom);
|
OffsetRect(R, 0, -1);
|
||||||
if Col = FDayView.NumDays - 1 then
|
|
||||||
dec(R.Right, 4);
|
|
||||||
R := TPSRotateRectangle(Angle, RenderIn, R);
|
R := TPSRotateRectangle(Angle, RenderIn, R);
|
||||||
DrawBevelRect(RenderCanvas, R, BevelHighlight, BevelDarkShadow);
|
DrawBevelRect(RenderCanvas, R, BevelHighlight, BevelShadow);
|
||||||
end;
|
end;
|
||||||
RenderCanvas.Font.Assign(SaveFont);
|
RenderCanvas.Font.Assign(SaveFont);
|
||||||
finally
|
finally
|
||||||
@ -812,6 +800,7 @@ begin
|
|||||||
else
|
else
|
||||||
RenderCanvas.Brush.Style := OverlayPatternToBrushStyle(AEvent.GetResource.Group.Pattern);
|
RenderCanvas.Brush.Style := OverlayPatternToBrushStyle(AEvent.GetResource.Group.Pattern);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
TPSFillRect(RenderCanvas, Angle, RenderIn, EventRect);
|
TPSFillRect(RenderCanvas, Angle, RenderIn, EventRect);
|
||||||
RenderCanvas.Brush.Style := bsSolid;
|
RenderCanvas.Brush.Style := bsSolid;
|
||||||
|
|
||||||
@ -879,7 +868,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
OldPen.Assign(RenderCanvas.Pen); // wp: Original code had "Canvas" here which does not look correct
|
OldPen.Assign(RenderCanvas.Pen);
|
||||||
OldBrush.Assign(RenderCanvas.Brush);
|
OldBrush.Assign(RenderCanvas.Brush);
|
||||||
OldFont.Assign(RenderCanvas.Font);
|
OldFont.Assign(RenderCanvas.Font);
|
||||||
|
|
||||||
@ -1161,15 +1150,8 @@ procedure TVpDayViewPainter.DrawNavBtns;
|
|||||||
var
|
var
|
||||||
w: Integer;
|
w: Integer;
|
||||||
begin
|
begin
|
||||||
{ size and place the Today button first. }
|
|
||||||
with TVpDayViewOpener(FDayView) do begin
|
with TVpDayViewOpener(FDayView) do begin
|
||||||
dvDayUpBtn.Visible := ShowNavButtons;
|
// In order to hide the nav btns in designmode move them out of their parent.
|
||||||
dvDayDownBtn.Visible := ShowNavButtons;
|
|
||||||
dvTodayBtn.Visible := ShowNavButtons;
|
|
||||||
dvWeekUpBtn.Visible := ShowNavButtons;
|
|
||||||
dvWeekDownBtn.Visible := ShowNavButtons;
|
|
||||||
|
|
||||||
{ In order to hide the nav btns in designmode move them out of their parent }
|
|
||||||
if (csDesigning in ComponentState) and not ShowNavButtons then begin
|
if (csDesigning in ComponentState) and not ShowNavButtons then begin
|
||||||
dvTodayBtn.Left := -Width;
|
dvTodayBtn.Left := -Width;
|
||||||
dvWeekDownBtn.Left := -Width;
|
dvWeekDownBtn.Left := -Width;
|
||||||
@ -1179,41 +1161,36 @@ begin
|
|||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ Calculate width of buttons }
|
// Calculate button widths trying to distribute remainder of division evenly
|
||||||
|
w := RealRowHeadWidth - 3; // total width
|
||||||
dvTodayBtn.Height := trunc(RealColHeadHeight div 2);
|
dvTodayBtn.Height := trunc(RealColHeadHeight div 2);
|
||||||
dvTodayBtn.Width := RealRowHeadWidth;
|
dvTodayBtn.Width := w;
|
||||||
dvWeekDownBtn.Width := RealRowHeadWidth div 4 + 2;
|
dvDayDownBtn.Width := w div 4;
|
||||||
dvWeekUpBtn.Width := dvWeekDownBtn.Width;
|
|
||||||
dvDaydownBtn.Width := dvWeekdownBtn.Width - 4;
|
|
||||||
dvDayUpBtn.Width := dvDayDownBtn.Width;
|
dvDayUpBtn.Width := dvDayDownBtn.Width;
|
||||||
|
dvWeekDownBtn.Width := (w - 2 * dvDayDownBtn.Width) div 2;
|
||||||
|
dvWeekUpBtn.Width := w - (2 * dvDayDownBtn.Width + dvWeekDownBtn.Width);
|
||||||
|
|
||||||
w := dvWeekDownBtn.Width + dvWeekUpBtn.Width + dvDaydownBtn.Width + dvDayUpBtn.Width;
|
// Size and place the Today button first.
|
||||||
if DrawingStyle = ds3d then begin
|
dvTodayBtn.Left := 3;
|
||||||
dvTodayBtn.Left := 2 + (RealRowHeadWidth - w) div 2;
|
dvTodayBtn.Top := 2;
|
||||||
dvTodayBtn.Top := 2;
|
|
||||||
end else
|
|
||||||
begin
|
|
||||||
dvTodayBtn.Left := 1 + (RealRowHeadWidth - w) div 2;
|
|
||||||
dvTodayBtn.Top := 1;
|
|
||||||
end;
|
|
||||||
|
|
||||||
{ size and place the WeekDown button }
|
// Size and place the WeekDown button
|
||||||
dvWeekDownBtn.Height := dvTodayBtn.Height;
|
dvWeekDownBtn.Height := RealColHeadHeight - dvTodayBtn.Height - 3;
|
||||||
dvWeekDownBtn.Left := dvTodayBtn.Left;
|
dvWeekDownBtn.Left := dvTodayBtn.Left;
|
||||||
dvWeekDownBtn.Top := dvTodayBtn.Top + dvTodayBtn.Height;
|
dvWeekDownBtn.Top := dvTodayBtn.Top + dvTodayBtn.Height;
|
||||||
|
|
||||||
{ size and place the DayDown button }
|
// Size and place the DayDown button
|
||||||
dvDayDownBtn.Height := dvTodayBtn.Height;
|
dvDayDownBtn.Height := dvWeekDownBtn.Height;
|
||||||
dvDayDownBtn.Left := dvWeekDownBtn.Left + dvWeekDownBtn.Width;
|
dvDayDownBtn.Left := dvWeekDownBtn.Left + dvWeekDownBtn.Width;
|
||||||
dvDayDownBtn.Top := dvWeekDownBtn.Top;
|
dvDayDownBtn.Top := dvWeekDownBtn.Top;
|
||||||
|
|
||||||
{ size and place the DayUp button }
|
// Size and place the DayUp button
|
||||||
dvDayUpBtn.Height := dvTodayBtn.Height;
|
dvDayUpBtn.Height := dvWeekDownBtn.Height;
|
||||||
dvDayUpBtn.Left := dvDayDownBtn.Left + dvDayDownBtn.Width;
|
dvDayUpBtn.Left := dvDayDownBtn.Left + dvDayDownBtn.Width;
|
||||||
dvDayUpBtn.Top := dvWeekDownBtn.Top;
|
dvDayUpBtn.Top := dvWeekDownBtn.Top;
|
||||||
|
|
||||||
{ size and place the WeekUp button }
|
// Size and place the WeekUp button
|
||||||
dvWeekUpBtn.Height := dvTodayBtn.Height;
|
dvWeekUpBtn.Height := dvWeekDownBtn.Height;
|
||||||
dvWeekUpBtn.Left := dvDayUpBtn.Left + dvDayUpBtn.Width;
|
dvWeekUpBtn.Left := dvDayUpBtn.Left + dvDayUpBtn.Width;
|
||||||
dvWeekUpBtn.Top := dvWeekDownBtn.Top;
|
dvWeekUpBtn.Top := dvWeekDownBtn.Top;
|
||||||
end;
|
end;
|
||||||
@ -1240,7 +1217,7 @@ begin
|
|||||||
|
|
||||||
// Draw the border
|
// Draw the border
|
||||||
if FDayView.DrawingStyle = ds3d then begin
|
if FDayView.DrawingStyle = ds3d then begin
|
||||||
R := Rect(R.Left + 1, R.Top + 2, R.Right - 2, R.Bottom - 1);
|
R := Rect(R.Left, R.Top + 1, R.Right - 2, R.Bottom - 1);
|
||||||
DrawBevelRect(
|
DrawBevelRect(
|
||||||
RenderCanvas,
|
RenderCanvas,
|
||||||
TPSRotateRectangle(Angle, RenderIn, R),
|
TPSRotateRectangle(Angle, RenderIn, R),
|
||||||
@ -1254,11 +1231,6 @@ begin
|
|||||||
TPSLineTo(RenderCanvas, Angle, RenderIn, R.Left + 3, R.Bottom - 1);
|
TPSLineTo(RenderCanvas, Angle, RenderIn, R.Left + 3, R.Bottom - 1);
|
||||||
TPSMoveTo(RenderCanvas, Angle, RenderIn, R.Right - 2, R.Top + 6);
|
TPSMoveTo(RenderCanvas, Angle, RenderIn, R.Right - 2, R.Top + 6);
|
||||||
TPSLineTo(RenderCanvas, Angle, RenderIn, R.Right - 2, R.Bottom - 5);
|
TPSLineTo(RenderCanvas, Angle, RenderIn, R.Right - 2, R.Bottom - 5);
|
||||||
{
|
|
||||||
RenderCanvas.Pen.Color := BevelHighlight;
|
|
||||||
TPSLineTo(RenderCanvas, Angle, RenderIn, R.Left, R.Top);
|
|
||||||
TPSLineTo(RenderCanvas, Angle, RenderIn, R.Right - 2, R.Top);
|
|
||||||
}
|
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -2012,11 +1984,13 @@ begin
|
|||||||
|
|
||||||
{ Slide the rect over to correspond with the level }
|
{ Slide the rect over to correspond with the level }
|
||||||
if ALevel > 0 then
|
if ALevel > 0 then
|
||||||
AEventRect.Left := AEventRect.Left + eventWidth * ALevel
|
AEventRect.Left := AEventRect.Left + eventWidth * ALevel - 1
|
||||||
{ added because level 0 events were one pixel too far to the right }
|
{ added because level 0 events were one pixel too far to the right }
|
||||||
else
|
else
|
||||||
AEventRect.Left := AEventRect.Left - 1;
|
AEventRect.Left := AEventRect.Left - 1;
|
||||||
AEventRect.Right := AEventRect.Left + eventWidth;; // + 1; -- wp: removed to avoid painting over the right border line
|
AEventRect.Right := AEventRect.Left + eventWidth;
|
||||||
|
if (ALevel = 0) and (AWidthDivisor <= 1) then
|
||||||
|
dec(AEventRect.Right);
|
||||||
|
|
||||||
dec(AEventRect.Top); // wp: without this, the top border line of the event is thicker than the others
|
dec(AEventRect.Top); // wp: without this, the top border line of the event is thicker than the others
|
||||||
end;
|
end;
|
||||||
|
@ -476,10 +476,13 @@ begin
|
|||||||
BevelShadow
|
BevelShadow
|
||||||
);
|
);
|
||||||
end else
|
end else
|
||||||
|
begin
|
||||||
RenderCanvas.Line(R.Left, R.Bottom, R.Right, R.Bottom);
|
RenderCanvas.Line(R.Left, R.Bottom, R.Right, R.Bottom);
|
||||||
|
end;
|
||||||
|
|
||||||
// Paint event description as header
|
// Paint event description as header
|
||||||
P := Point(R.Left + FGanttView.TextMargin, (R.Top + R.Bottom - strH) div 2);
|
inc(R.Left, FGanttView.TextMargin + 2);
|
||||||
|
P := Point(R.Left, (R.Top + R.Bottom - strH) div 2);
|
||||||
TPSTextOut(RenderCanvas, Angle, RenderIn, P.X, P.Y, Str);
|
TPSTextOut(RenderCanvas, Angle, RenderIn, P.X, P.Y, Str);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
@ -245,7 +245,6 @@ begin
|
|||||||
while (Length(Str) > 0) and (not (Str[Length(Str)] in ['A'..'Z', 'a'..'z', '0'..'9'])) do
|
while (Length(Str) > 0) and (not (Str[Length(Str)] in ['A'..'Z', 'a'..'z', '0'..'9'])) do
|
||||||
delete(Str, Length(Str), 1);
|
delete(Str, Length(Str), 1);
|
||||||
end;
|
end;
|
||||||
{=====}
|
|
||||||
|
|
||||||
function AssembleName(AContact: TVpContact): string;
|
function AssembleName(AContact: TVpContact): string;
|
||||||
begin
|
begin
|
||||||
@ -304,7 +303,6 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure ParseName(Contact: TVpContact; const Value: string);
|
procedure ParseName(Contact: TVpContact; const Value: string);
|
||||||
var
|
var
|
||||||
name, ln, fn: string;
|
name, ln, fn: string;
|
||||||
@ -333,7 +331,6 @@ begin
|
|||||||
Contact.LastName := ln;
|
Contact.LastName := ln;
|
||||||
Contact.FirstName := fn;
|
Contact.FirstName := fn;
|
||||||
end;
|
end;
|
||||||
{=====}
|
|
||||||
|
|
||||||
procedure ParseCSZ(Str: string; out City, State, Zip: string);
|
procedure ParseCSZ(Str: string; out City, State, Zip: string);
|
||||||
var
|
var
|
||||||
@ -361,7 +358,6 @@ begin
|
|||||||
StripString(State);
|
StripString(State);
|
||||||
StripString(Zip);
|
StripString(Zip);
|
||||||
end;
|
end;
|
||||||
{=====}
|
|
||||||
|
|
||||||
{$IFDEF DELPHI}
|
{$IFDEF DELPHI}
|
||||||
function LoadBaseBitmap(lpBitmapName : PAnsiChar) : HBITMAP;
|
function LoadBaseBitmap(lpBitmapName : PAnsiChar) : HBITMAP;
|
||||||
@ -372,7 +368,6 @@ begin
|
|||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
// Result := LoadBitmap(FindClassHInstance(TVpCustomControl), lpBitmapName);
|
// Result := LoadBitmap(FindClassHInstance(TVpCustomControl), lpBitmapName);
|
||||||
end;
|
end;
|
||||||
{=====}
|
|
||||||
|
|
||||||
function LoadBaseCursor(lpCursorName : PAnsiChar) : HCURSOR;
|
function LoadBaseCursor(lpCursorName : PAnsiChar) : HCURSOR;
|
||||||
begin
|
begin
|
||||||
@ -384,13 +379,11 @@ function WidthOf(const R : TRect) : Integer;
|
|||||||
begin
|
begin
|
||||||
Result := R.Right - R.Left;
|
Result := R.Right - R.Left;
|
||||||
end;
|
end;
|
||||||
{=====}
|
|
||||||
|
|
||||||
function HeightOf(const R : TRect) : Integer;
|
function HeightOf(const R : TRect) : Integer;
|
||||||
begin
|
begin
|
||||||
Result := R.Bottom - R.Top;
|
Result := R.Bottom - R.Top;
|
||||||
end;
|
end;
|
||||||
{=====}
|
|
||||||
|
|
||||||
function GetDisplayString(Canvas : TCanvas; const S : string;
|
function GetDisplayString(Canvas : TCanvas; const S : string;
|
||||||
MinChars, MaxWidth : Integer) : string;
|
MinChars, MaxWidth : Integer) : string;
|
||||||
|
Reference in New Issue
Block a user