tvplanit: trying to resolve the issue of growing day names in the calendar view in OSX (see forum http://forum.lazarus.freepascal.org/index.php/topic,33189.msg214639.html#msg214639).

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4881 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2016-07-01 17:53:23 +00:00
parent d7477c8171
commit cb586c9d08
3 changed files with 10 additions and 9 deletions

View File

@ -5,6 +5,7 @@
<Type Value="RunAndDesignTime"/>
<AddToProjectUsesSection Value="True"/>
<Author Value="Original author: TurboPower Software"/>
<AutoUpdate Value="OnRebuildingAll"/>
<CompilerOptions>
<Version Value="11"/>
<SearchPaths>

View File

@ -208,7 +208,11 @@ var
I: Integer;
S: string;
DrawRect: TRect;
fontsize: Integer;
begin
{Store the font size}
fontsize := RenderCanvas.Font.Size;
{draw the day name column labels}
RenderCanvas.Font.Color := DayNameColor;
I := 0;
@ -236,16 +240,13 @@ begin
S := SysToUTF8(S);
{$ENDIF}
{restore the font size - this is not needed normally, but may solve the
issue with growing fonts along this row in MacOSX }
RenderCanvas.Font.Size := fontsize;
{draw the day name above each column}
DrawRect := TVpCalendarOpener(FCalendar).clRowCol[1, I];
OffsetRect(DrawRect, RealLeft, Realtop);
{
DrawRect := Rect(
clRowCol[1, I].Left + RealLeft,
clRowCol[1, I].Top + RealTop,
clRowCol[1, I].Right + RealLeft,
clRowCol[1, I].Bottom + RealTop);
}
TPSCenteredTextOut(RenderCanvas, Angle, RenderIn, DrawRect, S);
Inc(I);
if DOW < High(DOW) then

View File

@ -752,8 +752,7 @@ begin
case FCanvas.Font.Pitch of
fpVariable : LF.lfPitchAndFamily := VARIABLE_PITCH or FF_DONTCARE;
fpFixed : LF.lfPitchAndFamily := FIXED_PITCH or FF_DONTCARE;
else
LF.lfPitchAndFamily := DEFAULT_PITCH;
else LF.lfPitchAndFamily := DEFAULT_PITCH;
end;
// Create new font to use