LazReport Patch from Aleksey Lagunov

1. For dialog controls in designer work UNDO
2. In lrForm StorageEditor list box with props now sorted
3. Fix error in lrSpreadsheetImport - not loaded last col and row
4. increase file format version to 2.9
5. add support for paragraph gap
6. add support for line spacing
7. In report designer add action for UNDO and REDO menu items
8. In designer fix AV on clipborad actions

git-svn-id: trunk@49658 -
This commit is contained in:
jesus 2015-08-12 19:28:00 +00:00
parent 79e2da2c5e
commit 25c059c099
6 changed files with 326 additions and 252 deletions

View File

@ -105,6 +105,7 @@ type
constructor Create(AOwnerPage:TfrPage); override; constructor Create(AOwnerPage:TfrPage); override;
procedure LoadFromXML(XML: TLrXMLConfig; const Path: String); override; procedure LoadFromXML(XML: TLrXMLConfig; const Path: String); override;
procedure SaveToXML(XML: TLrXMLConfig; const Path: String); override; procedure SaveToXML(XML: TLrXMLConfig; const Path: String); override;
procedure Assign(Source: TPersistent); override;
published published
property Alignment: TAlignment read GetAlignment write SetAlignment; property Alignment: TAlignment read GetAlignment write SetAlignment;
property WordWrap:boolean read GetWordWrap write SetWordWrap; property WordWrap:boolean read GetWordWrap write SetWordWrap;
@ -170,6 +171,7 @@ type
constructor Create(AOwnerPage:TfrPage); override; constructor Create(AOwnerPage:TfrPage); override;
procedure LoadFromXML(XML: TLrXMLConfig; const Path: String); override; procedure LoadFromXML(XML: TLrXMLConfig; const Path: String); override;
procedure SaveToXML(XML: TLrXMLConfig; const Path: String); override; procedure SaveToXML(XML: TLrXMLConfig; const Path: String); override;
procedure Assign(Source: TPersistent); override;
published published
property AutoSize; property AutoSize;
property Color; property Color;
@ -194,6 +196,7 @@ type
constructor Create(AOwnerPage:TfrPage); override; constructor Create(AOwnerPage:TfrPage); override;
procedure LoadFromXML(XML: TLrXMLConfig; const Path: String); override; procedure LoadFromXML(XML: TLrXMLConfig; const Path: String); override;
procedure SaveToXML(XML: TLrXMLConfig; const Path: String); override; procedure SaveToXML(XML: TLrXMLConfig; const Path: String); override;
procedure Assign(Source: TPersistent); override;
published published
property AutoSize; property AutoSize;
property Color; property Color;
@ -229,6 +232,7 @@ type
constructor Create(AOwnerPage:TfrPage); override; constructor Create(AOwnerPage:TfrPage); override;
procedure LoadFromXML(XML: TLrXMLConfig; const Path: String); override; procedure LoadFromXML(XML: TLrXMLConfig; const Path: String); override;
procedure SaveToXML(XML: TLrXMLConfig; const Path: String); override; procedure SaveToXML(XML: TLrXMLConfig; const Path: String); override;
procedure Assign(Source: TPersistent); override;
published published
property Color; property Color;
property Enabled; property Enabled;
@ -257,6 +261,7 @@ type
constructor Create(AOwnerPage:TfrPage); override; constructor Create(AOwnerPage:TfrPage); override;
procedure LoadFromXML(XML: TLrXMLConfig; const Path: String); override; procedure LoadFromXML(XML: TLrXMLConfig; const Path: String); override;
procedure SaveToXML(XML: TLrXMLConfig; const Path: String); override; procedure SaveToXML(XML: TLrXMLConfig; const Path: String); override;
procedure Assign(Source: TPersistent); override;
published published
property Color; property Color;
property Enabled; property Enabled;
@ -283,6 +288,7 @@ type
constructor Create(AOwnerPage:TfrPage); override; constructor Create(AOwnerPage:TfrPage); override;
procedure LoadFromXML(XML: TLrXMLConfig; const Path: String); override; procedure LoadFromXML(XML: TLrXMLConfig; const Path: String); override;
procedure SaveToXML(XML: TLrXMLConfig; const Path: String); override; procedure SaveToXML(XML: TLrXMLConfig; const Path: String); override;
procedure Assign(Source: TPersistent); override;
published published
property Color; property Color;
property Enabled; property Enabled;
@ -308,6 +314,7 @@ type
procedure UpdateControlPosition; override; procedure UpdateControlPosition; override;
procedure LoadFromXML(XML: TLrXMLConfig; const Path: String); override; procedure LoadFromXML(XML: TLrXMLConfig; const Path: String); override;
procedure SaveToXML(XML: TLrXMLConfig; const Path: String); override; procedure SaveToXML(XML: TLrXMLConfig; const Path: String); override;
procedure Assign(Source: TPersistent); override;
published published
property ButtonOrder: TButtonOrder read GetButtonOrder write SetButtonOrder default boDefault; property ButtonOrder: TButtonOrder read GetButtonOrder write SetButtonOrder default boDefault;
property ShowButtons: TPanelButtons read GetShowButtons write SetShowButtons default DefShowButtons; property ShowButtons: TPanelButtons read GetShowButtons write SetShowButtons default DefShowButtons;
@ -330,13 +337,12 @@ type
protected protected
procedure PaintDesignControl; override; procedure PaintDesignControl; override;
function CreateControl:TControl;override; function CreateControl:TControl;override;
//procedure AfterCreate;override;
function ExecMetod(const AName: String; p1, p2, p3: Variant; var Val: Variant):boolean;override; function ExecMetod(const AName: String; p1, p2, p3: Variant; var Val: Variant):boolean;override;
public public
constructor Create(AOwnerPage:TfrPage); override; constructor Create(AOwnerPage:TfrPage); override;
procedure LoadFromXML(XML: TLrXMLConfig; const Path: String); override; procedure LoadFromXML(XML: TLrXMLConfig; const Path: String); override;
procedure SaveToXML(XML: TLrXMLConfig; const Path: String); override; procedure SaveToXML(XML: TLrXMLConfig; const Path: String); override;
procedure Assign(Source: TPersistent); override;
published published
property Color; property Color;
property Enabled; property Enabled;
@ -363,6 +369,7 @@ type
constructor Create(AOwnerPage:TfrPage); override; constructor Create(AOwnerPage:TfrPage); override;
procedure LoadFromXML(XML: TLrXMLConfig; const Path: String); override; procedure LoadFromXML(XML: TLrXMLConfig; const Path: String); override;
procedure SaveToXML(XML: TLrXMLConfig; const Path: String); override; procedure SaveToXML(XML: TLrXMLConfig; const Path: String); override;
procedure Assign(Source: TPersistent); override;
published published
property Color; property Color;
property Enabled; property Enabled;
@ -558,6 +565,16 @@ begin
XML.SetValue(Path+'ItemIndex/Value'{%H-}, ItemIndex); XML.SetValue(Path+'ItemIndex/Value'{%H-}, ItemIndex);
end; end;
procedure TlrRadioGroup.Assign(Source: TPersistent);
begin
inherited Assign(Source);
if Source is TlrRadioGroup then
begin
Items.Assign(TlrRadioGroup(Source).Items);
ItemIndex:=TlrRadioGroup(Source).ItemIndex;
end;
end;
{ TlrCheckListBox } { TlrCheckListBox }
function TlrCheckListBox.GetItemIndex: integer; function TlrCheckListBox.GetItemIndex: integer;
@ -685,6 +702,16 @@ begin
XML.SetValue(Path+'ItemIndex/Value'{%H-}, ItemIndex); XML.SetValue(Path+'ItemIndex/Value'{%H-}, ItemIndex);
end; end;
procedure TlrCheckListBox.Assign(Source: TPersistent);
begin
inherited Assign(Source);
if Source is TlrCheckListBox then
begin
Items.Assign(TlrCheckListBox(Source).Items);
ItemIndex:=TlrCheckListBox(Source).ItemIndex;
end;
end;
{ TlrButtonPanel } { TlrButtonPanel }
function TlrButtonPanel.GetButtonOrder: TButtonOrder; function TlrButtonPanel.GetButtonOrder: TButtonOrder;
@ -811,6 +838,16 @@ begin
XML.SetValue(Path+'ShowButtons', GetSaveProperty('ShowButtons')); XML.SetValue(Path+'ShowButtons', GetSaveProperty('ShowButtons'));
end; end;
procedure TlrButtonPanel.Assign(Source: TPersistent);
begin
inherited Assign(Source);
if Source is TlrButtonPanel then
begin
ButtonOrder:=TlrButtonPanel(Source).ButtonOrder;
ShowButtons:=TlrButtonPanel(Source).ShowButtons;
end;
end;
{ TlrDateEdit } { TlrDateEdit }
function TlrDateEdit.GetDate: TDateTime; function TlrDateEdit.GetDate: TDateTime;
@ -863,6 +900,13 @@ begin
inherited SaveToXML(XML, Path); inherited SaveToXML(XML, Path);
end; end;
procedure TlrDateEdit.Assign(Source: TPersistent);
begin
inherited Assign(Source);
if Source is TlrDateEdit then
Date:=TlrDateEdit(Source).Date;
end;
{ TlrListBox } { TlrListBox }
function TlrListBox.GetItemIndex: integer; function TlrListBox.GetItemIndex: integer;
@ -934,6 +978,16 @@ begin
XML.SetValue(Path+'ItemIndex/Value'{%H-}, ItemIndex); XML.SetValue(Path+'ItemIndex/Value'{%H-}, ItemIndex);
end; end;
procedure TlrListBox.Assign(Source: TPersistent);
begin
inherited Assign(Source);
if Source is TlrListBox then
begin
Items.Assign(TlrListBox(Source).Items);
ItemIndex:=TlrListBox(Source).ItemIndex;
end;
end;
{ TlrMemo } { TlrMemo }
procedure TlrMemo.MemoChange(Sender: TObject); procedure TlrMemo.MemoChange(Sender: TObject);
@ -1109,6 +1163,18 @@ begin
XML.SetValue(Path+'DropDownCount/Value'{%H-}, DropDownCount); XML.SetValue(Path+'DropDownCount/Value'{%H-}, DropDownCount);
end; end;
procedure TlrComboBox.Assign(Source: TPersistent);
begin
inherited Assign(Source);
if Source is TlrComboBox then
begin
Style:=TlrComboBox(Source).Style;
Items.Assign(TlrComboBox(Source).Items);
ItemIndex:=TlrComboBox(Source).ItemIndex;
DropDownCount:=TlrComboBox(Source).DropDownCount;
end;
end;
{ TlrCheckBox } { TlrCheckBox }
type type
@ -1177,6 +1243,13 @@ begin
XML.SetValue(Path+'Checked/Value'{%H-}, Checked); XML.SetValue(Path+'Checked/Value'{%H-}, Checked);
end; end;
procedure TlrCheckBox.Assign(Source: TPersistent);
begin
inherited Assign(Source);
if Source is TlrCheckBox then
Checked:=TlrCheckBox(Source).Checked;
end;
{ TlrButton } { TlrButton }
function TlrButton.GetKind: TBitBtnKind; function TlrButton.GetKind: TBitBtnKind;
@ -1228,6 +1301,13 @@ begin
XML.SetValue(Path+'Kind/Value', GetSaveProperty('Kind')); XML.SetValue(Path+'Kind/Value', GetSaveProperty('Kind'));
end; end;
procedure TlrButton.Assign(Source: TPersistent);
begin
inherited Assign(Source);
if Source is TlrButton then
Kind:=TlrButton(Source).Kind;
end;
{ TlrEdit } { TlrEdit }
procedure TlrEdit.PaintDesignControl; procedure TlrEdit.PaintDesignControl;
@ -1326,6 +1406,16 @@ begin
XML.SetValue(Path+'Alignment/Value', GetSaveProperty('Alignment')); XML.SetValue(Path+'Alignment/Value', GetSaveProperty('Alignment'));
end; end;
procedure TlrLabel.Assign(Source: TPersistent);
begin
inherited Assign(Source);
if Source is TlrLabel then
begin
Alignment:=TlrLabel(Source).Alignment;
WordWrap:=TlrLabel(Source).WordWrap;
end;
end;
{ TlrVisualControl } { TlrVisualControl }

