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 | |
---|
1 | unit FormMerge;
|
---|
2 |
|
---|
3 | interface
|
---|
4 |
|
---|
5 | uses
|
---|
6 | Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, ComCtrls,
|
---|
7 | VCard, FormEx;
|
---|
8 |
|
---|
9 | type
|
---|
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 |
|
---|
28 | var
|
---|
29 | FormMerge: TFormMerge;
|
---|
30 |
|
---|
31 |
|
---|
32 | implementation
|
---|
33 |
|
---|
34 | {$R *.lfm}
|
---|
35 |
|
---|
36 | { TFormMerge }
|
---|
37 |
|
---|
38 | procedure TFormMerge.FormCreate(Sender: TObject);
|
---|
39 | begin
|
---|
40 | Source := TVCard.Create(nil);
|
---|
41 | Merged := TVCard.Create(nil);
|
---|
42 | end;
|
---|
43 |
|
---|
44 | procedure TFormMerge.FormDestroy(Sender: TObject);
|
---|
45 | begin
|
---|
46 | FreeAndNil(Source);
|
---|
47 | FreeAndNil(Merged);
|
---|
48 | end;
|
---|
49 |
|
---|
50 | procedure TFormMerge.FormShow(Sender: TObject);
|
---|
51 | begin
|
---|
52 | Merged.Assign(Source);
|
---|
53 | //Merged.Merge;
|
---|
54 | ReloadList;
|
---|
55 | end;
|
---|
56 |
|
---|
57 | procedure TFormMerge.ListView1Data(Sender: TObject; Item: TListItem);
|
---|
58 | begin
|
---|
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;
|
---|
64 | end;
|
---|
65 |
|
---|
66 | procedure TFormMerge.ReloadList;
|
---|
67 | begin
|
---|
68 | ListView1.Items.Count := Merged.Contacts.Count;
|
---|
69 | ListView1.Refresh;
|
---|
70 | end;
|
---|
71 |
|
---|
72 | end.
|
---|
Note:
See
TracBrowser
for help on using the repository browser.