source: trunk/Packages/PersistentData/Demo/UFormMain.pas

Last change on this file was 139, checked in by chronos, 2 years ago
  • Fixed: Better handle invalid not found pages including correct HTTP code.
File size: 1.1 KB
Line 
1unit UFormMain;
2
3interface
4
5uses
6 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
7 ActnList, UPDClient;
8
9type
10
11 { TFormMain }
12
13 TFormMain = class(TForm)
14 AClientActive: TAction;
15 ActionList1: TActionList;
16 Button1: TButton;
17 ComboBox1: TComboBox;
18 Label1: TLabel;
19 procedure AClientActiveExecute(Sender: TObject);
20 procedure ComboBox1Change(Sender: TObject);
21 procedure FormShow(Sender: TObject);
22 public
23 Client: TPDClient;
24 end;
25
26var
27 FormMain: TFormMain;
28
29
30implementation
31
32{$R *.lfm}
33
34uses
35 UPersistentData;
36
37{ TFormMain }
38
39procedure TFormMain.FormShow(Sender: TObject);
40begin
41 DefaultManager.LoadToStrings(ComboBox1.Items);
42 if ComboBox1.Items.Count > 0 then ComboBox1.ItemIndex := 0;
43end;
44
45procedure TFormMain.AClientActiveExecute(Sender: TObject);
46begin
47 AClientActive.Checked := not AClientActive.Checked;
48 Client.Connected := AClientActive.Checked;
49end;
50
51procedure TFormMain.ComboBox1Change(Sender: TObject);
52begin
53 FreeAndNil(Client);
54 Client := TPDClientClass(ComboBox1.Items.Objects[ComboBox1.ItemIndex]).Create(Self);
55end;
56
57end.
58
Note: See TracBrowser for help on using the repository browser.