View File

@ -8,7 +8,7 @@ object lrFormStorageEditorForm: TlrFormStorageEditorForm
ClientWidth = 570 ClientWidth = 570
OnCreate = FormCreate OnCreate = FormCreate
Position = poScreenCenter Position = poScreenCenter
LCLVersion = '1.3' LCLVersion = '1.5'
object ButtonPanel1: TButtonPanel object ButtonPanel1: TButtonPanel
Left = 6 Left = 6
Height = 42 Height = 42
@ -73,6 +73,7 @@ object lrFormStorageEditorForm: TlrFormStorageEditorForm
ItemHeight = 0 ItemHeight = 0
OnDblClick = ListBoxPropsDblClick OnDblClick = ListBoxPropsDblClick
ScrollWidth = 250 ScrollWidth = 250
Sorted = True
TabOrder = 2 TabOrder = 2
TopIndex = -1 TopIndex = -1
end end

View File

@ -138,11 +138,11 @@ begin
FWorksheet := FWorkbook.GetFirstWorksheet; FWorksheet := FWorkbook.GetFirstWorksheet;
Y:=0; Y:=0;
for Row:=0 to FWorksheet.GetLastRowIndex-1 do for Row:=0 to FWorksheet.GetLastRowIndex do
begin begin
X:=0; X:=0;
DY:=CalcRowHeight(FWorksheet.GetRowHeight(Row)); DY:=CalcRowHeight(FWorksheet.GetRowHeight(Row));
for Col:=0 to FWorksheet.GetLastColIndex-1 do for Col:=0 to FWorksheet.GetLastColIndex do
begin begin
Cell := FWorksheet.FindCell(Row, Col); Cell := FWorksheet.FindCell(Row, Col);
if Assigned(Cell) then if Assigned(Cell) then
@ -212,7 +212,8 @@ begin
if fssItalic in sFont.Style then AFont.Style := AFont.Style + [fsItalic]; if fssItalic in sFont.Style then AFont.Style := AFont.Style + [fsItalic];
if fssUnderline in sFont.Style then AFont.Style := AFont.Style + [fsUnderline]; if fssUnderline in sFont.Style then AFont.Style := AFont.Style + [fsUnderline];
if fssStrikeout in sFont.Style then AFont.Style := AFont.Style + [fsStrikeout]; if fssStrikeout in sFont.Style then AFont.Style := AFont.Style + [fsStrikeout];
AFont.Color := FWorkbook.GetPaletteColor(sFont.Color); //AFont.Color := FWorkbook.GetPaletteColor(sFont.Color);
AFont.Color := sFont.Color;
end; end;
end; end;

View File

