Changeset 8 for trunk/Forms/UFormContact.pas
- Timestamp:
- Feb 1, 2018, 12:51:32 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormContact.pas
r7 r8 36 36 procedure FormCreate(Sender: TObject); 37 37 procedure FormShow(Sender: TObject); 38 procedure ListView1Data(Sender: TObject; Item: TListItem); 38 39 private 39 40 Contact: TContact; 40 41 public 42 procedure ReloadFields; 41 43 procedure LoadData(Contact: TContact); 42 44 procedure SaveData(Contact: TContact); … … 58 60 begin 59 61 Core.PersistentForm1.Load(Self); 62 PageControlContact.TabIndex := 0; 63 ReloadFields; 64 end; 65 66 procedure TFormContact.ListView1Data(Sender: TObject; Item: TListItem); 67 begin 68 if Item.Index < Contact.Parent.Fields.Count then 69 with TContactField(Contact.Parent.Fields[Item.Index]) do begin 70 Item.Caption := Name; 71 Item.SubItems.Add(Contact.Fields[Index]); 72 end; 73 end; 74 75 procedure TFormContact.ReloadFields; 76 begin 77 if Assigned(Contact) then begin 78 ListView1.Items.Count := Contact.Parent.Fields.Count; 79 end else ListView1.Items.Count := 0; 80 ListView1.Refresh; 60 81 end; 61 82 … … 69 90 begin 70 91 Core.CoolTranslator1.TranslateComponentRecursive(Self); 92 Contact := nil; 71 93 end; 72 94 73 95 procedure TFormContact.LoadData(Contact: TContact); 74 96 begin 97 Self.Contact := Contact; 98 ReloadFields; 75 99 EditName.Text := Contact.FirstName; 76 100 EditSurname.Text := Contact.LastName;
Note:
See TracChangeset
for help on using the changeset viewer.