lazreport: less notes

git-svn-id: trunk@36425 -
This commit is contained in:
mattias 2012-03-29 10:06:06 +00:00
parent 70badc5a18
commit 38dd89f95d
3 changed files with 36 additions and 45 deletions

View File

@ -357,7 +357,7 @@ type
function MinHeight: Integer; override; function MinHeight: Integer; override;
function RemainHeight: Integer; override; function RemainHeight: Integer; override;
procedure GetBlob(b: TfrTField); override; procedure GetBlob(b: TfrTField); override;
procedure FontChange(sender: TObject); procedure FontChange({%H-}sender: TObject);
procedure ResetLastValue; override; procedure ResetLastValue; override;
property IsLastValueSet: boolean read GetIsLastValueSet write SetIsLastValueSet; property IsLastValueSet: boolean read GetIsLastValueSet write SetIsLastValueSet;
@ -1100,7 +1100,7 @@ type
destructor Destroy; override; destructor Destroy; override;
function OnFunction(const FName: String; p1, p2, p3: Variant; function OnFunction(const FName: String; p1, p2, p3: Variant;
var val: Variant): Boolean; var val: Variant): Boolean;
procedure DoFunction(FNo: Integer; p1, p2, p3: Variant; var val: Variant); procedure {%H-}DoFunction(FNo: Integer; p1, p2, p3: Variant; var val: Variant);
virtual; abstract; virtual; abstract;
procedure UpdateDescriptions; virtual; procedure UpdateDescriptions; virtual;
procedure Add(const funName:string; IsExtra:boolean=false); procedure Add(const funName:string; IsExtra:boolean=false);
@ -1880,6 +1880,7 @@ begin
Read(dy, 4); Read(dy, 4);
Read(Flags, 2); Read(Flags, 2);
S := 0;
Read(S, SizeOf(S)); fFrameWidth := S; Read(S, SizeOf(S)); fFrameWidth := S;
Read(fFrameColor, SizeOf(fFrameColor)); Read(fFrameColor, SizeOf(fFrameColor));
Read(fFrames,SizeOf(fFrames)); Read(fFrames,SizeOf(fFrames));
@ -1897,11 +1898,13 @@ begin
if (frVersion >= 23) and (StreamMode = smDesigning) then if (frVersion >= 23) and (StreamMode = smDesigning) then
begin begin
ReadMemo(Stream, Script); ReadMemo(Stream, Script);
wb := 0;
Read(wb,2); Read(wb,2);
Visible:=(Wb<>0); Visible:=(Wb<>0);
end; end;
if (frVersion >= 25) then begin if (frVersion >= 25) then begin
I := 0;
Read(I, 4); Read(I, 4);
ParentBandType := TfrBandType(I); ParentBandType := TfrBandType(I);
end; end;
@ -1917,7 +1920,7 @@ var
S:string; S:string;
begin begin
inherited LoadFromXML(XML,Path); inherited LoadFromXML(XML,Path);
StreamMode := TfrStreamMode(XML.GetValue(Path+'StreamMode/Value', 0)); // TODO Check default StreamMode := TfrStreamMode(XML.GetValue(Path+'StreamMode/Value'{%H-}, 0)); // TODO Check default
if StreamMode = smDesigning then if StreamMode = smDesigning then
begin begin
if frVersion >= 23 then if frVersion >= 23 then
@ -1926,11 +1929,11 @@ begin
CreateUniqueName; CreateUniqueName;
end; end;
x := XML.GetValue(Path + 'Size/Left/Value', 0); x := XML.GetValue(Path + 'Size/Left/Value'{%H-}, 0);
y := XML.GetValue(Path + 'Size/Top/Value', 0); y := XML.GetValue(Path + 'Size/Top/Value'{%H-}, 0);
dx := XML.GetValue(Path + 'Size/Width/Value', 100); dx := XML.GetValue(Path + 'Size/Width/Value'{%H-}, 100);
dy := XML.GetValue(Path + 'Size/Height/Value', 100); dy := XML.GetValue(Path + 'Size/Height/Value'{%H-}, 100);
Flags := Word(XML.GetValue(Path + 'Flags/Value', 0)); // TODO Check default Flags := Word(XML.GetValue(Path + 'Flags/Value'{%H-}, 0)); // TODO Check default
FFrameWidth := StringToFloatDef(XML.GetValue(Path+'Frames/FrameWidth/Value', ''), 1.0); FFrameWidth := StringToFloatDef(XML.GetValue(Path+'Frames/FrameWidth/Value', ''), 1.0);
FFramecolor := StringToColor(XML.GetValue(Path+'Frames/FrameColor/Value', 'clBlack')); // TODO Check default FFramecolor := StringToColor(XML.GetValue(Path+'Frames/FrameColor/Value', 'clBlack')); // TODO Check default
@ -1946,7 +1949,7 @@ begin
FFillColor := StringToColor(XML.GetValue(Path+'FillColor/Value', 'clWindow')); // TODO Check default FFillColor := StringToColor(XML.GetValue(Path+'FillColor/Value', 'clWindow')); // TODO Check default
if StreamMode = smDesigning then if StreamMode = smDesigning then
begin begin
fFormat := XML.GetValue(Path+'Data/Format/Value', Format); // TODO Check default fFormat := XML.GetValue(Path+'Data/Format/Value'{%H-}, Format); // TODO Check default
fFormatStr := XML.GetValue(Path+'Data/FormatStr/Value', FormatStr); fFormatStr := XML.GetValue(Path+'Data/FormatStr/Value', FormatStr);
Memo.Text := XML.GetValue(Path+'Data/Memo/Value', ''); // TODO Check default Memo.Text := XML.GetValue(Path+'Data/Memo/Value', ''); // TODO Check default
Script.Text:= XML.GetValue(Path+'Data/Script/Value', ''); // TODO Check default Script.Text:= XML.GetValue(Path+'Data/Script/Value', ''); // TODO Check default
@ -2009,12 +2012,12 @@ procedure TfrView.SaveToXML(XML: TLrXMLConfig; const Path: String);
begin begin
inherited SaveToXML(XML,Path); inherited SaveToXML(XML,Path);
XML.SetValue(Path+'Typ/Value', frTypeObjectToStr(Typ)); XML.SetValue(Path+'Typ/Value', frTypeObjectToStr(Typ));
XML.SetValue(Path+'StreamMode/Value', Ord(StreamMode)); //todo: use symbolic valuess XML.SetValue(Path+'StreamMode/Value'{%H-}, Ord(StreamMode)); //todo: use symbolic valuess
XML.SetValue(Path+'Size/Left/Value', x); XML.SetValue(Path+'Size/Left/Value'{%H-}, x);
XML.SetValue(Path+'Size/Top/Value', y); XML.SetValue(Path+'Size/Top/Value'{%H-}, y);
XML.SetValue(Path+'Size/Width/Value', dx); XML.SetValue(Path+'Size/Width/Value'{%H-}, dx);
XML.SetValue(Path+'Size/Height/Value', dy); XML.SetValue(Path+'Size/Height/Value'{%H-}, dy);
XML.SetValue(Path+'Flags/Value', flags); XML.SetValue(Path+'Flags/Value'{%H-}, flags);
if IsPublishedProp(self,'FillColor') then if IsPublishedProp(self,'FillColor') then
XML.SetValue(Path+'FillColor/Value', GetSaveProperty('FillColor')); XML.SetValue(Path+'FillColor/Value', GetSaveProperty('FillColor'));
@ -2034,7 +2037,7 @@ begin
if StreamMode = smDesigning then if StreamMode = smDesigning then
begin begin
if IsPublishedProp(self,'Format') then if IsPublishedProp(self,'Format') then
XML.SetValue(Path+'Data/Format/Value', Format); XML.SetValue(Path+'Data/Format/Value'{%H-}, Format);
if IsPublishedProp(self,'FormatStr') then if IsPublishedProp(self,'FormatStr') then
XML.SetValue(Path+'Data/FormatStr/Value', FormatStr); XML.SetValue(Path+'Data/FormatStr/Value', FormatStr);
if IsPublishedProp(self,'Memo') then if IsPublishedProp(self,'Memo') then
@ -2767,7 +2770,6 @@ var
aw: Integer; aw: Integer;
{$ENDIF} {$ENDIF}
n, nw, w, curx: Integer; n, nw, w, curx: Integer;
ParaEnd: Boolean;
Ts: TTextStyle; Ts: TTextStyle;
begin begin
if not Streaming and (cury + th < DR.Bottom) then if not Streaming and (cury + th < DR.Bottom) then
@ -2775,13 +2777,10 @@ var
n := Length(St); n := Length(St);
w := Ord(St[n - 1]) * 256 + Ord(St[n]); w := Ord(St[n - 1]) * 256 + Ord(St[n]);
SetLength(St, n - 2); SetLength(St, n - 2);
ParaEnd := True;
if Length(St) > 0 then if Length(St) > 0 then
begin begin
if St[Length(St)] = #1 then if St[Length(St)] = #1 then
SetLength(St, Length(St) - 1) SetLength(St, Length(St) - 1);
else
ParaEnd := False;
end; end;
// handle any alignment with same code // handle any alignment with same code
@ -2860,17 +2859,11 @@ var
procedure OutLine(str: String); procedure OutLine(str: String);
var var
i, n, cury: Integer; cury: Integer;
ParaEnd: Boolean;
begin begin
SetLength(str, Length(str) - 2); SetLength(str, Length(str) - 2);
if str[Length(str)] = #1 then if str[Length(str)] = #1 then
begin
ParaEnd := True;
SetLength(str, Length(str) - 1); SetLength(str, Length(str) - 1);
end
else
ParaEnd := False;
cury := 0; cury := 0;
case Alignment of case Alignment of
Classes.taLeftJustify : CurY :=y + dy-gapy; Classes.taLeftJustify : CurY :=y + dy-gapy;
@ -3254,9 +3247,9 @@ begin
Font.Name := ReadString(Stream); Font.Name := ReadString(Stream);
with Stream do with Stream do
begin begin
Read(i, 4); Read(i{%H-}, 4);
Font.Size := i; Font.Size := i;
Read(w, 2); Read(w{%H-}, 2);
Font.Style := frSetFontStyle(w); Font.Style := frSetFontStyle(w);
Read(i, 4); Read(i, 4);
Font.Color := i; Font.Color := i;
@ -3271,8 +3264,9 @@ begin
end; end;
Read(TmpAlign,SizeOf(TmpAlign)); Read(TmpAlign{%H-},SizeOf(TmpAlign));
Read(TmpLayout,SizeOf(TmpLayout)); Read(TmpLayout{%H-},SizeOf(TmpLayout));
tmpAngle := 0;
Read(tmpAngle,SizeOf(tmpAngle)); Read(tmpAngle,SizeOf(tmpAngle));
BeginUpdate; BeginUpdate;
@ -3291,13 +3285,13 @@ begin
inherited LoadFromXML(XML, Path); inherited LoadFromXML(XML, Path);
Font.Name := XML.GetValue(Path+'Font/Name/Value', 'Arial'); // todo chk Font.Name := XML.GetValue(Path+'Font/Name/Value', 'Arial'); // todo chk
Font.Size := XML.GetValue(Path+'Font/Size/Value', 10); // todo chk Font.Size := XML.GetValue(Path+'Font/Size/Value'{%H-}, 10); // todo chk
RestoreProperty('CharSet',XML.GetValue(Path+'Font/Charset/Value',''),Font); RestoreProperty('CharSet',XML.GetValue(Path+'Font/Charset/Value',''),Font);
RestoreProperty('Style',XML.GetValue(Path+'Font/Style/Value',''),Font); RestoreProperty('Style',XML.GetValue(Path+'Font/Style/Value',''),Font);
Font.Color := StringToColor(XML.GetValue(Path+'Font/Color/Value','clBlack')); // todo chk Font.Color := StringToColor(XML.GetValue(Path+'Font/Color/Value','clBlack')); // todo chk
if StreamMode = smDesigning then begin if StreamMode = smDesigning then begin
Highlight.FontStyle := XML.GetValue(Path+'Highlight/FontStyle/Value', 0); // todo chk Highlight.FontStyle := XML.GetValue(Path+'Highlight/FontStyle/Value'{%H-}, 0); // todo chk
Highlight.FontColor := StringToColor(XML.GetValue(Path+'Highlight/FontColor/Value', 'clBlack')); Highlight.FontColor := StringToColor(XML.GetValue(Path+'Highlight/FontColor/Value', 'clBlack'));
Highlight.FillColor := StringToColor(XML.GetValue(Path+'Highlight/FillColor/Value', 'clWhite')); Highlight.FillColor := StringToColor(XML.GetValue(Path+'Highlight/FillColor/Value', 'clWhite'));
HighlightStr := XML.GetValue(Path+'Highlight/HighlightStr/Value', HighlightStr); HighlightStr := XML.GetValue(Path+'Highlight/HighlightStr/Value', HighlightStr);
@ -3305,7 +3299,7 @@ begin
RestoreProperty('Alignment',XML.GetValue(Path+'Alignment/Value','')); RestoreProperty('Alignment',XML.GetValue(Path+'Alignment/Value',''));
RestoreProperty('Layout',XML.GetValue(Path+'Layout/Value','')); RestoreProperty('Layout',XML.GetValue(Path+'Layout/Value',''));
Angle := XML.GetValue(Path+'Angle/Value', 0); Angle := XML.GetValue(Path+'Angle/Value'{%H-}, 0);
end; end;
procedure TfrMemoView.SaveToStream(Stream: TStream); procedure TfrMemoView.SaveToStream(Stream: TStream);
@ -3350,21 +3344,21 @@ procedure TfrMemoView.SaveToXML(XML: TLrXMLConfig; const Path: String);
begin begin
inherited SaveToXML(XML, Path); inherited SaveToXML(XML, Path);
XML.SetValue(Path+'Font/Name/Value', Font.name); XML.SetValue(Path+'Font/Name/Value', Font.name);
XML.SetValue(Path+'Font/Size/Value', Font.Size); XML.SetValue(Path+'Font/Size/Value'{%H-}, Font.Size);
XML.SetValue(Path+'Font/Color/Value', ColorToString(Font.Color)); XML.SetValue(Path+'Font/Color/Value', ColorToString(Font.Color));
XML.SetValue(Path+'Font/Charset/Value', GetSaveProperty('CharSet',Font)); XML.SetValue(Path+'Font/Charset/Value', GetSaveProperty('CharSet',Font));
XML.SetValue(Path+'Font/Style/Value', GetSaveProperty('Style',Font)); XML.SetValue(Path+'Font/Style/Value', GetSaveProperty('Style',Font));
if StreamMode=smDesigning then if StreamMode=smDesigning then
begin begin
XML.SetValue(Path+'Highlight/FontStyle/Value', HighLight.FontStyle); XML.SetValue(Path+'Highlight/FontStyle/Value'{%H-}, HighLight.FontStyle);
XML.SetValue(Path+'Highlight/FontColor/Value', ColorToString(Highlight.FontColor)); XML.SetValue(Path+'Highlight/FontColor/Value', ColorToString(Highlight.FontColor));
XML.SetValue(Path+'Highlight/FillColor/Value', ColorToString(Highlight.FillColor)); XML.SetValue(Path+'Highlight/FillColor/Value', ColorToString(Highlight.FillColor));
XML.SetValue(Path+'Highlight/HighlightStr/Value', HighlightStr); XML.SetValue(Path+'Highlight/HighlightStr/Value', HighlightStr);
end; end;
XML.SetValue(Path+'Alignment/Value',GetSaveProperty('Alignment')); XML.SetValue(Path+'Alignment/Value',GetSaveProperty('Alignment'));
XML.SetValue(Path+'Layout/Value', GetSaveProperty('Layout')); XML.SetValue(Path+'Layout/Value', GetSaveProperty('Layout'));
XML.SetValue(Path+'Angle/Value', Angle); XML.SetValue(Path+'Angle/Value'{%H-}, Angle);
end; end;
procedure TfrMemoView.GetBlob(b: TfrTField); procedure TfrMemoView.GetBlob(b: TfrTField);
@ -3756,7 +3750,7 @@ begin
st:=frBandNames[BandType]; st:=frBandNames[BandType];
Font.Orientation := 0; Font.Orientation := 0;
Brush.Color:=clBtnFace; Brush.Color:=clBtnFace;
TextOut(r.left+5, r.top+1, frBandNames[BandType]); TextOut(r.left+5, r.top+1, st);
end; end;
end end
else else
@ -9195,7 +9189,7 @@ begin
Designer.Name := DesName + '__'; Designer.Name := DesName + '__';
Designer.Page := nil; Designer.Page := nil;
frDesigner := TfrReportDesigner(frDesigner.ClassType.NewInstance); frDesigner := TfrReportDesigner(frDesigner.ClassType.NewInstance);
frDesigner.Create(nil); frDesigner.Create(nil){%H-};
Stream := TMemoryStream.Create; Stream := TMemoryStream.Create;
SaveToStream(Stream); SaveToStream(Stream);
Pages.Clear; Pages.Clear;

View File

@ -35,7 +35,7 @@ type
property OnFunction: TFunctionEvent read FOnFunction write FOnFunction; property OnFunction: TFunctionEvent read FOnFunction write FOnFunction;
end; end;
function GetBrackedVariable(s: String; var i, j: Integer): String; function GetBrackedVariable(s: String; var i: integer; out j: Integer): String;
implementation implementation
@ -53,7 +53,7 @@ const
ttNot = #12; ttMod = #13; ttRound = #14; ttNot = #12; ttMod = #13; ttRound = #14;
function GetBrackedVariable(s: String; var i, j: Integer): String; function GetBrackedVariable(s: String; var i: integer; out j: Integer): String;
var var
c: Integer; c: Integer;
fl1, fl2: Boolean; fl1, fl2: Boolean;

View File

@ -66,9 +66,6 @@ implementation
uses LR_Class, LR_Const; uses LR_Class, LR_Const;
var
LocalDescri: string;
procedure frInitFont(aFont : TFont; aColor : TColor; aSize : Integer; aStyle : TFontStyles); procedure frInitFont(aFont : TFont; aColor : TColor; aSize : Integer; aStyle : TFontStyles);
begin begin
with aFont do with aFont do