@ -257,6 +257,9 @@ type
FTag: string; FTag: string;
FURLInfo: string; FURLInfo: string;
FFindHighlight : boolean; FFindHighlight : boolean;
FGapX:Integer;
FGapY:Integer;
function GetDataField: string; function GetDataField: string;
function GetLeft: Double; function GetLeft: Double;
function GetStretched: Boolean; function GetStretched: Boolean;
@ -275,7 +278,7 @@ type
SaveX, SaveY, SaveDX, SaveDY: Integer; SaveX, SaveY, SaveDX, SaveDY: Integer;
SaveFW: Double; SaveFW: Double;
gapx, gapy: Integer; InternalGapX, InternalGapY: Integer;
Memo1: TStringList; Memo1: TStringList;
FDataSet: TfrTDataSet; FDataSet: TfrTDataSet;
FField: String; FField: String;
@ -352,6 +355,8 @@ type
property StreamMode: TfrStreamMode read fStreamMode write fStreamMode; property StreamMode: TfrStreamMode read fStreamMode write fStreamMode;
property Restrictions:TlrRestrictions read FRestrictions write FRestrictions; property Restrictions:TlrRestrictions read FRestrictions write FRestrictions;
property FindHighlight : boolean read FFindHighlight write FFindHighlight; property FindHighlight : boolean read FFindHighlight write FFindHighlight;
property GapX:Integer read FGapX write FGapX;
property GapY:Integer read FGapY write FGapY;
published published
property Left: double read GetLeft write SetLeft; property Left: double read GetLeft write SetLeft;
property Top: double read GetTop write SetTop; property Top: double read GetTop write SetTop;
@ -452,6 +457,7 @@ type
TextHeight: Integer; TextHeight: Integer;
CurStrNo: Integer; CurStrNo: Integer;
Exporting: Boolean; Exporting: Boolean;
FLineSpacing: Integer;
procedure ExpandVariables; procedure ExpandVariables;
procedure AssignFont(aCanvas: TCanvas); procedure AssignFont(aCanvas: TCanvas);
@ -475,7 +481,7 @@ type
Adjust: Integer; // bit format xxxLLRAA: LL=Layout, R=Rotated, AA=Alignment Adjust: Integer; // bit format xxxLLRAA: LL=Layout, R=Rotated, AA=Alignment
Highlight: TfrHighlightAttr; Highlight: TfrHighlightAttr;
HighlightStr: String; HighlightStr: String;
LineSpacing, CharacterSpacing: Integer; CharacterSpacing: Integer;
LastLine: boolean; // are we painting/exporting the last line? LastLine: boolean; // are we painting/exporting the last line?
FirstLine: boolean; FirstLine: boolean;
@ -510,6 +516,7 @@ type
property OnMouseEnter : TfrScriptStrings read FOnMouseEnter write SetOnMouseEnter; property OnMouseEnter : TfrScriptStrings read FOnMouseEnter write SetOnMouseEnter;
property OnMouseLeave : TfrScriptStrings read FOnMouseLeave write SetOnMouseLeave; property OnMouseLeave : TfrScriptStrings read FOnMouseLeave write SetOnMouseLeave;
property ParagraphGap : integer read FParagraphGap write FParagraphGap; property ParagraphGap : integer read FParagraphGap write FParagraphGap;
property LineSpacing : integer read FLineSpacing write FLineSpacing;
end; end;
TfrMemoView = class(TfrCustomMemoView) TfrMemoView = class(TfrCustomMemoView)
@ -539,6 +546,9 @@ type
property OnClick; property OnClick;
property OnMouseEnter; property OnMouseEnter;
property OnMouseLeave; property OnMouseLeave;
property LineSpacing;
property GapX;
property GapY;
end; end;
{ TfrBandView } { TfrBandView }
@ -1035,6 +1045,7 @@ type
procedure AddRec(ALineIndex: Integer; ARec: Pointer); virtual; procedure AddRec(ALineIndex: Integer; ARec: Pointer); virtual;
function GetviewText(View:TfrView): string; virtual; function GetviewText(View:TfrView): string; virtual;
function CheckView({%H-}View:TfrView): boolean; virtual; function CheckView({%H-}View:TfrView): boolean; virtual;
procedure AfterExport; virtual;
public public
constructor Create(AStream: TStream); virtual; constructor Create(AStream: TStream); virtual;
destructor Destroy; override; destructor Destroy; override;
@ -1258,7 +1269,7 @@ type
// report manipulation methods // report manipulation methods
function DesignReport: Integer; function DesignReport: Integer;
function PrepareReport: Boolean; function PrepareReport: Boolean;
procedure ExportTo(FilterClass: TfrExportFilterClass; aFileName: String); function ExportTo(FilterClass: TfrExportFilterClass; aFileName: String):Boolean;
procedure ShowReport; procedure ShowReport;
procedure ShowPreparedReport; procedure ShowPreparedReport;
procedure PrintPreparedReport(const PageNumbers: String; Copies: Integer); procedure PrintPreparedReport(const PageNumbers: String; Copies: Integer);
@ -1444,12 +1455,13 @@ function FindObjectProps(AObjStr:string; out frObj:TfrObject; out PropName:strin
const const
lrTemplatePath = 'LazReportTemplate/'; lrTemplatePath = 'LazReportTemplate/';
frCurrentVersion = 28; frCurrentVersion = 29;
// version 2.5: lazreport: added to binary stream ParentBandType variable // version 2.5: lazreport: added to binary stream ParentBandType variable
// on TfrView, used to extend export facilities // on TfrView, used to extend export facilities
// version 2.6: lazreport: added to binary stream Tag property on TfrView // version 2.6: lazreport: added to binary stream Tag property on TfrView
// version 2.7: lazreport: added to binary stream FOnClick, FOnMouseEnter, FOnMouseLeave, FCursor property on TfrMemoView // version 2.7: lazreport: added to binary stream FOnClick, FOnMouseEnter, FOnMouseLeave, FCursor property on TfrMemoView
// version 2.8. lazreport: added support for child bands // version 2.8. lazreport: added support for child bands
// version 2.9. lazreport: added support LineSpacing and GapX, GapY
frSpecCount = 9; frSpecCount = 9;
frSpecFuncs: Array[0..frSpecCount - 1] of String = ('PAGE#', '', frSpecFuncs: Array[0..frSpecCount - 1] of String = ('PAGE#', '',
@ -2473,6 +2485,8 @@ begin
FTag := TfrView(Source).FTag; FTag := TfrView(Source).FTag;
FURLInfo := TfrView(Source).FURLInfo; FURLInfo := TfrView(Source).FURLInfo;
FRestrictions := TfrView(Source).FRestrictions; FRestrictions := TfrView(Source).FRestrictions;
FGapX:=TfrView(Source).FGapX;
FGapY:=TfrView(Source).FGapY;
end; end;
end; end;
@ -2503,8 +2517,10 @@ begin
wy1 := Round((FrameWidth * ScaleY - 1) / 2); wy1 := Round((FrameWidth * ScaleY - 1) / 2);
wy2 := Round(FrameWidth * ScaleY / 2); wy2 := Round(FrameWidth * ScaleY / 2);
fFrameWidth := FrameWidth * ScaleX; fFrameWidth := FrameWidth * ScaleX;
gapx := wx2 + 2;
gapy := wy2 div 2 + 1; InternalGapX := wx2 + 2 + FGapX;
InternalGapY := wy2 div 2 + 1 + FGapY;
bx := x; bx := x;
by := y; by := y;
bx1 := Round((SaveX + SaveDX) * ScaleX + OffsX); bx1 := Round((SaveX + SaveDX) * ScaleX + OffsX);
@ -2797,7 +2813,8 @@ begin
Visible:=(Wb<>0); Visible:=(Wb<>0);
end; end;
if (frVersion >= 25) then begin if (frVersion >= 25) then
begin
I := 0; I := 0;
Read(I, 4); Read(I, 4);
ParentBandType := TfrBandType(I); ParentBandType := TfrBandType(I);
@ -2809,6 +2826,12 @@ begin
FURLInfo := frReadString(Stream); FURLInfo := frReadString(Stream);
end; end;
if frVersion >= 29 then
begin
Stream.Read(FGapX, SizeOf(FGapX));
Stream.Read(FGapY, SizeOf(FGapX));
end;
end; end;
{$IFDEF DebugLR} {$IFDEF DebugLR}
DebugLn('%s.TfrView.LoadFromStream end Position=%d',[name, Stream.Position]); DebugLn('%s.TfrView.LoadFromStream end Position=%d',[name, Stream.Position]);
@ -2866,6 +2889,9 @@ begin
S:=XML.GetValue(Path+'Frames/Restrictions/Value',''); S:=XML.GetValue(Path+'Frames/Restrictions/Value','');
if S<>'' then if S<>'' then
RestoreProperty('Restrictions',S); RestoreProperty('Restrictions',S);
FGapX:=XML.GetValue(Path+'Data/GapX/Value', 0);
FGapY:=XML.GetValue(Path+'Data/GapY/Value', 0);
end; end;
procedure TfrView.SaveToStream(Stream: TStream); procedure TfrView.SaveToStream(Stream: TStream);
@ -2930,6 +2956,9 @@ begin
FTmpS:=lrExpandVariables(FURLInfo); FTmpS:=lrExpandVariables(FURLInfo);
frWriteString(Stream, FTmpS); frWriteString(Stream, FTmpS);
end; end;
Stream.Write(FGapX, SizeOf(FGapX));
Stream.Write(FGapY, SizeOf(FGapX));
end; end;
{$IFDEF DebugLR} {$IFDEF DebugLR}
Debugln('%s.SaveToStream end',[name]); Debugln('%s.SaveToStream end',[name]);
@ -2981,6 +3010,9 @@ begin
if IsPublishedProp(self,'Restrictions') then if IsPublishedProp(self,'Restrictions') then
XML.SetValue(Path+'Frames/Restrictions/Value', GetSaveProperty('Restrictions')); XML.SetValue(Path+'Frames/Restrictions/Value', GetSaveProperty('Restrictions'));
XML.SetValue(Path+'Data/GapX/Value', FGapX);
XML.SetValue(Path+'Data/GapY/Value', FGapY);
end; end;
procedure TfrView.Resized; procedure TfrView.Resized;
@ -3584,7 +3616,7 @@ var
SMemo.Add(str + Chr(w div 256) + Chr(w mod 256)); SMemo.Add(str + Chr(w div 256) + Chr(w mod 256));
Inc(size, size1); Inc(size, size1);
//!! //!!
maxWidth := dx - gapx - gapx; maxWidth := dx - InternalGapX - InternalGapX;
end; end;
procedure WrapLine(const s: String); procedure WrapLine(const s: String);
@ -3730,7 +3762,7 @@ var
var var
i: Integer; i: Integer;
begin begin
size := y + gapy; size := y + InternalGapY;
size1 := -WCanvas.Font.Height + LineSpacing; size1 := -WCanvas.Font.Height + LineSpacing;
// maxWidth := dx - gapx - gapx; // maxWidth := dx - gapx - gapx;
{$IFDEF DebugLR} {$IFDEF DebugLR}
@ -3739,13 +3771,13 @@ var
{$ENDIF} {$ENDIF}
for i := 0 to Memo1.Count - 1 do for i := 0 to Memo1.Count - 1 do
begin begin
maxWidth := dx - gapx - gapx - FParagraphGap; maxWidth := dx - InternalGapX - InternalGapX - FParagraphGap;
if (Flags and flWordWrap) <> 0 then if (Flags and flWordWrap) <> 0 then
WrapLine(Memo1[i]) WrapLine(Memo1[i])
else else
OutLine(Memo1[i] + #1); OutLine(Memo1[i] + #1);
end; end;
VHeight := size - y + gapy; VHeight := size - y + InternalGapY;
TextHeight := size1; TextHeight := size1;
{$IFDEF DebugLR} {$IFDEF DebugLR}
DebugLn('OutMemo E: Size=%d Size1=%d MaxWidth=%d DIM:%d %d %d %d gapxy:%d %d', DebugLn('OutMemo E: Size=%d Size1=%d MaxWidth=%d DIM:%d %d %d %d gapxy:%d %d',
@ -3760,9 +3792,9 @@ var
begin begin
h := Create90Font(WCanvas.Font); h := Create90Font(WCanvas.Font);
oldh := SelectObject(WCanvas.Handle, h); oldh := SelectObject(WCanvas.Handle, h);
size := x + gapx; size := x + InternalGapX;
size1 := -WCanvas.Font.Height + LineSpacing; size1 := -WCanvas.Font.Height + LineSpacing;
maxwidth := dy - gapy - gapy; maxwidth := dy - InternalGapY - InternalGapY;
for i := 0 to Memo1.Count - 1 do for i := 0 to Memo1.Count - 1 do
begin begin
if (Flags and flWordWrap) <> 0 then if (Flags and flWordWrap) <> 0 then
@ -3773,7 +3805,7 @@ var
SelectObject(WCanvas.Handle, oldh); SelectObject(WCanvas.Handle, oldh);
DeleteObject(h); DeleteObject(h);
VHeight := size - x + gapx; VHeight := size - x + InternalGapX;
TextHeight := size1; TextHeight := size1;
end; end;
@ -3873,9 +3905,9 @@ var
{$ENDIF} {$ENDIF}
*) *)
case Alignment of case Alignment of
Classes.taLeftJustify : CurX :=x+gapx; Classes.taLeftJustify : CurX :=x+InternalGapX;
Classes.taRightJustify: CurX :=x+dx-1-gapx-Canvas.TextWidth(St); Classes.taRightJustify: CurX :=x+dx-1-InternalGapX-Canvas.TextWidth(St);
Classes.taCenter : CurX :=x+gapx+(dx-gapx-gapx-Canvas.TextWidth(St)) div 2; Classes.taCenter : CurX :=x+InternalGapX+(dx-InternalGapX-InternalGapX-Canvas.TextWidth(St)) div 2;
end; end;
if not Exporting then if not Exporting then
@ -3883,9 +3915,9 @@ var
if Justify and not LastLine then if Justify and not LastLine then
begin begin
if FirstLine then if FirstLine then
CanvasTextRectJustify(Canvas, DR, x+gapx + FParagraphGap, x+dx-1-gapx, round(CurYf), St, true) CanvasTextRectJustify(Canvas, DR, x+InternalGapX + FParagraphGap, x+dx-1-InternalGapX, round(CurYf), St, true)
else else
CanvasTextRectJustify(Canvas, DR, x+gapx, x+dx-1-gapx, round(CurYf), St, true) CanvasTextRectJustify(Canvas, DR, x+InternalGapX, x+dx-1-InternalGapX, round(CurYf), St, true)
end end
else else
begin begin
@ -3922,7 +3954,7 @@ var
if Layout=tlBottom then if Layout=tlBottom then
y:=y+dy-VHeight; y:=y+dy-VHeight;
end; end;
curyf := y + gapy; curyf := y + InternalGapY;
LineSpc := LineSpacing * ScaleY; LineSpc := LineSpacing * ScaleY;
// calc our reference at 100% and then scale it // calc our reference at 100% and then scale it
@ -3973,9 +4005,9 @@ var
Canvas.TextStyle := Ts; Canvas.TextStyle := Ts;
case Alignment of case Alignment of
Classes.taLeftJustify : CurY :=y + dy-gapy; Classes.taLeftJustify : CurY :=y + dy-InternalGapY;
Classes.taRightJustify: CurY :=y + gapy + 1 + Canvas.TextWidth(str); Classes.taRightJustify: CurY :=y + InternalGapY + 1 + Canvas.TextWidth(str);
Classes.taCenter : CurY :=y + gapy + (dy + Canvas.TextWidth(str)) div 2; Classes.taCenter : CurY :=y + InternalGapY + (dy + Canvas.TextWidth(str)) div 2;
end; end;
if not Exporting then if not Exporting then
canvas.TextOut(curx,cury,str) canvas.TextOut(curx,cury,str)
@ -4002,7 +4034,7 @@ var
else if Layout=tlBottom then else if Layout=tlBottom then
x:=x+dx-VHeight; x:=x+dx-VHeight;
end; end;
curx := x + gapx; curx := x + InternalGapX;
th := -Canvas.Font.Height + Round(LineSpacing * ScaleY); th := -Canvas.Font.Height + Round(LineSpacing * ScaleY);
CurStrNo := 0; CurStrNo := 0;
for i := 0 to Memo1.Count - 1 do for i := 0 to Memo1.Count - 1 do
@ -4413,6 +4445,10 @@ begin
Stream.Read(FParagraphGap, SizeOf(FParagraphGap)); Stream.Read(FParagraphGap, SizeOf(FParagraphGap));
end; end;
if frVersion >= 29 then
begin
Stream.Read(FLineSpacing, SizeOf(FLineSpacing));
end;
end; end;
if frVersion = 21 then if frVersion = 21 then
@ -4449,6 +4485,7 @@ begin
FDetailReport:= XML.GetValue(Path+'Data/DetailReport/Value', ''); FDetailReport:= XML.GetValue(Path+'Data/DetailReport/Value', '');
FParagraphGap:=XML.GetValue(Path+'Data/ParagraphGap/Value', 0); FParagraphGap:=XML.GetValue(Path+'Data/ParagraphGap/Value', 0);
FLineSpacing:=XML.GetValue(Path+'Data/LineSpacing/Value', 2);
end; end;
procedure TfrCustomMemoView.SaveToStream(Stream: TStream); procedure TfrCustomMemoView.SaveToStream(Stream: TStream);
@ -4490,6 +4527,7 @@ begin
frWriteMemo(Stream, FOnMouseLeave); frWriteMemo(Stream, FOnMouseLeave);
frWriteString(Stream, FDetailReport); frWriteString(Stream, FDetailReport);
Stream.Write(FParagraphGap, SizeOf(FParagraphGap)); Stream.Write(FParagraphGap, SizeOf(FParagraphGap));
Stream.Write(FLineSpacing, SizeOf(FLineSpacing));
end; end;
end; end;
@ -4521,6 +4559,7 @@ begin
XML.SetValue(Path+'Data/DetailReport/Value', FDetailReport); XML.SetValue(Path+'Data/DetailReport/Value', FDetailReport);
XML.SetValue(Path+'Data/ParagraphGap/Value', FParagraphGap); XML.SetValue(Path+'Data/ParagraphGap/Value', FParagraphGap);
XML.SetValue(Path+'Data/LineSpacing/Value', FLineSpacing);
end; end;
procedure TfrCustomMemoView.GetBlob(b: TfrTField); procedure TfrCustomMemoView.GetBlob(b: TfrTField);
@ -6685,7 +6724,7 @@ begin
// additionally, when objects are drawn, they are offseted t.gapy pixels // additionally, when objects are drawn, they are offseted t.gapy pixels
// but this is object dependant, for TfrMemoView they are. // but this is object dependant, for TfrMemoView they are.
if (t is TfrMemoView) then if (t is TfrMemoView) then
ty := ty + t.gapy; ty := ty + t.InternalGapY;
k := Max(TfrStretcheable(t).MinHeight, 1); k := Max(TfrStretcheable(t).MinHeight, 1);
pgArr[j] := Min(pgArr[j], ty + (newDy-ty) div k * k); pgArr[j] := Min(pgArr[j], ty + (newDy-ty) div k * k);
@ -10788,7 +10827,8 @@ begin
frProgressForm.ModalResult := mrOk; frProgressForm.ModalResult := mrOk;
end; end;
procedure TfrReport.ExportTo(FilterClass: TfrExportFilterClass; aFileName: String); function TfrReport.ExportTo(FilterClass: TfrExportFilterClass; aFileName: String
): Boolean;
var var
s: String; s: String;
i: Integer; i: Integer;
@ -10846,10 +10886,15 @@ begin
fDefExportFilterClass := FCurrentFilter.ClassName; fDefExportFilterClass := FCurrentFilter.ClassName;
fDefExportFileName := aFileName; fDefExportFileName := aFileName;
end; Result:=true;
end
else
Result:=false;
FreeAndNil(FCurrentFilter);
ExportStream.Free; ExportStream.Free;
if Result then
FCurrentFilter.AfterExport;
FreeAndNil(FCurrentFilter);
end; end;
procedure TfrReport.FillQueryParams; procedure TfrReport.FillQueryParams;
@ -10926,12 +10971,12 @@ begin
begin begin
for i := 0 to Pages.Count - 1 do for i := 0 to Pages.Count - 1 do
if Pages[i] is TfrPageReport then if Pages[i] is TfrPageReport then
Pages[i].InitReport; Pages[i].InitReport;
PrepareDataSets; PrepareDataSets;
for i := 0 to Pages.Count - 1 do for i := 0 to Pages.Count - 1 do
if Pages[i]is TfrPageReport then if Pages[i] is TfrPageReport then
Pages[i].PrepareObjects; Pages[i].PrepareObjects;
repeat repeat
{$IFDEF DebugLR} {$IFDEF DebugLR}
@ -11969,6 +12014,11 @@ begin
result := true; result := true;
end; end;
procedure TfrExportFilter.AfterExport;
begin
// abstract method
end;
procedure TfrExportFilter.OnBeginDoc; procedure TfrExportFilter.OnBeginDoc;
begin begin
// abstract method // abstract method

View File

@ -9,7 +9,7 @@ object frDesignerForm: TfrDesignerForm
VertScrollBar.Range = 149 VertScrollBar.Range = 149
ActiveControl = frDock1 ActiveControl = frDock1
Caption = 'Designer' Caption = 'Designer'
ClientHeight = 407 ClientHeight = 405
ClientWidth = 695 ClientWidth = 695
KeyPreview = True KeyPreview = True
Menu = MainMenu1 Menu = MainMenu1
@ -27,8 +27,8 @@ object frDesignerForm: TfrDesignerForm
WindowState = wsMaximized WindowState = wsMaximized
object StatusBar1: TStatusBar object StatusBar1: TStatusBar
Left = 0 Left = 0
Height = 23 Height = 25
Top = 384 Top = 380
Width = 695 Width = 695
Panels = < Panels = <
item item
@ -47,12 +47,12 @@ object frDesignerForm: TfrDesignerForm
end end
object frDock1: TPanel object frDock1: TPanel
Left = 0 Left = 0
Height = 83 Height = 80
Top = 0 Top = 0
Width = 695 Width = 695
Align = alTop Align = alTop
BevelOuter = bvNone BevelOuter = bvNone
ClientHeight = 83 ClientHeight = 80
ClientWidth = 695 ClientWidth = 695
FullRepaint = False FullRepaint = False
TabOrder = 0 TabOrder = 0
@ -862,78 +862,10 @@ object frDesignerForm: TfrDesignerForm
Height = 24 Height = 24
Top = 1 Top = 1
Width = 22 Width = 22
Action = edtUndo
Align = alLeft Align = alLeft
Flat = True Flat = True
Glyph.Data = { ShowCaption = False
36080000424D3608000000000000360000002800000020000000100000000100
2000000000000008000064000000640000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000FFFBFFFF0000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000A5A2A5FFA50000FF000000000000000000000000000000000000
000000000000FFFBFFFFFFFBFFFFFFFBFFFFFFFBFFFFFFFBFFFF000000000000
00000000000000000000A5A2A5FFFFFBFFFF0000000000000000000000000000
0000A50000FFA50000FFA50000FFA50000FFA50000FF00000000000000000000
00000000000000000000A50000FFA5A2A5FF0000000000000000000000000000
0000A5A2A5FFA5A2A5FFA5A2A5FFA5A2A5FFA5A2A5FF00000000000000000000
00000000000000000000A5A2A5FF00000000FFFBFFFF00000000000000000000
0000A50000FFA50000FFA50000FFA50000FF0000000000000000000000000000
0000000000000000000000000000A50000FF0000000000000000000000000000
0000A5A2A5FFA5A2A5FFA5A2A5FFA5A2A5FF0000000000000000000000000000
0000000000000000000000000000A5A2A5FFFFFBFFFF00000000000000000000
0000A50000FFA50000FFA50000FF000000000000000000000000000000000000
0000000000000000000000000000A50000FF0000000000000000000000000000
0000A5A2A5FFA5A2A5FFA5A2A5FF00000000FFFBFFFF00000000000000000000
0000000000000000000000000000A5A2A5FFFFFBFFFF00000000000000000000
0000A50000FFA50000FF00000000A50000FF0000000000000000000000000000
0000000000000000000000000000A50000FF0000000000000000000000000000
0000A5A2A5FFA5A2A5FF00000000A5A2A5FF00000000FFFBFFFFFFFBFFFF0000
0000000000000000000000000000A5A2A5FF0000000000000000000000000000
0000A50000FF000000000000000000000000A50000FFA50000FF000000000000
00000000000000000000A50000FFA5A2A5FF0000000000000000000000000000
0000A5A2A5FF000000000000000000000000A5A2A5FFA5A2A5FF00000000FFFB
FFFFFFFBFFFFFFFBFFFFA5A2A5FF000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000A50000FFA500
00FFA50000FFA50000FFA5A2A5FF000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000A5A2A5FFA5A2
A5FFA5A2A5FFA5A2A5FF00000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000
}
NumGlyphs = 2
OnClick = UndoBClick
end end
object RedoB: TSpeedButton object RedoB: TSpeedButton
Tag = 48 Tag = 48
@ -941,78 +873,10 @@ object frDesignerForm: TfrDesignerForm
Height = 24 Height = 24
Top = 1 Top = 1
Width = 22 Width = 22
Action = edtRedo
Align = alLeft Align = alLeft
Flat = True Flat = True
Glyph.Data = { ShowCaption = False
36080000424D3608000000000000360000002800000020000000100000000100
2000000000000008000064000000640000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
00000000000000000000FFFBFFFF000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000A50000FFA5A2A5FF000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000A5A2A5FFFFFBFFFF000000000000000000000000000000000000
0000FFFBFFFFFFFBFFFFFFFBFFFFFFFBFFFFFFFBFFFF00000000000000000000
0000A5A2A5FFA50000FF0000000000000000000000000000000000000000A500
00FFA50000FFA50000FFA50000FFA50000FF0000000000000000000000000000
000000000000A5A2A5FF0000000000000000000000000000000000000000A5A2
A5FFA5A2A5FFA5A2A5FFA5A2A5FFA5A2A5FFFFFBFFFF00000000000000000000
0000A50000FF0000000000000000000000000000000000000000000000000000
0000A50000FFA50000FFA50000FFA50000FF0000000000000000000000000000
0000A5A2A5FFFFFBFFFF00000000000000000000000000000000000000000000
0000A5A2A5FFA5A2A5FFA5A2A5FFA5A2A5FFFFFBFFFF00000000000000000000
0000A50000FF0000000000000000000000000000000000000000000000000000
000000000000A50000FFA50000FFA50000FF0000000000000000000000000000
0000A5A2A5FFFFFBFFFF00000000000000000000000000000000000000000000
000000000000A5A2A5FFA5A2A5FFA5A2A5FFFFFBFFFF00000000000000000000
0000A50000FF0000000000000000000000000000000000000000000000000000
0000A50000FF00000000A50000FFA50000FF0000000000000000000000000000
0000A5A2A5FF00000000FFFBFFFF00000000000000000000000000000000FFFB
FFFFA5A2A5FF00000000A5A2A5FFA5A2A5FFFFFBFFFF00000000000000000000
0000A5A2A5FFA50000FF00000000000000000000000000000000A50000FFA500
00FF000000000000000000000000A50000FF0000000000000000000000000000
000000000000A5A2A5FF00000000FFFBFFFFFFFBFFFFFFFBFFFFA5A2A5FFA5A2
A5FF000000000000000000000000A5A2A5FF0000000000000000000000000000
000000000000A5A2A5FFA50000FFA50000FFA50000FFA50000FF000000000000
0000000000000000000000000000000000000000000000000000000000000000
00000000000000000000A5A2A5FFA5A2A5FFA5A2A5FFA5A2A5FF000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000
}
NumGlyphs = 2
OnClick = RedoBClick
end end
object HelpBtn: TSpeedButton object HelpBtn: TSpeedButton
Left = 431 Left = 431
@ -1819,7 +1683,7 @@ object frDesignerForm: TfrDesignerForm
object C2: TComboBox object C2: TComboBox
Tag = 7 Tag = 7
Left = 1 Left = 1
Height = 33 Height = 35
Top = 2 Top = 2
Width = 155 Width = 155
ItemHeight = 13 ItemHeight = 13
@ -2216,7 +2080,7 @@ object frDesignerForm: TfrDesignerForm
object E1: TEdit object E1: TEdit
Tag = 6 Tag = 6
Left = 4 Left = 4
Height = 33 Height = 31
Top = 1 Top = 1
Width = 31 Width = 31
TabOrder = 0 TabOrder = 0
@ -2281,21 +2145,21 @@ object frDesignerForm: TfrDesignerForm
end end
object frDock2: TPanel object frDock2: TPanel
Left = 0 Left = 0
Height = 301 Height = 300
Top = 83 Top = 80
Width = 27 Width = 27
Align = alLeft Align = alLeft
ClientHeight = 301 ClientHeight = 300
ClientWidth = 27 ClientWidth = 27
FullRepaint = False FullRepaint = False
TabOrder = 1 TabOrder = 1
object panForDlg: TPanel object panForDlg: TPanel
Left = 1 Left = 1
Height = 299 Height = 298
Top = 1 Top = 1
Width = 25 Width = 25
Align = alClient Align = alClient
ClientHeight = 299 ClientHeight = 298
ClientWidth = 25 ClientWidth = 25
FullRepaint = False FullRepaint = False
TabOrder = 1 TabOrder = 1
@ -2361,11 +2225,11 @@ object frDesignerForm: TfrDesignerForm
end end
object Panel4: TPanel object Panel4: TPanel
Left = 1 Left = 1
Height = 299 Height = 298
Top = 1 Top = 1
Width = 25 Width = 25
Align = alClient Align = alClient
ClientHeight = 299 ClientHeight = 298
ClientWidth = 25 ClientWidth = 25
FullRepaint = False FullRepaint = False
TabOrder = 0 TabOrder = 0
@ -2664,8 +2528,8 @@ object frDesignerForm: TfrDesignerForm
end end
object Tab1: TTabControl object Tab1: TTabControl
Left = 27 Left = 27
Height = 301 Height = 300
Top = 83 Top = 80
Width = 641 Width = 641
TabStop = False TabStop = False
OnChange = Tab1Change OnChange = Tab1Change
@ -2678,24 +2542,24 @@ object frDesignerForm: TfrDesignerForm
TabOrder = 2 TabOrder = 2
object panTab: TPanel object panTab: TPanel
Left = 2 Left = 2
Height = 266 Height = 262
Top = 33 Top = 36
Width = 637 Width = 637
Align = alClient Align = alClient
BevelOuter = bvNone BevelOuter = bvNone
Caption = 'panTab' Caption = 'panTab'
ClientHeight = 266 ClientHeight = 262
ClientWidth = 637 ClientWidth = 637
TabOrder = 1 TabOrder = 1
object ScrollBox1: TScrollBox object ScrollBox1: TScrollBox
Left = 0 Left = 0
Height = 266 Height = 262
Top = 0 Top = 0
Width = 637 Width = 637
HorzScrollBar.Page = 488 HorzScrollBar.Page = 488
VertScrollBar.Page = 174 VertScrollBar.Page = 174
Align = alClient Align = alClient
ClientHeight = 264 ClientHeight = 260
ClientWidth = 635 ClientWidth = 635
Color = clGray Color = clGray
ParentColor = False ParentColor = False
@ -3958,12 +3822,12 @@ object frDesignerForm: TfrDesignerForm
end end
object frDock4: TPanel object frDock4: TPanel
Left = 668 Left = 668
Height = 301 Height = 300
Top = 83 Top = 80
Width = 27 Width = 27
Align = alRight Align = alRight
Anchors = [akTop, akRight] Anchors = [akTop, akRight]
ClientHeight = 301 ClientHeight = 300
ClientWidth = 27 ClientWidth = 27
FullRepaint = False FullRepaint = False
TabOrder = 3 TabOrder = 3
@ -4560,8 +4424,8 @@ object frDesignerForm: TfrDesignerForm
end end
object Popup1: TPopupMenu object Popup1: TPopupMenu
OnPopup = Popup1Popup OnPopup = Popup1Popup
left = 272 left = 368
top = 96 top = 48
object N2: TMenuItem object N2: TMenuItem
Caption = ' ' Caption = ' '
ShortCut = 16472 ShortCut = 16472
@ -4579,7 +4443,6 @@ object frDesignerForm: TfrDesignerForm
end end
object N5: TMenuItem object N5: TMenuItem
Caption = ' ' Caption = ' '
ShortCut = 46
OnClick = N5Click OnClick = N5Click
end end
object N16: TMenuItem object N16: TMenuItem
@ -4597,8 +4460,8 @@ object frDesignerForm: TfrDesignerForm
end end
object MainMenu1: TMainMenu object MainMenu1: TMainMenu
Images = ActionsImageList Images = ActionsImageList
left = 208 left = 320
top = 88 top = 48
object FileMenu: TMenuItem object FileMenu: TMenuItem
Caption = '&File' Caption = '&File'
object N23: TMenuItem object N23: TMenuItem
@ -4758,14 +4621,10 @@ object frDesignerForm: TfrDesignerForm
object EditMenu: TMenuItem object EditMenu: TMenuItem
Caption = '&Edit' Caption = '&Edit'
object N46: TMenuItem object N46: TMenuItem
Caption = 'Undo' Action = edtUndo
ShortCut = 16474
OnClick = UndoBClick
end end
object N48: TMenuItem object N48: TMenuItem
Caption = 'Redo' Action = edtRedo
ShortCut = 16473
OnClick = RedoBClick
end end
object N47: TMenuItem object N47: TMenuItem
Caption = '-' Caption = '-'
@ -4787,7 +4646,6 @@ object frDesignerForm: TfrDesignerForm
end end
object N27: TMenuItem object N27: TMenuItem
Caption = 'Delete' Caption = 'Delete'
ShortCut = 46
OnClick = N5Click OnClick = N5Click
end end
object N28: TMenuItem object N28: TMenuItem
@ -5115,8 +4973,8 @@ object frDesignerForm: TfrDesignerForm
object ImgIndic: TImageList object ImgIndic: TImageList
Height = 8 Height = 8
Width = 8 Width = 8
left = 328 left = 584
top = 96 top = 8
Bitmap = { Bitmap = {
4C69030000000800000008000000000000000000000000000000000000000000 4C69030000000800000008000000000000000000000000000000000000000000
00000000000000000000000000FF0000000000F900FF00F900FF00F900FF00F9 00000000000000000000000000FF0000000000F900FF00F900FF00F900FF00F9
@ -5147,8 +5005,8 @@ object frDesignerForm: TfrDesignerForm
end end
object actList: TActionList object actList: TActionList
Images = ActionsImageList Images = ActionsImageList
left = 560 left = 640
top = 36 top = 8
object acDuplicate: TAction object acDuplicate: TAction
Category = 'Edit' Category = 'Edit'
Caption = 'Duplicate object' Caption = 'Duplicate object'
@ -5196,12 +5054,24 @@ object frDesignerForm: TfrDesignerForm
Caption = 'Data inspector' Caption = 'Data inspector'
OnExecute = tlsDBFieldsExecute OnExecute = tlsDBFieldsExecute
end end
object edtUndo: TAction
Category = 'Edit'
Caption = 'Undo'
ImageIndex = 3
OnExecute = edtUndoExecute
end
object edtRedo: TAction
Category = 'Edit'
Caption = 'Redo'
ImageIndex = 4
OnExecute = edtRedoExecute
end
end end
object ActionsImageList: TImageList object ActionsImageList: TImageList
left = 328 left = 584
top = 156 top = 48
Bitmap = { Bitmap = {
4C6903000000100000001000000000000000BD6931FFBD6931FFBD6931FFBD69 4C6905000000100000001000000000000000BD6931FFBD6931FFBD6931FFBD69
31FFBD6931FFBD6931FFBD6931FFBD6931FFBD6D39FFBD6D39FFBD6D39FFBD69 31FFBD6931FFBD6931FFBD6931FFBD6931FFBD6D39FFBD6D39FFBD6D39FFBD69
39FFBD7139FF0000000000000000BD6931FFF7E7D6FFF7E7D6FFFFFFFFFFFFFF 39FFBD7139FF0000000000000000BD6931FFF7E7D6FFF7E7D6FFFFFFFFFFFFFF
F7FFFFFFF7FFFFF7F7FFFFF7EFFFFFF7EFFFFFFFF7FFFFFFF7FFFFF7EFFFFFEF F7FFFFFFF7FFFFF7F7FFFFF7EFFFFFF7EFFFFFFFF7FFFFFFF7FFFFF7EFFFFFEF
@ -5297,7 +5167,71 @@ object frDesignerForm: TfrDesignerForm
F6FF8EDEF5FF89DCF5FF85DAF4FF80D9F4FF7AD7F3FF74D5F3FF70D3F2FFC2EA F6FF8EDEF5FF89DCF5FF85DAF4FF80D9F4FF7AD7F3FF74D5F3FF70D3F2FFC2EA
F8FF3594DAFFFFFFFF00FFFFFF002C86D8D12D88D8F72D87D8F72D88D8F72D88 F8FF3594DAFFFFFFFF00FFFFFF002C86D8D12D88D8F72D87D8F72D88D8F72D88
D8F72D88D8F72D88D8F72D88D8F72D88D8F72D88D8F72D88D8F72D87D8F72D88 D8F72D88D8F72D88D8F72D88D8F72D88D8F72D88D8F72D88D8F72D87D8F72D88
D8F72C86D8D1FFFFFF00FFFFFF00 D8F72C86D8D1FFFFFF00FFFFFF00000000000000000000000000000000000000
00000000000000A0C4FF00000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000009D
BF1400A0C4FF00A0C4FF00000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000005797D1100A0
C4FFADF3FBFF00A0C4FF00000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000005797D1100A0C4FFADF3
FBFF25E4FBFF00A0C4FF00A0C4FF13A1BEE7159FBBCF1BA1BBA4067A7C0B0000
00000000000000000000000000000000000005797D1100A0C4FFADF3FBFF31E1
F6FF20E3FAFF73ECFAFF6FEBFAFF6EE8F7FF6CE8F7F814A1BCD414A3C1D50579
7D1C00000000000000000000000005797D0A00A0C4FFADF3FBFF2FE0F6FF32E2
F7FF29DBF1FF2FE0F5FF29DBF1FF16CDE3FF36D9ECFF69E7F6FF41CEE3FE13A3
C1E405797D32000000000000000000A0C4FFADF3FBFF2FE0F6FF32E2F8FF32E2
F7FF32E2F7FF2FE0F5FF29DBF1FF1DD2E8FF1DD2E8FF1DD2E8FF36D9ECFF40CD
E1FF16A1BDCA05797D0A0000000005797E1100A0C4FF79EDFBFF32E2F8FF2CDF
F4FF04C0D6FF04C0D6FF04C0D6FF1DD2E8FF1DD2E8FF1DD2E8FF0BC8DFFF6AE5
F3FF1BABC5F815A0BCCB000000000000000005797D1100A0C4FF76EDFBFF04C3
DAFF76EDFBFF69EAF9FF69EAF9FF69EAF9FF69EAF9FF05DDF7FF0AC8DFFF07C2
D8FF6FDCEBFF1BA3BFF400000000000000000000000005797D1100A0C4FF76ED
FBFF76EDFBFF00A0C4FF00A0C4FF00A0C4FF00A0C4FF01A9C4FF6EE1EEFF0FC9
DFFF69E4F2FF1AA4C0F80000000000000000000000000000000005797D1100A0
C4FF76EDFBFF00A0C4FF000000000000000000A0C4300099B95000A0C4C96DE6
F5FF76E2EFFF19A3C1FF00000000000000000000000000000000000000000000
000000A0C4FF00A0C4FF00000000000000000000000000000000009EC11A02AC
C8FF88E7F2FE11A2C2FF00000000000000000000000000000000000000000000
00000000000000A0C4FF00000000000000000000000000000000000000000EAA
CBFE5DDAE9FE23A6C0EF00000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000A0C42243C4
DBFC43C5D8FE23A6C07F00000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000A0C45D66DB
EAB211A6C2AE0000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000018A6C3691AA7
C46900A0C4180000000000000000FFFFFF000000000000000000000000000000
00000000000000000000000000000000000000A0C4FF00000000000000000000
0000000000000000000000000000FFFFFF000000000000000000000000000000
00000000000000000000000000000000000000A0C4FF00A0C4FF009DBF140000
0000000000000000000000000000FFFFFF000000000000000000000000000000
00000000000000000000000000000000000000A0C4FFADF3FBFF00A0C4FF0579
7D11000000000000000000000000FFFFFF00000000000000000000000000067A
7C0B1BA1BBA4159FBBCF13A1BEE700A0C4FF00A0C4FF25E4FBFFADF3FBFF00A0
C4FF05797D110000000000000000FFFFFF00000000000000000005797D1C14A3
C1D514A1BCD46CE8F7F86EE8F7FF6FEBFAFF73ECFAFF20E3FAFF31E1F6FFADF3
FBFF00A0C4FF05797D1100000000FFFFFF000000000005797D3213A3C1E441CE
E3FE69E7F6FF36D9ECFF16CDE3FF29DBF1FF2FE0F5FF29DBF1FF32E2F7FF2FE0
F6FFADF3FBFF00A0C4FF05797D0AFFFFFF0005797D0A16A1BDCA40CDE1FF36D9
ECFF1DD2E8FF1DD2E8FF1DD2E8FF29DBF1FF2FE0F5FF32E2F7FF32E2F7FF32E2
F8FF2FE0F6FFADF3FBFF00A0C4FFFFFFFF0015A0BCCB1BABC5F86AE5F3FF0BC8
DFFF1DD2E8FF1DD2E8FF1DD2E8FF04C0D6FF04C0D6FF04C0D6FF2CDFF4FF32E2
F8FF79EDFBFF00A0C4FF05797E11FFFFFF001BA3BFF46FDCEBFF07C2D8FF0AC8
DFFF05DDF7FF69EAF9FF69EAF9FF69EAF9FF69EAF9FF76EDFBFF04C3DAFF76ED
FBFF00A0C4FF05797D1100000000FFFFFF001AA4C0F869E4F2FF0FC9DFFF6EE1
EEFF01A9C4FF00A0C4FF00A0C4FF00A0C4FF00A0C4FF76EDFBFF76EDFBFF00A0
C4FF05797D110000000000000000FFFFFF0019A3C1FF76E2EFFF6DE6F5FF00A0
C4C90099B95000A0C430000000000000000000A0C4FF76EDFBFF00A0C4FF0579
7D11000000000000000000000000FFFFFF0011A2C2FF88E7F2FE02ACC8FF009E
C11A0000000000000000000000000000000000A0C4FF00A0C4FF000000000000
0000000000000000000000000000FFFFFF0023A6C0EF5DDAE9FE0EAACBFE0000
00000000000000000000000000000000000000A0C4FF00000000000000000000
0000000000000000000000000000FFFFFF0023A6C07F43C5D8FE43C4DBFC00A0
C422000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000FFFFFF000000000011A6C2AE66DBEAB200A0
C45D000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000FFFFFF000000000000A0C4181AA7C46918A6
C369000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000
} }
end end
end end

View File

@ -245,6 +245,8 @@ type
TfrDesignerForm = class(TfrReportDesigner) TfrDesignerForm = class(TfrReportDesigner)
acDuplicate: TAction; acDuplicate: TAction;
edtRedo: TAction;
edtUndo: TAction;
MenuItem2: TMenuItem; MenuItem2: TMenuItem;
tlsDBFields: TAction; tlsDBFields: TAction;
FileBeforePrintScript: TAction; FileBeforePrintScript: TAction;
@ -431,6 +433,8 @@ type
procedure acDuplicateExecute(Sender: TObject); procedure acDuplicateExecute(Sender: TObject);
procedure acToggleFramesExecute(Sender: TObject); procedure acToggleFramesExecute(Sender: TObject);
procedure C2GetItems(Sender: TObject); procedure C2GetItems(Sender: TObject);
procedure edtRedoExecute(Sender: TObject);
procedure edtUndoExecute(Sender: TObject);
procedure FileBeforePrintScriptExecute(Sender: TObject); procedure FileBeforePrintScriptExecute(Sender: TObject);
procedure FileOpenExecute(Sender: TObject); procedure FileOpenExecute(Sender: TObject);
procedure FilePreviewExecute(Sender: TObject); procedure FilePreviewExecute(Sender: TObject);
@ -490,8 +494,6 @@ type
procedure Tab1Change(Sender: TObject); procedure Tab1Change(Sender: TObject);
procedure N34Click(Sender: TObject); procedure N34Click(Sender: TObject);
procedure GB3Click(Sender: TObject); procedure GB3Click(Sender: TObject);
procedure UndoBClick(Sender: TObject);
procedure RedoBClick(Sender: TObject);
//procedure N20Click(Sender: TObject); //procedure N20Click(Sender: TObject);
procedure PBox1Paint(Sender: TObject); procedure PBox1Paint(Sender: TObject);
procedure SB1Click(Sender: TObject); procedure SB1Click(Sender: TObject);
@ -3073,11 +3075,14 @@ begin
FileSave.Hint:= sFRDesignerFormSaveRp; FileSave.Hint:= sFRDesignerFormSaveRp;
FilePreview.Hint := sFRDesignerFormPreview; FilePreview.Hint := sFRDesignerFormPreview;
edtUndo.Caption := sFRDesignerForm_Undo;
edtUndo.Hint := sFRDesignerFormUndo;
edtRedo.Caption := sFRDesignerForm_Redo;
edtRedo.Hint := sFRDesignerFormRedo;
CutB.Hint := sFRDesignerFormCut; CutB.Hint := sFRDesignerFormCut;
CopyB.Hint := sFRDesignerFormCopy; CopyB.Hint := sFRDesignerFormCopy;
PstB.Hint := sFRDesignerFormPast; PstB.Hint := sFRDesignerFormPast;
UndoB.Hint := sFRDesignerFormUndo;
RedoB.Hint := sFRDesignerFormRedo;
ZB1.Hint := sFRDesignerFormBring; ZB1.Hint := sFRDesignerFormBring;
ZB2.Hint := sFRDesignerFormBack; ZB2.Hint := sFRDesignerFormBack;
SelAllB.Hint := sFRDesignerFormSelectAll; SelAllB.Hint := sFRDesignerFormSelectAll;
@ -3150,8 +3155,6 @@ begin
N39.Caption := sFRDesignerForm_preview; N39.Caption := sFRDesignerForm_preview;
N10.Caption := sFRDesignerForm_Exit; N10.Caption := sFRDesignerForm_Exit;
EditMenu.Caption := sFRDesignerForm_Edit2; EditMenu.Caption := sFRDesignerForm_Edit2;
N46.Caption := sFRDesignerForm_Undo;
N48.Caption := sFRDesignerForm_Redo;
N11.Caption := sFRDesignerForm_Cut; N11.Caption := sFRDesignerForm_Cut;
N12.Caption := sFRDesignerForm_Copy; N12.Caption := sFRDesignerForm_Copy;
N13.Caption := sFRDesignerForm_Paste; N13.Caption := sFRDesignerForm_Paste;
@ -3204,6 +3207,16 @@ begin
end; end;
end; end;
procedure TfrDesignerForm.edtRedoExecute(Sender: TObject);
begin
Undo(@FRedoBuffer);
end;
procedure TfrDesignerForm.edtUndoExecute(Sender: TObject);
begin
Undo(@FUndoBuffer);
end;
procedure TfrDesignerForm.FileBeforePrintScriptExecute(Sender: TObject); procedure TfrDesignerForm.FileBeforePrintScriptExecute(Sender: TObject);
begin begin
EditorForm.View := nil; EditorForm.View := nil;
@ -3878,7 +3891,8 @@ begin
t := TfrView(Objects[i]); t := TfrView(Objects[i]);
if (t.Selected) and not (lrrDontDelete in T.Restrictions) and not (doChildComponent in T.DesignOptions) then if (t.Selected) and not (lrrDontDelete in T.Restrictions) and not (doChildComponent in T.DesignOptions) then
begin begin
ClipBd.Add(frCreateObject(t.Typ, t.ClassName, Page)); // ClipBd.Add(frCreateObject(t.Typ, t.ClassName, Page));
ClipBd.Add(frCreateObject(t.Typ, t.ClassName, nil));
TfrView(ClipBd.Last).Assign(t); TfrView(ClipBd.Last).Assign(t);
end; end;
end; end;
@ -5402,15 +5416,13 @@ end;
procedure TfrDesignerForm.ClearUndoBuffer; procedure TfrDesignerForm.ClearUndoBuffer;
begin begin
ClearBuffer(FUndoBuffer, FUndoBufferLength); ClearBuffer(FUndoBuffer, FUndoBufferLength);
N46.Enabled := False; edtUndo.Enabled := False;
UndoB.Enabled := N46.Enabled;
end; end;
procedure TfrDesignerForm.ClearRedoBuffer; procedure TfrDesignerForm.ClearRedoBuffer;
begin begin
ClearBuffer(FRedoBuffer, FRedoBufferLength); ClearBuffer(FRedoBuffer, FRedoBufferLength);
N48.Enabled := False; edtRedo.Enabled := False;
RedoB.Enabled := N48.Enabled;
end; end;
procedure TfrDesignerForm.Undo(Buffer: PfrUndoBuffer); procedure TfrDesignerForm.Undo(Buffer: PfrUndoBuffer);
@ -5485,10 +5497,8 @@ begin
ResetSelection; ResetSelection;
PageView.Invalidate; PageView.Invalidate;
N46.Enabled := FUndoBufferLength > 0; edtUndo.Enabled := FUndoBufferLength > 0;
UndoB.Enabled := N46.Enabled; edtRedo.Enabled := FRedoBufferLength > 0;
N48.Enabled := FRedoBufferLength > 0;
RedoB.Enabled := N48.Enabled;
end; end;
procedure TfrDesignerForm.AddAction(Buffer: PfrUndoBuffer; a: TfrUndoAction; List: TFpList); procedure TfrDesignerForm.AddAction(Buffer: PfrUndoBuffer; a: TfrUndoAction; List: TFpList);
@ -5549,14 +5559,12 @@ begin
if Buffer = @FUndoBuffer then if Buffer = @FUndoBuffer then
begin begin
FUndoBufferLength := BufferLength + 1; FUndoBufferLength := BufferLength + 1;
N46.Enabled := True; edtUndo.Enabled := True;
UndoB.Enabled := True;
end end
else else
begin begin
FRedoBufferLength := BufferLength + 1; FRedoBufferLength := BufferLength + 1;
N48.Enabled := True; edtRedo.Enabled := True;
RedoB.Enabled := True;
end; end;
Modified := True; Modified := True;
//FileModified := True; //FileModified := True;
@ -5722,6 +5730,8 @@ procedure TfrDesignerForm.PstBClick(Sender: TObject); //paste
var var
i, minx, miny: Integer; i, minx, miny: Integer;
t, t1: TfrView; t, t1: TfrView;
S: String;
P: TObject;
begin begin
Unselect; Unselect;
SelNum := 0; SelNum := 0;
@ -5760,16 +5770,6 @@ begin
AddUndoAction(acInsert); AddUndoAction(acInsert);
end; end;
procedure TfrDesignerForm.UndoBClick(Sender: TObject); // undo
begin
Undo(@FUndoBuffer);
end;
procedure TfrDesignerForm.RedoBClick(Sender: TObject); // redo
begin
Undo(@FRedoBuffer);
end;
procedure TfrDesignerForm.SelAllBClick(Sender: TObject); // select all procedure TfrDesignerForm.SelAllBClick(Sender: TObject); // select all
begin begin
PageView.NPEraseSelection; PageView.NPEraseSelection;
@ -6450,8 +6450,6 @@ begin
// SetMenuItemBitmap(N39, FileBtn4); // SetMenuItemBitmap(N39, FileBtn4);
SetMenuItemBitmap(N10, ExitB); SetMenuItemBitmap(N10, ExitB);
SetMenuItemBitmap(N46, UndoB);
SetMenuItemBitmap(N48, RedoB);
SetMenuItemBitmap(N11, CutB); SetMenuItemBitmap(N11, CutB);
SetMenuItemBitmap(N12, CopyB); SetMenuItemBitmap(N12, CopyB);
SetMenuItemBitmap(N13, PstB); SetMenuItemBitmap(N13, PstB);