home *** CD-ROM | disk | FTP | other *** search
- {
- (C) Paul Alan Freshney 2006
- (Based on an Indy Client Demo)
-
- Last Modified: January 29th 2006
-
- This code is free to use as you wish. Please do not distribute this code without
- authorisation from myself. We are free to distribute versions of CerberusNET as
- you wish as long as you link to "www.paulalanfreshney.com/cerberus" somewhere
- within the application!
-
- 102
- }
-
- unit preferences;
-
- interface
-
- uses
- Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
- Dialogs, Buttons, ExtCtrls, StdCtrls, ComCtrls;
-
- type
- TfrmPreferences = class(TForm)
- BitBtn1: TBitBtn;
- BitBtn2: TBitBtn;
- Bevel1: TBevel;
- SpeedButton1: TSpeedButton;
- pHello: TPanel;
- Label1: TLabel;
- pConnection: TPanel;
- Label2: TLabel;
- eCHost: TEdit;
- Label3: TLabel;
- eCPort: TEdit;
- Label4: TLabel;
- tbCRefresh: TTrackBar;
- lCRefresh: TLabel;
- procedure FormShow(Sender: TObject);
- procedure SpeedButton1Click(Sender: TObject);
- procedure tbCRefreshChange(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
-
- var
- frmPreferences: TfrmPreferences;
-
- function DoPreferences: word;
-
- implementation
-
- {$R *.dfm}
-
- uses utility;
-
- function DoPreferences: word;
- var
- ret : word;
-
- begin
- with TfrmPreferences.Create(Application) do begin
- ShowModal;
-
- ret:=ModalResult;
-
- if ModalResult=mrOK then begin
- with CNETPreferenes do begin
- CHost :=eCHost.Text;
- CPort :=StrToInt(eCPort.Text);
- CRefresh :=tbCRefresh.Position;
- end;
- end;
- end;
-
- Result:=ret;
- end;
-
- procedure TfrmPreferences.FormShow(Sender: TObject);
- begin
- pHello.BringToFront;
-
- with CNETPreferenes do begin
- eCHost.Text :=CHost;
- eCPort.Text :=IntToStr(CPort);
- tbCRefresh.Position :=CRefresh;
- end;
- end;
-
- procedure TfrmPreferences.SpeedButton1Click(Sender: TObject);
- begin
- pConnection.BringToFront;
- end;
-
- procedure TfrmPreferences.tbCRefreshChange(Sender: TObject);
- begin
- lCRefresh.Caption:='('+IntToStr(tbCRefresh.Position)+' seconds)';
- end;
-
- end.
-