source: trunk/Forms/FormMerge.pas

Last change on this file was 173, checked in by chronos, 5 months ago
  • Modified: TNameDetails class moved into separate file.
File size: 1.3 KB
Line 
1unit FormMerge;
2
3interface
4
5uses
6 Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, ComCtrls,
7 VCard, FormEx;
8
9type
10
11 { TFormMerge }
12
13 TFormMerge = class(TFormEx)
14 ButtonOk: TButton;
15 ButtonCancel: TButton;
16 ListView1: TListView;
17 procedure FormCreate(Sender: TObject);
18 procedure FormDestroy(Sender: TObject);
19 procedure FormShow(Sender: TObject);
20 procedure ListView1Data(Sender: TObject; Item: TListItem);
21 private
22 procedure ReloadList;
23 public
24 Source: TVCard;
25 Merged: TVCard;
26 end;
27
28var
29 FormMerge: TFormMerge;
30
31
32implementation
33
34{$R *.lfm}
35
36{ TFormMerge }
37
38procedure TFormMerge.FormCreate(Sender: TObject);
39begin
40 Source := TVCard.Create(nil);
41 Merged := TVCard.Create(nil);
42end;
43
44procedure TFormMerge.FormDestroy(Sender: TObject);
45begin
46 FreeAndNil(Source);
47 FreeAndNil(Merged);
48end;
49
50procedure TFormMerge.FormShow(Sender: TObject);
51begin
52 Merged.Assign(Source);
53 //Merged.Merge;
54 ReloadList;
55end;
56
57procedure TFormMerge.ListView1Data(Sender: TObject; Item: TListItem);
58begin
59 if Item.Index < Merged.Contacts.Count then
60 with Merged.Contacts[Item.Index] do begin
61 Item.Caption := IntToStr(Item.Index);
62 //Item.SubItems.Add(TextLabel);
63 end;
64end;
65
66procedure TFormMerge.ReloadList;
67begin
68 ListView1.Items.Count := Merged.Contacts.Count;
69 ListView1.Refresh;
70end;
71
72end.
Note: See TracBrowser for help on using the repository browser.