You've already forked lazarus-ccr
tvplanit: Fix TVpWeekView drawing glitches. Add Alignment property for weekview's day names.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8442 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -230,12 +230,12 @@ begin
|
||||
|
||||
{ Calculate size of rect for the day number at the top of the TextRect. }
|
||||
if ACol = 6 then
|
||||
tmpRect.Left := ATextRect.Left + mvColWidth - TextAdjust - FMonthView.TextMargin
|
||||
tmpRect.Left := ATextRect.Left + mvColWidth - TextAdjust - FMonthView.DaysMargin
|
||||
else
|
||||
tmpRect.Left := ATextRect.Right - TextAdjust - FMonthView.TextMargin + 2;
|
||||
tmpRect.Left := ATextRect.Right - TextAdjust - FMonthView.DaysMargin + 2;
|
||||
if fsItalic in RenderCanvas.Font.Style then
|
||||
dec(tmpRect.Left, 2);
|
||||
tmpRect.Top := ATextRect.Top + FMonthView.TextMargin div 2;
|
||||
tmpRect.Top := ATextRect.Top + FMonthView.DaysMargin div 2;
|
||||
tmpRect.Right := tmpRect.Left + textAdjust;
|
||||
tmpRect.Bottom := tmpRect.Top + textHeight;
|
||||
|
||||
@ -383,8 +383,8 @@ begin
|
||||
|
||||
{ Fix header string }
|
||||
strLen := RenderCanvas.TextWidth(str);
|
||||
if (strLen > mvColWidth - FMonthView.TextMargin * 2) then
|
||||
str := GetDisplayString(RenderCanvas, str, 0, mvColWidth - FMonthView.TextMargin * 2);
|
||||
if (strLen > mvColWidth - FMonthView.DaysMargin * 2) then
|
||||
str := GetDisplayString(RenderCanvas, str, 0, mvColWidth - FMonthView.DaysMargin * 2);
|
||||
strLen := RenderCanvas.TextWidth(str);
|
||||
|
||||
{ Draw header text }
|
||||
@ -516,7 +516,7 @@ begin
|
||||
RenderCanvas.Pen.Style := psSolid;
|
||||
RenderCanvas.Brush.Color := RealColor;
|
||||
|
||||
txtMargin := FMonthView.TextMargin;
|
||||
txtMargin := FMonthView.DaysMargin;
|
||||
|
||||
{ write the events }
|
||||
if (FMonthView.DataStore <> nil) and FMonthView.ShowEvents and
|
||||
@ -659,16 +659,16 @@ begin
|
||||
InflateRect(headRect, -1, -1);
|
||||
dec(headRect.Right);
|
||||
headRect.Bottom := headRect.Top + FMonthHeadHeight;
|
||||
TPSFillRect(RenderCanvas, Angle, RenderIn, HeadRect);
|
||||
R := TPSRotateRectangle(Angle, RenderIn, HeadRect);
|
||||
TPSFillRect(RenderCanvas, Angle, RenderIn, headRect);
|
||||
R := TPSRotateRectangle(Angle, RenderIn, headRect);
|
||||
DrawBevelRect(RenderCanvas, R, BevelHighlight, BevelShadow);
|
||||
end else
|
||||
TPSFillRect(RenderCanvas, Angle, RenderIn, HeadRect);
|
||||
TPSFillRect(RenderCanvas, Angle, RenderIn, headRect);
|
||||
|
||||
// Position the spinner buttons
|
||||
with TVpMonthViewOpener(FMonthView) do begin
|
||||
FPrevYearBtn.Width := FPrevYearBtn.Height;
|
||||
FPrevYearBtn.Left := TextMargin;
|
||||
FPrevYearBtn.Left := MonthMargin;
|
||||
FPrevYearBtn.Top := (HeadRect.Top + HeadRect.Bottom - FPrevYearBtn.Height) div 2 + 1;
|
||||
|
||||
FPrevMonthBtn.Height := FPrevYearBtn.Height;
|
||||
@ -686,7 +686,7 @@ begin
|
||||
FNextYearBtn.Left := FNextMonthBtn.Left + FNextMonthBtn.Width;
|
||||
FNextYearBtn.Top := FPrevYearBtn.Top;
|
||||
|
||||
txtStart := FNextYearBtn.Left + FNextYearBtn.Width + 2*TextMargin;
|
||||
txtStart := FNextYearBtn.Left + FNextYearBtn.Width + 2*MonthMargin;
|
||||
end;
|
||||
|
||||
{ Acquire startdate and end date }
|
||||
@ -701,12 +701,12 @@ begin
|
||||
RenderCanvas.Font.Size := ScaleY(RenderCanvas.Font.Size, DesignTimeDPI);
|
||||
{$ENDIF}
|
||||
if DisplayOnly and (RenderCanvas.TextWidth(HeadStr) >= RealWidth) then
|
||||
HeadTextRect.Left := RealLeft + FMonthView.TextMargin * 2
|
||||
HeadTextRect.Left := RealLeft + FMonthView.MonthMargin * 2
|
||||
else
|
||||
if DisplayOnly then
|
||||
HeadTextRect.Left := RealLeft + (RealWidth - RenderCanvas.TextWidth(HeadStr)) div 2
|
||||
else
|
||||
HeadTextRect.Left := RealLeft + 30 + FMonthView.TextMargin * 2;
|
||||
HeadTextRect.Left := RealLeft + 30 + FMonthView.MonthMargin * 2;
|
||||
HeadTextRect.Top := (HeadRect.Top + HeadRect.Bottom - RenderCanvas.TextHeight('Tg')) div 2;
|
||||
HeadTextRect.BottomRight := HeadRect.BottomRight;
|
||||
|
||||
@ -718,7 +718,7 @@ begin
|
||||
RenderCanvas,
|
||||
HeadStr,
|
||||
0,
|
||||
HeadTextRect.Right - HeadTextRect.Left - FMonthView.TextMargin
|
||||
HeadTextRect.Right - HeadTextRect.Left - FMonthView.MonthMargin
|
||||
);
|
||||
end;
|
||||
|
||||
@ -844,10 +844,10 @@ begin
|
||||
with TVpMonthViewOpener(FMonthView) do
|
||||
begin
|
||||
h := GetCanvasTextHeight(RenderCanvas, HeadAttributes.Font, txt);
|
||||
mvMonthHeadHeight := Max(h, FPrevYearBtn.Height) + TextMargin;
|
||||
mvMonthHeadHeight := Max(h, FPrevYearBtn.Height) + MonthMargin;
|
||||
|
||||
h := GetCanvasTextHeight(RenderCanvas, DayHeadAttributes.Font, txt);
|
||||
mvDayHeadHeight := Max(h, FPrevYearBtn.Height) + TextMargin;
|
||||
mvDayHeadHeight := Max(h, FPrevYearBtn.Height) + DaysMargin;
|
||||
|
||||
mvHeaderHeight := mvMonthHeadHeight + mvDayHeadHeight;
|
||||
|
||||
|
Reference in New Issue
Block a user