procedure MemoCreate var AMemo TfrxMemoView const AOwner TComponent co

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
procedure MemoCreate(var AMemo: TfrxMemoView; const AOwner: TComponent;
const ALeft, ATop, AWidth, AHeight: Currency; const AValue: Variant;
const AHAlign: TfrxHAlign = haCenter; const AVAlign: TfrxVAlign = vaCenter;
const AFrameTyp: TfrxFrameTypes = [ftLeft, ftRight, ftTop, ftBottom];
const AFontStyle: TFontStyles = []; const AFontSize: Integer = 10;
const AFontName: TFontName = 'Times New Roman');
const
K = 96 / 2.54;
begin
AMemo := TfrxMemoView.Create(AOwner);
AMemo.SetBounds(ALeft * K, ATop * K, AWidth * K, AHeight * K);
{хочу в зависимости от типа варианты разное форматирование сделать}
// ---------------------------------------------------------------------------
if (AValue is string) then
begin
AMemo.DisplayFormat.Kind := fkText;
AMemo.DisplayFormat.FormatStr := '';
end
else
begin
AMemo.DisplayFormat.Kind := fkNumeric;
AMemo.DisplayFormat.FormatStr := '%2.2n';
end;
AMemo.Text := AMemo.FormatData(AValue);
// ---------------------------------------------------------------------------
AMemo.HAlign := AHAlign;
AMemo.VAlign := AVAlign;
AMemo.Frame.Typ := AFrameTyp;
AMemo.Font.Style := AFontStyle;
AMemo.Font.Size := AFontSize;
AMemo.Font.Name := AFontName;
end;