mirror of
https://github.com/alliedmodders/metamod-source.git
synced 2024-11-28 10:24:20 +01:00
20552a8939
--HG-- rename : installer/Attach.cfg => cruft/installer/Attach.cfg rename : installer/Attach.dpr => cruft/installer/Attach.dpr rename : installer/Attach.exe => cruft/installer/Attach.exe rename : installer/HL2Launch.cfg => cruft/installer/HL2Launch.cfg rename : installer/HL2Launch.dpr => cruft/installer/HL2Launch.dpr rename : installer/HL2Launch.exe => cruft/installer/HL2Launch.exe rename : installer/MMS_Installer.cfg => cruft/installer/MMS_Installer.cfg rename : installer/MMS_Installer.dpr => cruft/installer/MMS_Installer.dpr rename : installer/MMS_Installer.exe => cruft/installer/MMS_Installer.exe rename : installer/MMS_Installer.res => cruft/installer/MMS_Installer.res rename : installer/UnitFunctions.pas => cruft/installer/UnitFunctions.pas rename : installer/UnitInstall.pas => cruft/installer/UnitInstall.pas rename : installer/UnitPackSystem.pas => cruft/installer/UnitPackSystem.pas rename : installer/UnitSelectModPath.dfm => cruft/installer/UnitSelectModPath.dfm rename : installer/UnitSelectModPath.pas => cruft/installer/UnitSelectModPath.pas rename : installer/UnitfrmMain.dfm => cruft/installer/UnitfrmMain.dfm rename : installer/UnitfrmMain.pas => cruft/installer/UnitfrmMain.pas rename : installer/UnitfrmProxy.dfm => cruft/installer/UnitfrmProxy.dfm rename : installer/UnitfrmProxy.pas => cruft/installer/UnitfrmProxy.pas rename : installer/del.bat => cruft/installer/del.bat rename : installer/files/Readme.txt => cruft/installer/files/Readme.txt rename : installer/install.bmp => cruft/installer/install.bmp rename : installer/upx.exe => cruft/installer/upx.exe
73 lines
1.5 KiB
ObjectPascal
73 lines
1.5 KiB
ObjectPascal
unit UnitfrmProxy;
|
|
|
|
interface
|
|
|
|
uses
|
|
SysUtils, Windows, Messages, Classes, Graphics, Controls,
|
|
StdCtrls, ExtCtrls, Forms, TFlatButtonUnit, TFlatComboBoxUnit,
|
|
TFlatEditUnit;
|
|
|
|
type
|
|
TfrmProxy = class(TForm)
|
|
cmdClose: TFlatButton;
|
|
lblProxy: TLabel;
|
|
txtHost: TFlatEdit;
|
|
cboProxy: TFlatComboBox;
|
|
lblHost: TLabel;
|
|
txtPort: TFlatEdit;
|
|
lblPort: TLabel;
|
|
lblUsername: TLabel;
|
|
txtUsername: TFlatEdit;
|
|
txtPassword: TFlatEdit;
|
|
lblPassword: TLabel;
|
|
procedure cboProxyChange(Sender: TObject);
|
|
procedure txtPortChange(Sender: TObject);
|
|
public
|
|
procedure EnableControls(Enable: Boolean);
|
|
end;
|
|
|
|
var
|
|
frmProxy: TfrmProxy;
|
|
|
|
implementation
|
|
|
|
{$R *.DFM}
|
|
|
|
{ TfrmProxy }
|
|
|
|
procedure TfrmProxy.EnableControls(Enable: Boolean);
|
|
begin
|
|
lblHost.Enabled := Enable;
|
|
lblPassword.Enabled := Enable;
|
|
lblPort.Enabled := Enable;
|
|
lblUsername.Enabled := Enable;
|
|
txtHost.Enabled := Enable;
|
|
txtPassword.Enabled := Enable;
|
|
txtPort.Enabled := Enable;
|
|
txtUsername.Enabled := Enable;
|
|
end;
|
|
|
|
procedure TfrmProxy.cboProxyChange(Sender: TObject);
|
|
begin
|
|
EnableControls(cboProxy.ItemIndex <> 0); // 0 = None
|
|
end;
|
|
|
|
procedure TfrmProxy.txtPortChange(Sender: TObject);
|
|
var i: integer;
|
|
begin
|
|
if txtPort.Text = '' then
|
|
txtPort.Text := '8080'
|
|
else begin
|
|
// check if value is numeric...
|
|
for i := Length(txtPort.Text) downto 1 do begin
|
|
if Pos(txtPort.Text[i], '0123456789') = 0 then begin
|
|
txtPort.Text := '8080';
|
|
txtPort.SelStart := 4;
|
|
exit;
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
end.
|