1.
procedure Memo8OnBeforePrint(Sender: TfrxComponent);
begin
while ((TfrxMemoView(Sender).CalcHeight-TfrxMemoView(Sender).LineSpacing)-TfrxMemoView(Sender).Height>0) do
begin
TfrxMemoView(Sender).Font.Size := TfrxMemoView(Sender).Font.Size-5;
end;
end;
2.
begin
per:=1.4;
xy:=[adoquery1."xy"];
len:=length(xy);
width:=memo1.width;
fs:= Round(width / len * per) ;
memo1.font.size:=fs;
memo1.memo :=xy;
memo2.memo:= str(width);
end
增加字体调整模式
TfrxScaleFontSize = (sfsWidth, sfsHeight, sfsNone);
增加TfrxMemoView属性
property ScaleFontSize;
增加TfrxCustomMemoView属性
property ScaleFontSize: TfrxScaleFontSize read FScaleFontSize write FScaleFontSize default sfsNone;
procedure TfrxCustomMemoView.BeforePrint;
begin
inherited;
if not IsDataField then
FTempMemo := FMemo.Text;
case FScaleFontSize of
sfsNone: ;
sfsWidth:
if not WordWrap and not AutoWidth then //按宽度调整时--自动换行时不可用 ; 自动宽度时不可用
while (CalcWidth - Width > 0) do
Font.Size := Font.Size - 1;
sfsHeight:
if (StretchMode = smDontStretch) then //伸展时不能按高度调整
while ((CalcHeight - LineSpacing) - Height > 0) do
Font.Size := Font.Size - 1;
end;
end;
procedure Memo8OnBeforePrint(Sender: TfrxComponent);
begin
while ((TfrxMemoView(Sender).CalcHeight-TfrxMemoView(Sender).LineSpacing)-TfrxMemoView(Sender).Height>0) do
begin
TfrxMemoView(Sender).Font.Size := TfrxMemoView(Sender).Font.Size-5;
end;
end;
2.
begin
per:=1.4;
xy:=[adoquery1."xy"];
len:=length(xy);
width:=memo1.width;
fs:= Round(width / len * per) ;
memo1.font.size:=fs;
memo1.memo :=xy;
memo2.memo:= str(width);
end
增加字体调整模式
TfrxScaleFontSize = (sfsWidth, sfsHeight, sfsNone);
增加TfrxMemoView属性
property ScaleFontSize;
增加TfrxCustomMemoView属性
property ScaleFontSize: TfrxScaleFontSize read FScaleFontSize write FScaleFontSize default sfsNone;
procedure TfrxCustomMemoView.BeforePrint;
begin
inherited;
if not IsDataField then
FTempMemo := FMemo.Text;
case FScaleFontSize of
sfsNone: ;
sfsWidth:
if not WordWrap and not AutoWidth then //按宽度调整时--自动换行时不可用 ; 自动宽度时不可用
while (CalcWidth - Width > 0) do
Font.Size := Font.Size - 1;
sfsHeight:
if (StretchMode = smDontStretch) then //伸展时不能按高度调整
while ((CalcHeight - LineSpacing) - Height > 0) do
Font.Size := Font.Size - 1;
end;
end;