mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-13 21:48:42 +02:00
PoChecker:
- save and restore WindowaSate of individual forms. - better anchoring of controls on PoCheckerMainForm - removed some debugln statements git-svn-id: trunk@46435 -
This commit is contained in:
parent
3ebbc96fd0
commit
192f1c46b5
@ -95,6 +95,7 @@ begin
|
|||||||
FOldHintHidePause := Application.HintHidePause;
|
FOldHintHidePause := Application.HintHidePause;
|
||||||
Application.HintHidePause := 5000;
|
Application.HintHidePause := 5000;
|
||||||
LoadConfig;
|
LoadConfig;
|
||||||
|
WindowState := Settings.GraphFormWindowState;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TGraphStatForm.ListViewMouseMove(Sender: TObject; Shift: TShiftState;
|
procedure TGraphStatForm.ListViewMouseMove(Sender: TObject; Shift: TShiftState;
|
||||||
@ -164,7 +165,11 @@ procedure TGraphStatForm.SaveConfig;
|
|||||||
begin
|
begin
|
||||||
//debugln('TGraphStatForm.SaveConfig: BoundsRect = ',dbgs(BoundsRect));
|
//debugln('TGraphStatForm.SaveConfig: BoundsRect = ',dbgs(BoundsRect));
|
||||||
if not Assigned(FSettings) then Exit;
|
if not Assigned(FSettings) then Exit;
|
||||||
Settings.GraphFormGeometry := BoundsRect;
|
Settings.GraphFormWindowState := WindowState;
|
||||||
|
if (WindowState = wsNormal) then
|
||||||
|
Settings.GraphFormGeometry := BoundsRect
|
||||||
|
else
|
||||||
|
Settings.GraphFormGeometry := Rect(RestoredLeft, RestoredTop, RestoredLeft + RestoredWidth, RestoredTop + RestoredHeight);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TGraphStatForm.FormCreate(Sender: TObject);
|
procedure TGraphStatForm.FormCreate(Sender: TObject);
|
||||||
|
@ -11,6 +11,7 @@ object PoCheckerForm: TPoCheckerForm
|
|||||||
Constraints.MinWidth = 600
|
Constraints.MinWidth = 600
|
||||||
OnCreate = FormCreate
|
OnCreate = FormCreate
|
||||||
OnDestroy = FormDestroy
|
OnDestroy = FormDestroy
|
||||||
|
OnShow = FormShow
|
||||||
ShowInTaskBar = stAlways
|
ShowInTaskBar = stAlways
|
||||||
LCLVersion = '1.3'
|
LCLVersion = '1.3'
|
||||||
Visible = True
|
Visible = True
|
||||||
@ -18,10 +19,10 @@ object PoCheckerForm: TPoCheckerForm
|
|||||||
AnchorSideLeft.Control = SelectTestLabel
|
AnchorSideLeft.Control = SelectTestLabel
|
||||||
AnchorSideTop.Control = SelectTestLabel
|
AnchorSideTop.Control = SelectTestLabel
|
||||||
AnchorSideTop.Side = asrBottom
|
AnchorSideTop.Side = asrBottom
|
||||||
Left = 212
|
Left = 201
|
||||||
Height = 118
|
Height = 118
|
||||||
Top = 29
|
Top = 29
|
||||||
Width = 425
|
Width = 436
|
||||||
Anchors = [akTop, akLeft, akRight]
|
Anchors = [akTop, akLeft, akRight]
|
||||||
BorderSpacing.Top = 6
|
BorderSpacing.Top = 6
|
||||||
Enabled = False
|
Enabled = False
|
||||||
@ -42,7 +43,7 @@ object PoCheckerForm: TPoCheckerForm
|
|||||||
object SelectTestLabel: TLabel
|
object SelectTestLabel: TLabel
|
||||||
AnchorSideLeft.Control = OpenBtn
|
AnchorSideLeft.Control = OpenBtn
|
||||||
AnchorSideLeft.Side = asrBottom
|
AnchorSideLeft.Side = asrBottom
|
||||||
Left = 212
|
Left = 201
|
||||||
Height = 15
|
Height = 15
|
||||||
Top = 8
|
Top = 8
|
||||||
Width = 93
|
Width = 93
|
||||||
@ -53,16 +54,15 @@ object PoCheckerForm: TPoCheckerForm
|
|||||||
ParentFont = False
|
ParentFont = False
|
||||||
end
|
end
|
||||||
object OpenBtn: TBitBtn
|
object OpenBtn: TBitBtn
|
||||||
AnchorSideLeft.Control = RunBtn
|
AnchorSideLeft.Control = MasterPoListBox
|
||||||
AnchorSideTop.Control = TestListBox
|
AnchorSideTop.Control = TestListBox
|
||||||
AnchorSideRight.Control = RunBtn
|
AnchorSideRight.Control = RunBtn
|
||||||
AnchorSideRight.Side = asrBottom
|
AnchorSideRight.Side = asrBottom
|
||||||
AnchorSideBottom.Control = ScanDirBtn
|
AnchorSideBottom.Control = ScanDirBtn
|
||||||
Left = 19
|
Left = 8
|
||||||
Height = 50
|
Height = 50
|
||||||
Top = 29
|
Top = 29
|
||||||
Width = 184
|
Width = 184
|
||||||
Anchors = [akTop]
|
|
||||||
BorderSpacing.Bottom = 10
|
BorderSpacing.Bottom = 10
|
||||||
Caption = '&Open a po-file'
|
Caption = '&Open a po-file'
|
||||||
Glyph.Data = {
|
Glyph.Data = {
|
||||||
@ -105,14 +105,14 @@ object PoCheckerForm: TPoCheckerForm
|
|||||||
TabOrder = 1
|
TabOrder = 1
|
||||||
end
|
end
|
||||||
object RunBtn: TBitBtn
|
object RunBtn: TBitBtn
|
||||||
|
AnchorSideLeft.Control = OpenBtn
|
||||||
AnchorSideTop.Control = ScanDirBtn
|
AnchorSideTop.Control = ScanDirBtn
|
||||||
AnchorSideTop.Side = asrBottom
|
AnchorSideTop.Side = asrBottom
|
||||||
AnchorSideRight.Side = asrBottom
|
AnchorSideRight.Side = asrBottom
|
||||||
Left = 19
|
Left = 8
|
||||||
Height = 50
|
Height = 50
|
||||||
Top = 149
|
Top = 149
|
||||||
Width = 184
|
Width = 184
|
||||||
Anchors = [akTop]
|
|
||||||
BorderSpacing.Top = 5
|
BorderSpacing.Top = 5
|
||||||
Caption = '&Run Selected Tests'
|
Caption = '&Run Selected Tests'
|
||||||
Enabled = False
|
Enabled = False
|
||||||
@ -137,7 +137,7 @@ object PoCheckerForm: TPoCheckerForm
|
|||||||
AnchorSideLeft.Control = TestListBox
|
AnchorSideLeft.Control = TestListBox
|
||||||
AnchorSideTop.Control = SelectBasicBtn
|
AnchorSideTop.Control = SelectBasicBtn
|
||||||
AnchorSideTop.Side = asrBottom
|
AnchorSideTop.Side = asrBottom
|
||||||
Left = 212
|
Left = 201
|
||||||
Height = 19
|
Height = 19
|
||||||
Top = 184
|
Top = 184
|
||||||
Width = 156
|
Width = 156
|
||||||
@ -149,7 +149,7 @@ object PoCheckerForm: TPoCheckerForm
|
|||||||
AnchorSideLeft.Control = TestListBox
|
AnchorSideLeft.Control = TestListBox
|
||||||
AnchorSideTop.Control = TestListBox
|
AnchorSideTop.Control = TestListBox
|
||||||
AnchorSideTop.Side = asrBottom
|
AnchorSideTop.Side = asrBottom
|
||||||
Left = 212
|
Left = 201
|
||||||
Height = 25
|
Height = 25
|
||||||
Top = 153
|
Top = 153
|
||||||
Width = 115
|
Width = 115
|
||||||
@ -163,7 +163,7 @@ object PoCheckerForm: TPoCheckerForm
|
|||||||
AnchorSideLeft.Control = SelectBasicBtn
|
AnchorSideLeft.Control = SelectBasicBtn
|
||||||
AnchorSideLeft.Side = asrBottom
|
AnchorSideLeft.Side = asrBottom
|
||||||
AnchorSideTop.Control = SelectBasicBtn
|
AnchorSideTop.Control = SelectBasicBtn
|
||||||
Left = 331
|
Left = 320
|
||||||
Height = 25
|
Height = 25
|
||||||
Top = 153
|
Top = 153
|
||||||
Width = 115
|
Width = 115
|
||||||
@ -177,7 +177,7 @@ object PoCheckerForm: TPoCheckerForm
|
|||||||
AnchorSideLeft.Control = SelectAllBtn
|
AnchorSideLeft.Control = SelectAllBtn
|
||||||
AnchorSideLeft.Side = asrBottom
|
AnchorSideLeft.Side = asrBottom
|
||||||
AnchorSideTop.Control = SelectAllBtn
|
AnchorSideTop.Control = SelectAllBtn
|
||||||
Left = 450
|
Left = 439
|
||||||
Height = 25
|
Height = 25
|
||||||
Top = 153
|
Top = 153
|
||||||
Width = 115
|
Width = 115
|
||||||
@ -191,7 +191,7 @@ object PoCheckerForm: TPoCheckerForm
|
|||||||
AnchorSideLeft.Control = TestListBox
|
AnchorSideLeft.Control = TestListBox
|
||||||
AnchorSideTop.Control = FindAllPOsCheckBox
|
AnchorSideTop.Control = FindAllPOsCheckBox
|
||||||
AnchorSideTop.Side = asrBottom
|
AnchorSideTop.Side = asrBottom
|
||||||
Left = 212
|
Left = 201
|
||||||
Height = 19
|
Height = 19
|
||||||
Top = 209
|
Top = 209
|
||||||
Width = 152
|
Width = 152
|
||||||
@ -213,11 +213,10 @@ object PoCheckerForm: TPoCheckerForm
|
|||||||
AnchorSideRight.Control = RunBtn
|
AnchorSideRight.Control = RunBtn
|
||||||
AnchorSideRight.Side = asrBottom
|
AnchorSideRight.Side = asrBottom
|
||||||
AnchorSideBottom.Control = RunBtn
|
AnchorSideBottom.Control = RunBtn
|
||||||
Left = 19
|
Left = 8
|
||||||
Height = 50
|
Height = 50
|
||||||
Top = 89
|
Top = 89
|
||||||
Width = 184
|
Width = 184
|
||||||
Anchors = [akTop]
|
|
||||||
BorderSpacing.Top = 5
|
BorderSpacing.Top = 5
|
||||||
BorderSpacing.Bottom = 10
|
BorderSpacing.Bottom = 10
|
||||||
Caption = 'Scan a folder'
|
Caption = 'Scan a folder'
|
||||||
|
@ -53,6 +53,7 @@ type
|
|||||||
procedure ChildPoListBoxSelectionChange(Sender: TObject; User: boolean);
|
procedure ChildPoListBoxSelectionChange(Sender: TObject; User: boolean);
|
||||||
procedure ClearChildBtnClick(Sender: TObject);
|
procedure ClearChildBtnClick(Sender: TObject);
|
||||||
procedure ClearMasterBtnClick(Sender: TObject);
|
procedure ClearMasterBtnClick(Sender: TObject);
|
||||||
|
procedure FormShow(Sender: TObject);
|
||||||
procedure LangFilterChange(Sender: TObject);
|
procedure LangFilterChange(Sender: TObject);
|
||||||
procedure MasterPoListBoxDrawItem(Control: TWinControl; Index: Integer;
|
procedure MasterPoListBoxDrawItem(Control: TWinControl; Index: Integer;
|
||||||
ARect: TRect; State: TOwnerDrawState);
|
ARect: TRect; State: TOwnerDrawState);
|
||||||
@ -316,6 +317,11 @@ begin
|
|||||||
SetSelectedPoName('');
|
SetSelectedPoName('');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TPoCheckerForm.FormShow(Sender: TObject);
|
||||||
|
begin
|
||||||
|
WindowState := FPoCheckerSettings.MainFormWindowState;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TPoCheckerForm.MasterPoListBoxDrawItem(Control: TWinControl;
|
procedure TPoCheckerForm.MasterPoListBoxDrawItem(Control: TWinControl;
|
||||||
Index: Integer; ARect: TRect; State: TOwnerDrawState);
|
Index: Integer; ARect: TRect; State: TOwnerDrawState);
|
||||||
var
|
var
|
||||||
@ -749,11 +755,6 @@ begin
|
|||||||
ARect := FitToRect(ARect, Screen.WorkAreaRect);
|
ARect := FitToRect(ARect, Screen.WorkAreaRect);
|
||||||
BoundsRect := ARect;
|
BoundsRect := ARect;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
//DebugLn(' TestOptions after loading = ');
|
|
||||||
//DebugLn(' ',DbgS(FPoCheckerSettings.TestOptions));
|
|
||||||
//debugln(' TPoCheckerForm.FormCreate: TestTypes after loading = ');
|
|
||||||
//DebugLn(' ',DbgS(FPoCheckerSettings.TestTypes));
|
|
||||||
SetTestTypeCheckBoxes(FPoCheckerSettings.TestTypes);
|
SetTestTypeCheckBoxes(FPoCheckerSettings.TestTypes);
|
||||||
SetTestOptionCheckBoxes(FPoCheckerSettings.TestOptions);
|
SetTestOptionCheckBoxes(FPoCheckerSettings.TestOptions);
|
||||||
SelectDirectoryDialog.Filename := FPoCheckerSettings.SelectDirectoryFilename;
|
SelectDirectoryDialog.Filename := FPoCheckerSettings.SelectDirectoryFilename;
|
||||||
@ -780,7 +781,11 @@ begin
|
|||||||
FPoCheckerSettings.OpenDialogFilename := OpenDialog.FileName;
|
FPoCheckerSettings.OpenDialogFilename := OpenDialog.FileName;
|
||||||
FPoCheckerSettings.TestTypes := GetTestTypesFromListBox;
|
FPoCheckerSettings.TestTypes := GetTestTypesFromListBox;
|
||||||
FPoCheckerSettings.TestOptions := GetTestOptions;
|
FPoCheckerSettings.TestOptions := GetTestOptions;
|
||||||
FPoCheckerSettings.MainFormGeometry := BoundsRect;
|
FPoCheckerSettings.MainFormWindowState := WindowState;
|
||||||
|
if (WindowState = wsNormal) then
|
||||||
|
FPoCheckerSettings.MainFormGeometry := BoundsRect
|
||||||
|
else
|
||||||
|
FPoCheckerSettings.MainFormGeometry := Rect(RestoredLeft, RestoredTop, RestoredLeft + RestoredWidth, RestoredTop + RestoredHeight);
|
||||||
FPoCheckerSettings.MasterPoList := MasterPoListBox.Items;
|
FPoCheckerSettings.MasterPoList := MasterPoListBox.Items;
|
||||||
FPoCheckerSettings.ChildPoList := FChildPoList;
|
FPoCheckerSettings.ChildPoList := FChildPoList;
|
||||||
FPoCheckerSettings.SaveConfig;
|
FPoCheckerSettings.SaveConfig;
|
||||||
|
@ -5,9 +5,9 @@ unit PoCheckerSettings;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
Classes, SysUtils, LazConfigStorage,
|
Classes, SysUtils, LazConfigStorage, Forms,
|
||||||
{$ifdef POCHECKERSTANDALONE}
|
{$ifdef POCHECKERSTANDALONE}
|
||||||
PoCheckerXMLConfig, Forms,
|
PoCheckerXMLConfig,
|
||||||
{$else}
|
{$else}
|
||||||
BaseIDEIntf,
|
BaseIDEIntf,
|
||||||
{$endif}
|
{$endif}
|
||||||
@ -22,7 +22,10 @@ type
|
|||||||
FConfig: TConfigStorage;
|
FConfig: TConfigStorage;
|
||||||
FExternalEditorName: String;
|
FExternalEditorName: String;
|
||||||
FFilename: String;
|
FFilename: String;
|
||||||
|
FGraphFormWindowState: TWindowState;
|
||||||
|
FMainFormWindowState: TWindowState;
|
||||||
FOpenDialogFilename: String;
|
FOpenDialogFilename: String;
|
||||||
|
FResultsFormWindowState: TWindowState;
|
||||||
FSelectDirectoryFilename: String;
|
FSelectDirectoryFilename: String;
|
||||||
FTestTypes: TPoTestTypes;
|
FTestTypes: TPoTestTypes;
|
||||||
FTestOptions: TPoTestOptions;
|
FTestOptions: TPoTestOptions;
|
||||||
@ -77,6 +80,9 @@ type
|
|||||||
property MainFormGeometry: TRect read FMainFormGeometry write FMainFormGeometry;
|
property MainFormGeometry: TRect read FMainFormGeometry write FMainFormGeometry;
|
||||||
property ResultsFormGeometry: TRect read FResultsFormGeometry write FResultsFormGeometry;
|
property ResultsFormGeometry: TRect read FResultsFormGeometry write FResultsFormGeometry;
|
||||||
property GraphFormGeometry: TRect read FGraphFormGeometry write FGraphFormGeometry;
|
property GraphFormGeometry: TRect read FGraphFormGeometry write FGraphFormGeometry;
|
||||||
|
property MainFormWindowState: TWindowState read FMainFormWindowState write FMainFormWindowState;
|
||||||
|
property ResultsFormWindowState: TWindowState read FResultsFormWindowState write FResultsFormWindowState;
|
||||||
|
property GraphFormWindowState: TWindowState read FGraphFormWindowState write FGraphFormWindowState;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function DbgS(PoTestTypes: TPoTestTypes): String; overload;
|
function DbgS(PoTestTypes: TPoTestTypes): String; overload;
|
||||||
@ -273,10 +279,20 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TPoCheckerSettings.LoadWindowsGeometry;
|
procedure TPoCheckerSettings.LoadWindowsGeometry;
|
||||||
|
function IntToWindowState(WSInt: Integer): TWindowState;
|
||||||
|
begin
|
||||||
|
if (WSInt in [Ord(Low(TWindowState))..Ord(High(TWindowState))]) then
|
||||||
|
Result := TWindowState(WSInt)
|
||||||
|
else
|
||||||
|
Result := wsNormal;
|
||||||
|
end;
|
||||||
begin
|
begin
|
||||||
FConfig.GetValue(pWindowsGeometry+'MainForm/Value',FMainFormGeometry,DefaultRect);
|
FConfig.GetValue(pWindowsGeometry+'MainForm/Value',FMainFormGeometry,DefaultRect);
|
||||||
|
FMainFormWindowState := IntToWindowState(FConfig.GetValue(pWindowsGeometry+'MainForm/WindowState/Value', Ord(wsNormal)));
|
||||||
FConfig.GetValue(pWindowsGeometry+'ResultsForm/Value',FResultsFormGeometry,DefaultRect);
|
FConfig.GetValue(pWindowsGeometry+'ResultsForm/Value',FResultsFormGeometry,DefaultRect);
|
||||||
|
FResultsFormWindowState := IntToWindowState(FConfig.GetValue(pWindowsGeometry+'MainForm/WindowState/Value', Ord(wsNormal)));
|
||||||
FConfig.GetValue(pWindowsGeometry+'GraphForm/Value',FGraphFormGeometry,DefaultRect);
|
FConfig.GetValue(pWindowsGeometry+'GraphForm/Value',FGraphFormGeometry,DefaultRect);
|
||||||
|
FGraphFormWindowState := IntToWindowState(FConfig.GetValue(pWindowsGeometry+'MainForm/WindowState/Value', Ord(wsNormal)));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TPoCheckerSettings.LoadExternalEditorName: String;
|
function TPoCheckerSettings.LoadExternalEditorName: String;
|
||||||
@ -365,8 +381,11 @@ end;
|
|||||||
procedure TPoCheckerSettings.SaveWindowsGeometry;
|
procedure TPoCheckerSettings.SaveWindowsGeometry;
|
||||||
begin
|
begin
|
||||||
FConfig.SetDeleteValue(pWindowsGeometry+'MainForm/Value',FMainFormGeometry,DefaultRect);
|
FConfig.SetDeleteValue(pWindowsGeometry+'MainForm/Value',FMainFormGeometry,DefaultRect);
|
||||||
|
FConfig.SetDeleteValue(pWindowsGeometry+'MainForm/WindowState/Value',Ord(FMainFormWindowState), Ord(wsNormal));
|
||||||
FConfig.SetDeleteValue(pWindowsGeometry+'ResultsForm/Value',FResultsFormGeometry,DefaultRect);
|
FConfig.SetDeleteValue(pWindowsGeometry+'ResultsForm/Value',FResultsFormGeometry,DefaultRect);
|
||||||
|
FConfig.SetDeleteValue(pWindowsGeometry+'ResultsForm/WindowState/Value',Ord(FResultsFormWindowState), Ord(wsNormal));
|
||||||
FConfig.SetDeleteValue(pWindowsGeometry+'GraphForm/Value',FGraphFormGeometry,DefaultRect);
|
FConfig.SetDeleteValue(pWindowsGeometry+'GraphForm/Value',FGraphFormGeometry,DefaultRect);
|
||||||
|
FConfig.SetDeleteValue(pWindowsGeometry+'GraphForm/WindowState/Value',Ord(FGraphFormWindowState), Ord(wsNormal));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TPoCheckerSettings.SaveExternalEditorName;
|
procedure TPoCheckerSettings.SaveExternalEditorName;
|
||||||
|
@ -96,6 +96,7 @@ begin
|
|||||||
LogMemo.Lines.Assign(FLog);
|
LogMemo.Lines.Assign(FLog);
|
||||||
GraphStatBtn.Visible := (PoFamilyStats <> nil) and (PoFamilyStats.Count > 0);
|
GraphStatBtn.Visible := (PoFamilyStats <> nil) and (PoFamilyStats.Count > 0);
|
||||||
LoadConfig;
|
LoadConfig;
|
||||||
|
WindowState := Settings.ResultsFormWindowState;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TResultDlgForm.GraphStatBtnClick(Sender: TObject);
|
procedure TResultDlgForm.GraphStatBtnClick(Sender: TObject);
|
||||||
@ -155,7 +156,11 @@ procedure TResultDlgForm.SaveConfig;
|
|||||||
begin
|
begin
|
||||||
//debugln('TResultDlgForm.SaveConfig: BoundsRect = ',dbgs(BoundsRect));
|
//debugln('TResultDlgForm.SaveConfig: BoundsRect = ',dbgs(BoundsRect));
|
||||||
if not Assigned(FSettings) then Exit;
|
if not Assigned(FSettings) then Exit;
|
||||||
Settings.ResultsFormGeometry := BoundsRect;
|
Settings.ResultsFormWindowState := WindowState;
|
||||||
|
if (WindowState = wsNormal) then
|
||||||
|
Settings.ResultsFormGeometry := BoundsRect
|
||||||
|
else
|
||||||
|
Settings.ResultsFormGeometry := Rect(RestoredLeft, RestoredTop, RestoredLeft + RestoredWidth, RestoredTop + RestoredHeight);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
Loading…
Reference in New Issue
Block a user