1
0
mirror of synced 2024-09-19 17:56:09 +00:00

Fixed: form position is not changed when no settings are available yet

This commit is contained in:
Mark van Renswoude 2005-03-14 19:17:34 +00:00
parent 396934b857
commit 8374bc2fee

View File

@ -26,16 +26,19 @@ procedure ReadFormPos(const AFactory: TX2SettingsFactory;
begin begin
with AFactory[ASection] do with AFactory[ASection] do
try try
if ValueExists('Left') then
begin
if ReadBool('Maximized', (AForm.WindowState = wsMaximized)) then if ReadBool('Maximized', (AForm.WindowState = wsMaximized)) then
AForm.WindowState := wsMaximized AForm.WindowState := wsMaximized
else with THackCustomForm(AForm) do begin else with THackCustomForm(AForm) do begin
WindowState := wsNormal; WindowState := wsNormal;
Position := poDefaultPosOnly; Position := poDesigned;
Left := ReadInteger('Left', Left); Left := ReadInteger('Left', Left);
Top := ReadInteger('Top', Top); Top := ReadInteger('Top', Top);
Width := ReadInteger('Width', Width); Width := ReadInteger('Width', Width);
Height := ReadInteger('Height', Height); Height := ReadInteger('Height', Height);
end; end;
end;
finally finally
Free(); Free();
end; end;