diff --git a/src/forms/forms.main.lfm b/src/forms/forms.main.lfm index aa4dae5..fc9f79e 100644 --- a/src/forms/forms.main.lfm +++ b/src/forms/forms.main.lfm @@ -10,7 +10,6 @@ object frmMain: TfrmMain Menu = mmMain Position = poDefault SessionProperties = 'Top;Left;Width;Height;WindowState;pcMain.ActivePage;edtStartIP.Text;edtEndIP.Text' - LCLVersion = '3.99.0.0' OnCreate = FormCreate OnDestroy = FormDestroy object pcMain: TPageControl @@ -18,13 +17,13 @@ object frmMain: TfrmMain Height = 500 Top = 0 Width = 800 - ActivePage = tsScan + ActivePage = tsMyIP Align = alClient - TabIndex = 1 + TabIndex = 0 TabOrder = 0 object tsMyIP: TTabSheet Caption = '&My IP' - ClientHeight = 466 + ClientHeight = 469 ClientWidth = 790 object panMyIPButtons: TPanel Left = 0 @@ -65,7 +64,7 @@ object frmMain: TfrmMain end object tsScan: TTabSheet Caption = '&Scan IP Range' - ClientHeight = 466 + ClientHeight = 469 ClientWidth = 790 object lblStartIP: TLabel Left = 4 @@ -165,7 +164,7 @@ object frmMain: TfrmMain end object tsPing: TTabSheet Caption = '&Ping' - ClientHeight = 466 + ClientHeight = 469 ClientWidth = 790 object Panel1: TPanel Left = 0 @@ -182,7 +181,7 @@ object frmMain: TfrmMain end object tsTraceRoute: TTabSheet Caption = '&Trace Route' - ClientHeight = 466 + ClientHeight = 469 ClientWidth = 790 object Panel2: TPanel Left = 0 diff --git a/src/forms/forms.main.pas b/src/forms/forms.main.pas index 21f5966..a3d4c4e 100644 --- a/src/forms/forms.main.pas +++ b/src/forms/forms.main.pas @@ -135,12 +135,12 @@ procedure TfrmMain.InitShortcuts; procedure TfrmMain.EnableControls; begin - actMyIPFetch.Enabled:= True; + pcMain.Enabled:= True; end; procedure TfrmMain.DisableControls; begin - actMyIPFetch.Enabled:= False; + pcMain.Enabled:= False; end; procedure TfrmMain.alMainUpdate(AAction: TBasicAction; var Handled: Boolean); @@ -168,12 +168,14 @@ procedure TfrmMain.actMyIPFetchExecute(Sender: TObject); repeat try memMyIPLog.Append(Format('Attempting to contact "%s"', [ cMyIPURL[index] ])); + Application.ProcessMessages; httpResult:= httpClient.SimpleGet(Format('http://%s', [ cMyIPURL[index] ])); success:= True; except on E: Exception do begin memMyIPLog.Append(Format('ERROR(%s): %s', [ cMyIPURL[index], E.Message ])); + Application.ProcessMessages; success:= False; end; end; @@ -182,10 +184,12 @@ procedure TfrmMain.actMyIPFetchExecute(Sender: TObject); if success then begin memMyIPLog.Append(Format('From "%s", your IP is "%s"', [ cMyIPURL[index], Trim(httpResult) ])); + Application.ProcessMessages; end else begin memMyIPLog.Append('Something went horribly wrong'); + Application.ProcessMessages; end; finally httpClient.Free;