L
lifndcw
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure PrintGridTitleTextHeight(FromCol, ToCol: Integer);
var r: TRect;
i, lm, rm, tm: Integer;
begin
r := Rect(DataPrintRec.Left, DataPrintRec.Top - PrnTitlEh - PrnTitleTextH + PrintOffset, DataPrintRec.Left, DataPrintRec.Top - PrnTitlEh + PrintOffset);
for i := FromCol to ToColdo
Inc(r.Right, Integer(PrnColWidths));
if (Title.Text <> '') then
begin
VPrinter_Canvas.Font := DBGridEh.TitleFont;
if (PrintFontName <> '') then
VPrinter_Canvas.Font.Name := PrintFontName;
r := Rect(DataPrintRec.Left, DataPrintRec.Top - PrnTitlEh - PrnTitleTextH + PrintOffset, r.Right, DataPrintRec.Top - PrnTitlEh + PrintOffset);
lm := PSX2;
// if FromCol = 0 then
lm := PSX2 else
lm := 0;
rm := PSX2;
//if ToCol = DBGridEh.VisibleColumns.Count-1 then
rm := PSX2 else
rm := 0;
for i := 0 to FromCol - 1do
Dec(lm, Integer(PrnColWidths));
for i := ToCol + 1 to PrnColumns.Count - 1do
Dec(rm, Integer(PrnColWidths));
if DBGridEh.UseMultiTitle
then
tm := Round(DBGridEh.VTitleMargin * fScaleY / 2) else
tm := PSY2;
if pghColored in Options
then
VPrinter_Canvas.Brush.Color := DBGridEh.FixedColor;
if DBGridEh.UseRightToLeftAlignment then
OffsetRect(r, (DataPrintRec.Right + DataPrintRec.Left) - (r.Left + r.Right), 0);
WriteTextEh(VPrinter_Canvas, r, pghColored in Options, 0, tm, GetStingListText(Title),
taCenter, tlTop, True, False, lm, rm, CalcInfoMode,
DBGridEh.UseRightToLeftAlignment, DBGridEh.UseRightToLeftReading);
AddPolyline([r.Left, r.Bottom, r.Left, r.Top, r.Right, r.Top, r.Right, r.Bottom]);
end;
end;
var r: TRect;
i, lm, rm, tm: Integer;
begin
r := Rect(DataPrintRec.Left, DataPrintRec.Top - PrnTitlEh - PrnTitleTextH + PrintOffset, DataPrintRec.Left, DataPrintRec.Top - PrnTitlEh + PrintOffset);
for i := FromCol to ToColdo
Inc(r.Right, Integer(PrnColWidths));
if (Title.Text <> '') then
begin
VPrinter_Canvas.Font := DBGridEh.TitleFont;
if (PrintFontName <> '') then
VPrinter_Canvas.Font.Name := PrintFontName;
r := Rect(DataPrintRec.Left, DataPrintRec.Top - PrnTitlEh - PrnTitleTextH + PrintOffset, r.Right, DataPrintRec.Top - PrnTitlEh + PrintOffset);
lm := PSX2;
// if FromCol = 0 then
lm := PSX2 else
lm := 0;
rm := PSX2;
//if ToCol = DBGridEh.VisibleColumns.Count-1 then
rm := PSX2 else
rm := 0;
for i := 0 to FromCol - 1do
Dec(lm, Integer(PrnColWidths));
for i := ToCol + 1 to PrnColumns.Count - 1do
Dec(rm, Integer(PrnColWidths));
if DBGridEh.UseMultiTitle
then
tm := Round(DBGridEh.VTitleMargin * fScaleY / 2) else
tm := PSY2;
if pghColored in Options
then
VPrinter_Canvas.Brush.Color := DBGridEh.FixedColor;
if DBGridEh.UseRightToLeftAlignment then
OffsetRect(r, (DataPrintRec.Right + DataPrintRec.Left) - (r.Left + r.Right), 0);
WriteTextEh(VPrinter_Canvas, r, pghColored in Options, 0, tm, GetStingListText(Title),
taCenter, tlTop, True, False, lm, rm, CalcInfoMode,
DBGridEh.UseRightToLeftAlignment, DBGridEh.UseRightToLeftReading);
AddPolyline([r.Left, r.Bottom, r.Left, r.Top, r.Right, r.Top, r.Right, r.Bottom]);
end;
end;