1unit frmnewhttpapp; 2 3{$mode objfpc}{$H+} 4 5interface 6 7uses 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, EditBtn, 9 StdCtrls, Spin, ButtonPanel; 10 11type 12 13 { TNewHTTPApplicationForm } 14 15 TNewHTTPApplicationForm = class(TForm) 16 ButtonPanel1: TButtonPanel; 17 CBRegisterFiles: TCheckBox; 18 CBthreads: TCheckBox; 19 DEDocumentroot: TDirectoryEdit; 20 ELocation: TEdit; 21 LSEPort: TLabel; 22 LELocation: TLabel; 23 LDEDocumentRoot: TLabel; 24 SEPort: TSpinEdit; 25 procedure CBRegisterFilesChange(Sender: TObject); 26 procedure FormCreate(Sender: TObject); 27 private 28 function GetD: String; 29 function GetL: String; 30 function GetP: Integer; 31 function GetS: Boolean; 32 function Gett: Boolean; 33 procedure LocalizeForm; 34 { private declarations } 35 public 36 { public declarations } 37 Property ServeFiles : Boolean Read GetS; 38 Property Location : String Read GetL; 39 Property Directory : String Read GetD; 40 Property Port: Integer Read GetP; 41 Property Threaded : Boolean Read Gett; 42 end; 43 44var 45 NewHTTPApplicationForm: TNewHTTPApplicationForm; 46 47implementation 48 49uses fpWebStrConsts; 50 51{$R *.lfm} 52 53{ TNewHTTPApplicationForm } 54 55procedure TNewHTTPApplicationForm.FormCreate(Sender: TObject); 56begin 57 LocalizeForm; 58end; 59 60procedure TNewHTTPApplicationForm.CBRegisterFilesChange(Sender: TObject); 61 62Var 63 B : Boolean; 64 65begin 66 B:=GetS; 67 ELocation.Enabled:=B; 68 DEDocumentRoot.Enabled:=B; 69end; 70 71procedure TNewHTTPApplicationForm.LocalizeForm; 72 73begin 74 Caption:=sNewHTTPApp; 75 CBRegisterFiles.Caption:=sRegisterFiles; 76 LELocation.Caption:=sDocumentLocation; 77 LDEDocumentRoot.Caption:=sDocumentRoot; 78 LSEPort.Caption:=sHTTPPort; 79 CBthreads.Caption:=sUseThreads; 80end; 81 82function TNewHTTPApplicationForm.GetD: String; 83begin 84 Result:=DEDocumentRoot.Text; 85end; 86 87function TNewHTTPApplicationForm.GetL: String; 88begin 89 Result:=ELocation.Text; 90end; 91 92function TNewHTTPApplicationForm.GetP: Integer; 93begin 94 Result:=SEPort.Value; 95end; 96 97function TNewHTTPApplicationForm.GetS: Boolean; 98begin 99 Result:=CBRegisterFiles.Checked; 100end; 101 102function TNewHTTPApplicationForm.Gett: Boolean; 103begin 104 Result:=CBThreads.Checked; 105end; 106 107end. 108 109