From 8374bc2fee93c6556521c69a00dd82029548418a Mon Sep 17 00:00:00 2001 From: Mark van Renswoude Date: Mon, 14 Mar 2005 19:17:34 +0000 Subject: [PATCH] Fixed: form position is not changed when no settings are available yet --- X2UtSettingsForm.pas | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/X2UtSettingsForm.pas b/X2UtSettingsForm.pas index d1f0b4a..e4a8ae0 100644 --- a/X2UtSettingsForm.pas +++ b/X2UtSettingsForm.pas @@ -26,15 +26,18 @@ procedure ReadFormPos(const AFactory: TX2SettingsFactory; begin with AFactory[ASection] do try - if ReadBool('Maximized', (AForm.WindowState = wsMaximized)) then - AForm.WindowState := wsMaximized - else with THackCustomForm(AForm) do begin - WindowState := wsNormal; - Position := poDefaultPosOnly; - Left := ReadInteger('Left', Left); - Top := ReadInteger('Top', Top); - Width := ReadInteger('Width', Width); - Height := ReadInteger('Height', Height); + if ValueExists('Left') then + begin + if ReadBool('Maximized', (AForm.WindowState = wsMaximized)) then + AForm.WindowState := wsMaximized + else with THackCustomForm(AForm) do begin + WindowState := wsNormal; + Position := poDesigned; + Left := ReadInteger('Left', Left); + Top := ReadInteger('Top', Top); + Width := ReadInteger('Width', Width); + Height := ReadInteger('Height', Height); + end; end; finally Free();