mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-19 16:40:54 +02:00
LazReport: In the Designer Save the last used directories for Save/Load reports, issue #28770
git-svn-id: trunk@52723 -
This commit is contained in:
parent
8f08f44148
commit
7377deb632
@ -540,6 +540,8 @@ type
|
|||||||
fCurDocFileType: Integer;
|
fCurDocFileType: Integer;
|
||||||
ShapeMode: TfrShapeMode;
|
ShapeMode: TfrShapeMode;
|
||||||
FReportPopupPoint: TPoint;
|
FReportPopupPoint: TPoint;
|
||||||
|
FLastOpenDirectory: string;
|
||||||
|
FLastSaveDirectory: string;
|
||||||
|
|
||||||
{$IFDEF StdOI}
|
{$IFDEF StdOI}
|
||||||
ObjInsp : TObjectInspector;
|
ObjInsp : TObjectInspector;
|
||||||
@ -3274,7 +3276,15 @@ begin
|
|||||||
Filter := sFormFile + ' (*.frf)|*.frf|' +
|
Filter := sFormFile + ' (*.frf)|*.frf|' +
|
||||||
sLazFormFile + ' (*.lrf)|*.lrf' +
|
sLazFormFile + ' (*.lrf)|*.lrf' +
|
||||||
'';
|
'';
|
||||||
InitialDir:=ExtractFilePath(ParamStrUTF8(0));
|
if InitialDir='' then
|
||||||
|
begin
|
||||||
|
InitialDir := FLastOpenDirectory;
|
||||||
|
if InitialDir='' then
|
||||||
|
InitialDir := FLastSaveDirectory;
|
||||||
|
if InitialDir='' then
|
||||||
|
InitialDir:=ExtractFilePath(ParamStrUTF8(0));
|
||||||
|
end;
|
||||||
|
|
||||||
FileName := CurDocName;
|
FileName := CurDocName;
|
||||||
FilterIndex := 2;
|
FilterIndex := 2;
|
||||||
if Execute then
|
if Execute then
|
||||||
@ -3284,11 +3294,13 @@ begin
|
|||||||
case FilterIndex of
|
case FilterIndex of
|
||||||
1: // fastreport form format
|
1: // fastreport form format
|
||||||
begin
|
begin
|
||||||
|
FLastOpenDirectory := ExtractFilePath(CurDocName);
|
||||||
CurReport.LoadFromFile(CurDocName);
|
CurReport.LoadFromFile(CurDocName);
|
||||||
FCurDocFileType := dtFastReportForm;
|
FCurDocFileType := dtFastReportForm;
|
||||||
end;
|
end;
|
||||||
2: // lasreport form xml format
|
2: // lasreport form xml format
|
||||||
begin
|
begin
|
||||||
|
FLastOpenDirectory := ExtractFilePath(CurDocName);
|
||||||
CurReport.LoadFromXMLFile(CurDocName);
|
CurReport.LoadFromXMLFile(CurDocName);
|
||||||
FCurDocFileType := dtLazReportForm;
|
FCurDocFileType := dtLazReportForm;
|
||||||
end;
|
end;
|
||||||
@ -3404,12 +3416,22 @@ begin
|
|||||||
sTemplFile + ' (*.frt)|*.frt|' +
|
sTemplFile + ' (*.frt)|*.frt|' +
|
||||||
sLazFormFile + ' (*.lrf)|*.lrf|' +
|
sLazFormFile + ' (*.lrf)|*.lrf|' +
|
||||||
sLazTemplateFile + ' (*.lrt)|*.lrt';
|
sLazTemplateFile + ' (*.lrt)|*.lrt';
|
||||||
|
|
||||||
if InitialDir='' then
|
if InitialDir='' then
|
||||||
InitialDir:=ExtractFilePath(ParamStrUTF8(0));
|
begin
|
||||||
|
InitialDir := FLastSaveDirectory;
|
||||||
|
if InitialDir='' then
|
||||||
|
InitialDir := FLastOpenDirectory;
|
||||||
|
if InitialDir='' then
|
||||||
|
InitialDir:=ExtractFilePath(ParamStrUTF8(0));
|
||||||
|
end;
|
||||||
FileName := CurDocName;
|
FileName := CurDocName;
|
||||||
FilterIndex := 3;
|
FilterIndex := 3;
|
||||||
if Execute then
|
if Execute then
|
||||||
|
begin
|
||||||
|
FLastSaveDirectory := ExtractFilePath(Filename);
|
||||||
FCurDocFileType := FilterIndex;
|
FCurDocFileType := FilterIndex;
|
||||||
|
end;
|
||||||
case FCurDocFileType of
|
case FCurDocFileType of
|
||||||
dtFastReportForm:
|
dtFastReportForm:
|
||||||
begin
|
begin
|
||||||
@ -6500,6 +6522,8 @@ begin
|
|||||||
Ini.WriteBool('frEditorForm', rsEdit, EditAfterInsert);
|
Ini.WriteBool('frEditorForm', rsEdit, EditAfterInsert);
|
||||||
Ini.WriteInteger('frEditorForm', rsSelection, Integer(ShapeMode));
|
Ini.WriteInteger('frEditorForm', rsSelection, Integer(ShapeMode));
|
||||||
Ini.WriteBool('frEditorForm', 'UseInplaceEditor', edtUseIE);
|
Ini.WriteBool('frEditorForm', 'UseInplaceEditor', edtUseIE);
|
||||||
|
Ini.WriteString('frEditorForm', 'LastOpenDirectory', FLastOpenDirectory);
|
||||||
|
Ini.WriteString('frEditorForm', 'LastSaveDirectory', FLastSaveDirectory);
|
||||||
|
|
||||||
DoSaveToolbars([Panel1, Panel2, Panel3, Panel4, Panel5, Panel6]);
|
DoSaveToolbars([Panel1, Panel2, Panel3, Panel4, Panel5, Panel6]);
|
||||||
|
|
||||||
@ -6547,6 +6571,8 @@ begin
|
|||||||
EditAfterInsert := Ini.ReadBool('frEditorForm', rsEdit, True);
|
EditAfterInsert := Ini.ReadBool('frEditorForm', rsEdit, True);
|
||||||
ShapeMode := TfrShapeMode(Ini.ReadInteger('frEditorForm', rsSelection, 1));
|
ShapeMode := TfrShapeMode(Ini.ReadInteger('frEditorForm', rsSelection, 1));
|
||||||
edtUseIE:=Ini.ReadBool('frEditorForm', 'UseInplaceEditor', edtUseIE);
|
edtUseIE:=Ini.ReadBool('frEditorForm', 'UseInplaceEditor', edtUseIE);
|
||||||
|
FLastOpenDirectory := Ini.ReadString('frEditorForm', 'LastOpenDirectory', '');
|
||||||
|
FLastSaveDirectory := Ini.ReadString('frEditorForm', 'LastSaveDirectory', '');
|
||||||
|
|
||||||
ObjInsp.Left:=Ini.ReadInteger('ObjInsp', 'Left', ObjInsp.Left);
|
ObjInsp.Left:=Ini.ReadInteger('ObjInsp', 'Left', ObjInsp.Left);
|
||||||
ObjInsp.Top:=Ini.ReadInteger('ObjInsp', 'Top', ObjInsp.Top);
|
ObjInsp.Top:=Ini.ReadInteger('ObjInsp', 'Top', ObjInsp.Top);
|
||||||
|
Loading…
Reference in New Issue
Block a user