store of window position didn't reflect common settings

This commit is contained in:
Petr Hlozek 2017-04-14 12:32:06 +02:00
parent 43b965ba35
commit 71a7fd14f6
4 changed files with 11 additions and 55 deletions

View File

@ -19,7 +19,7 @@
<AutoIncrementBuild Value="True"/>
<MinorVersionNr Value="3"/>
<RevisionNr Value="1"/>
<BuildNr Value="2138"/>
<BuildNr Value="2139"/>
<StringTable ProductVersion="0.3.1.2026"/>
</VersionInfo>
<BuildModes Count="1">

View File

@ -189,16 +189,7 @@ end;
procedure TfrmImportLoTWWeb.FormShow(Sender: TObject);
begin
if not cqrini.ReadBool('LoTWImp','Max',False) then
begin
Height := cqrini.ReadInteger('LoTWImp','Height',Height);
Width := cqrini.ReadInteger('LoTWImp','Width',Width);
Top := cqrini.ReadInteger('LoTWImp','Top',top);
Left := cqrini.ReadInteger('LoTWImp','Left',left)
end
else begin
WindowState := wsMaximized
end;
dmUtils.LoadWindowPos(self);
chkShowNew.Checked := cqrini.ReadBool('LoTWImp','ShowNewQSOs',True);
edtDateFrom.Text := cqrini.ReadString('LoTWImp','DateFrom','1990-01-01');
edtCall.Text := cqrini.ReadString('LoTWImp','Call',
@ -209,19 +200,7 @@ end;
procedure TfrmImportLoTWWeb.FormCloseQuery(Sender: TObject;
var CanClose: boolean);
begin
if not (WindowState = wsMaximized) then
begin
cqrini.WriteInteger('LoTWImp','Height',Height);
cqrini.WriteInteger('LoTWImp','Width',Width);
cqrini.WriteInteger('LoTWImp','Top',Top);
cqrini.WriteInteger('LoTWImp','Left',Left);
cqrini.WriteBool('LoTWImp','Max', False);
cqrini.WriteString('LoTWImp','DateFrom',edtDateFrom.Text)
end
else begin
cqrini.WriteBool('LoTWImp','Max', True)
end;
cqrini.WriteBool('LoTWImp','ShowNewQSOs',chkShowNew.Checked)
dmUtils.SaveWindowPos(self)
end;
procedure TfrmImportLoTWWeb.SockCallBack (Sender: TObject; Reason: THookSocketReason; const Value: string);

View File

@ -1578,18 +1578,8 @@ end;
procedure TfrmMain.FormCloseQuery(Sender: TObject; var CanClose: boolean);
begin
dmUtils.SaveForm(frmMain);
if not (WindowState = wsMaximized) then
begin
cqrini.WriteInteger('Main', 'Height', Height);
cqrini.WriteInteger('Main', 'Width', Width);
cqrini.WriteInteger('Main', 'Top', Top);
cqrini.WriteInteger('Main', 'Left', Left);
cqrini.WriteBool('Main', 'Max', False);
if dmData.DebugLevel>1 then Writeln('Saving window size a position (height|width|top|left):',
height,'|',Width,'|',top,'|',left)
end
else
cqrini.WriteBool('Main', 'Max', True);
dmUtils.SaveWindowPos(frmMain);
cqrini.WriteBool('Main', 'Toolbar', toolMain.Visible);
cqrini.WriteBool('Main', 'Buttons', pnlButtons.Visible);
cqrini.WriteBool('Main', 'Details', pnlDetails.Visible);
@ -1909,17 +1899,9 @@ begin
toolMain.Visible := cqrini.ReadBool('Main', 'Toolbar', True);
pnlButtons.Visible := cqrini.ReadBool('Main', 'Buttons', True);
pnlDetails.Visible := cqrini.ReadBool('Main', 'Details', True);
if not cqrini.ReadBool('Main', 'Max', False) then
begin
Height := cqrini.ReadInteger('Main', 'Height', Height);
Width := cqrini.ReadInteger('Main', 'Width', Width);
Top := cqrini.ReadInteger('Main', 'Top', 0);
Left := cqrini.ReadInteger('Main', 'Left', 0);
if dmData.DebugLevel>1 then Writeln('Loading window size a position (height|width|top|left):',
height,'|',Width,'|',top,'|',left)
end
else
WindowState := wsMaximized;
dmUtils.LoadWindowPos(frmMain);
CheckAttachment;
mnuShowButtons.Checked := pnlButtons.Visible;
mnuShowToolBar.Checked := toolMain.Visible

View File

@ -1171,10 +1171,8 @@ begin
sbNewQSO.Panels[3].Text := 'Ver. '+ dmData.VersionString;
sbNewQSO.Panels[3].Width := 60;
Height := cqrini.ReadInteger('NewQSO','Height',Height);
Width := cqrini.ReadInteger('NewQSO','Width',Width);
Top := cqrini.ReadInteger('NewQSO','Top',20);
Left := cqrini.ReadInteger('NewQSO','Left',20);
dmUtils.LoadWindowPos(frmNewQSO);
UseSpaceBar := cqrini.ReadBool('NewQSO','UseSpaceBar',False);
dbgrdQSOBefore.Visible := cqrini.ReadBool('NewQSO','ShowGrd',True);
sbNewQSO.Visible := cqrini.ReadBool('NewQSO','StatBar',True);
@ -5573,10 +5571,7 @@ end;
procedure TfrmNewQSO.SavePosition;
begin
cqrini.WriteInteger('NewQSO','Height',Height);
cqrini.WriteInteger('NewQSO','Width',Width);
cqrini.WriteInteger('NewQSO','Top',Top);
cqrini.WriteInteger('NewQSO','Left',Left);
dmUtils.SaveWindowPos(frmNewQSO);
cqrini.WriteBool('NewQSO','StatBar',sbNewQSO.Visible);
cqrini.SaveToDisk
end;