You've already forked lazarus-ccr
jvcllaz: Fix too-small default font size when printing TvTimeFramework controls.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7106 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -4874,6 +4874,24 @@ var
|
|||||||
I, J, lRightCol, lBottomRow: Integer;
|
I, J, lRightCol, lBottomRow: Integer;
|
||||||
w, h: Integer;
|
w, h: Integer;
|
||||||
begin
|
begin
|
||||||
|
// For printing, fix Lazarus default fonts having size 0
|
||||||
|
if not (csDesigning in ComponentState) then begin
|
||||||
|
FixFont(ApptAttr.Font);
|
||||||
|
FixFont(FancyRowHdrAttr.MajorFont);
|
||||||
|
FixFont(FancyRowHdrAttr.MinorFont);
|
||||||
|
FixFont(Font);
|
||||||
|
FixFont(GroupHdrAttr.Font);
|
||||||
|
FixFont(HdrAttr.Font);
|
||||||
|
FixFont(SelApptAttr.Font);
|
||||||
|
FixFont(SelFancyRowHdrAttr.MajorFont);
|
||||||
|
FixFont(SelFancyRowHdrAttr.MinorFont);
|
||||||
|
FixFont(SelGroupHdrAttr.Font);
|
||||||
|
FixFont(SelHdrAttr.Font);
|
||||||
|
FixFont(TimeBlockProps.BlockHdrAttr.Font);
|
||||||
|
FixFont(TimeBlockProps.SelBlockHdrAttr.Font);
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
{ optimization incorrectly kicks in if control is only partially
|
{ optimization incorrectly kicks in if control is only partially
|
||||||
visible on the screen
|
visible on the screen
|
||||||
if not PaintBuffer.Empty and
|
if not PaintBuffer.Empty and
|
||||||
@ -5613,7 +5631,6 @@ begin
|
|||||||
try
|
try
|
||||||
GetApptDrawInfo(DrawInfo, Appt, Attr);
|
GetApptDrawInfo(DrawInfo, Appt, Attr);
|
||||||
Font.Assign(DrawInfo.Font);
|
Font.Assign(DrawInfo.Font);
|
||||||
FixFont(Font);
|
|
||||||
Brush.Color := DrawInfo.Color;
|
Brush.Color := DrawInfo.Color;
|
||||||
Pen.Color := DrawInfo.FrameColor;
|
Pen.Color := DrawInfo.FrameColor;
|
||||||
Pen.Width := DrawInfo.FrameWidth;
|
Pen.Width := DrawInfo.FrameWidth;
|
||||||
@ -6168,7 +6185,6 @@ begin
|
|||||||
|
|
||||||
ACanvas.Brush.Color := UseAttr.Color;
|
ACanvas.Brush.Color := UseAttr.Color;
|
||||||
ACanvas.Font.Assign(UseAttr.Font);
|
ACanvas.Font.Assign(UseAttr.Font);
|
||||||
FixFont(ACanvas.Font);
|
|
||||||
|
|
||||||
DrawTxt(ACanvas, Rect, Txt, taCenter, vaCenter);
|
DrawTxt(ACanvas, Rect, Txt, taCenter, vaCenter);
|
||||||
|
|
||||||
@ -6322,7 +6338,6 @@ begin
|
|||||||
ACanvas.Brush.Color := HdrAttr.Color;
|
ACanvas.Brush.Color := HdrAttr.Color;
|
||||||
ACanvas.Font.Assign(HdrAttr.Font);
|
ACanvas.Font.Assign(HdrAttr.Font);
|
||||||
end;
|
end;
|
||||||
FixFont(ACanvas.Font);
|
|
||||||
|
|
||||||
// All parameters now specified. Now calc text height.
|
// All parameters now specified. Now calc text height.
|
||||||
Flags := DT_NOPREFIX or DT_WORDBREAK or DT_CENTER or DT_CALCRECT;
|
Flags := DT_NOPREFIX or DT_WORDBREAK or DT_CENTER or DT_CALCRECT;
|
||||||
@ -6621,7 +6636,6 @@ begin
|
|||||||
ACanvas.Font.Assign(SelFancyRowHdrAttr.MajorFont)
|
ACanvas.Font.Assign(SelFancyRowHdrAttr.MajorFont)
|
||||||
else
|
else
|
||||||
ACanvas.Font.Assign(FancyRowHdrAttr.MajorFont);
|
ACanvas.Font.Assign(FancyRowHdrAttr.MajorFont);
|
||||||
FixFont(ACanvas.Font);
|
|
||||||
|
|
||||||
ACanvas.Brush.Style := bsClear;
|
ACanvas.Brush.Style := bsClear;
|
||||||
|
|
||||||
@ -6682,7 +6696,6 @@ begin
|
|||||||
// now draw the LabelStr right aligned
|
// now draw the LabelStr right aligned
|
||||||
ACanvas.Brush.Style := bsClear;
|
ACanvas.Brush.Style := bsClear;
|
||||||
ACanvas.Font.Assign(Attr.MinorFont);
|
ACanvas.Font.Assign(Attr.MinorFont);
|
||||||
FixFont(ACanvas.Font);
|
|
||||||
|
|
||||||
// draw the focus rect if needed
|
// draw the focus rect if needed
|
||||||
if (RowNum = FocusedRow) and Focused and ShowFocus then
|
if (RowNum = FocusedRow) and Focused and ShowFocus then
|
||||||
@ -6777,10 +6790,8 @@ begin
|
|||||||
try
|
try
|
||||||
TempFont.Assign(Canvas.Font);
|
TempFont.Assign(Canvas.Font);
|
||||||
Canvas.Font.Assign(FancyRowHdrAttr.MinorFont);
|
Canvas.Font.Assign(FancyRowHdrAttr.MinorFont);
|
||||||
FixFont(Canvas.Font);
|
|
||||||
Result := Canvas.TextWidth('22:22a') - 10;
|
Result := Canvas.TextWidth('22:22a') - 10;
|
||||||
Canvas.Font.Assign(TempFont);
|
Canvas.Font.Assign(TempFont);
|
||||||
FixFont(Canvas.Font);
|
|
||||||
finally
|
finally
|
||||||
TempFont.Free;
|
TempFont.Free;
|
||||||
end;
|
end;
|
||||||
@ -9351,7 +9362,6 @@ begin
|
|||||||
GetApptDrawInfo(DrawInfo, Appt, SelApptAttr);
|
GetApptDrawInfo(DrawInfo, Appt, SelApptAttr);
|
||||||
FrameOffset := DrawInfo.FrameWidth div 2 * 2;
|
FrameOffset := DrawInfo.FrameWidth div 2 * 2;
|
||||||
Canvas.Font := DrawInfo.Font;
|
Canvas.Font := DrawInfo.Font;
|
||||||
FixFont(Canvas.Font);
|
|
||||||
FEditor.Font := DrawInfo.Font;
|
FEditor.Font := DrawInfo.Font;
|
||||||
FEditor.Color := DrawInfo.Color;
|
FEditor.Color := DrawInfo.Color;
|
||||||
finally
|
finally
|
||||||
@ -10770,7 +10780,6 @@ begin
|
|||||||
|
|
||||||
ACanvas.Brush.Color := UseAttr.Color;
|
ACanvas.Brush.Color := UseAttr.Color;
|
||||||
ACanvas.Font.Assign(UseAttr.Font);
|
ACanvas.Font.Assign(UseAttr.Font);
|
||||||
FixFont(ACanvas.Font);
|
|
||||||
|
|
||||||
Flags := DT_NOPREFIX or DT_CENTER;
|
Flags := DT_NOPREFIX or DT_CENTER;
|
||||||
case ColTitleStyle of
|
case ColTitleStyle of
|
||||||
@ -13038,7 +13047,6 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
ACanvas.Font.Assign(FancyRowHdrAttr.MajorFont);
|
ACanvas.Font.Assign(FancyRowHdrAttr.MajorFont);
|
||||||
FixFont(ACanvas.Font);
|
|
||||||
ACanvas.Brush.Style := bsClear;
|
ACanvas.Brush.Style := bsClear;
|
||||||
|
|
||||||
DrawText(ACanvas.Handle, PChar(Lbl), -1, ARect,
|
DrawText(ACanvas.Handle, PChar(Lbl), -1, ARect,
|
||||||
@ -13149,7 +13157,6 @@ begin
|
|||||||
|
|
||||||
// now draw the LabelStr right aligned
|
// now draw the LabelStr right aligned
|
||||||
ACanvas.Font.Assign(FancyRowHdrAttr.MinorFont);
|
ACanvas.Font.Assign(FancyRowHdrAttr.MinorFont);
|
||||||
FixFont(ACanvas.Font);
|
|
||||||
ACanvas.Brush.Style := bsClear;
|
ACanvas.Brush.Style := bsClear;
|
||||||
|
|
||||||
DrawText(ACanvas.Handle, PChar(LabelStr), -1, TxtRect,
|
DrawText(ACanvas.Handle, PChar(LabelStr), -1, TxtRect,
|
||||||
@ -13179,7 +13186,6 @@ begin
|
|||||||
|
|
||||||
ACanvas.Brush.Color := HdrAttr.Color;
|
ACanvas.Brush.Color := HdrAttr.Color;
|
||||||
ACanvas.Font.Assign(HdrAttr.Font);
|
ACanvas.Font.Assign(HdrAttr.Font);
|
||||||
FixFont(ACanvas.Font);
|
|
||||||
|
|
||||||
DrawTxt(ACanvas, ARect, Txt, taCenter, vaCenter);
|
DrawTxt(ACanvas, ARect, Txt, taCenter, vaCenter);
|
||||||
|
|
||||||
@ -13420,10 +13426,8 @@ begin
|
|||||||
try
|
try
|
||||||
TempFont.Assign(ACanvas.Font);
|
TempFont.Assign(ACanvas.Font);
|
||||||
ACanvas.Font.Assign(FancyRowHdrAttr.MinorFont);
|
ACanvas.Font.Assign(FancyRowHdrAttr.MinorFont);
|
||||||
FixFont(ACanvas.Font);
|
|
||||||
Result := ACanvas.TextWidth('22:22a');
|
Result := ACanvas.TextWidth('22:22a');
|
||||||
ACanvas.Font.Assign(TempFont);
|
ACanvas.Font.Assign(TempFont);
|
||||||
FixFont(ACanvas.Font);
|
|
||||||
finally
|
finally
|
||||||
TempFont.Free;
|
TempFont.Free;
|
||||||
end;
|
end;
|
||||||
@ -13924,7 +13928,6 @@ begin
|
|||||||
|
|
||||||
ACanvas.Brush.Color := UseAttr.Color;
|
ACanvas.Brush.Color := UseAttr.Color;
|
||||||
ACanvas.Font.Assign(UseAttr.Font);
|
ACanvas.Font.Assign(UseAttr.Font);
|
||||||
FixFont(ACanvas.Font);
|
|
||||||
|
|
||||||
Flags := DT_NOPREFIX or DT_CENTER;
|
Flags := DT_NOPREFIX or DT_CENTER;
|
||||||
case ColTitleStyle of
|
case ColTitleStyle of
|
||||||
|
Reference in New Issue
Block a user