From f34871b77a75bee9963b2ac45a92bd55aea75f22 Mon Sep 17 00:00:00 2001 From: Jonathan Barnard Date: Mon, 9 Mar 2009 17:19:22 +0000 Subject: [PATCH] UnitMain: No point in moving a button if you can not see it. --- UnitMain.pas | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/UnitMain.pas b/UnitMain.pas index 8948a2d..9f6f9da 100644 --- a/UnitMain.pas +++ b/UnitMain.pas @@ -237,24 +237,25 @@ begin {$IFDEF GuiTest} - Btn_StopScan.Visible := true; + Btn_StopScan.Visible := true; {$ENDIF} end; procedure TForm1.FormResize(Sender: TObject); begin - Btn_StopScan.Left := (floor(form1.Width / 2) - floor(Btn_StopScan.Width / 2)); + if Btn_StopScan.Visible = true then Btn_StopScan.Left := (floor(form1.Width / 2) - floor(Btn_StopScan.Width / 2)); end; procedure TForm1.TimerOnTimer(Sender: TObject); var TempList:Tstrings; begin - { We should not use a timer to check this. The is a bug in lazarus, 'OnTerminate' of AsyncProcess never runs.} + {We should not use a timer to check this. The is a bug in lazarus, 'OnTerminate' of AsyncProcess never runs.} if AsyncProcessScan.Active = true then begin Timer.Enabled := true; Btn_StopScan.Visible := true; + FormResize(self); end else begin -- 2.11.4.GIT