Changeset 43 for trunk/Forms/UFormContacts.pas
- Timestamp:
- Dec 2, 2021, 2:13:03 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormContacts.pas
r42 r43 51 51 procedure FilterList(List: TFPGObjectList<TObject>); 52 52 procedure SetContacts(AValue: TContacts); 53 procedure FormContactPrevious(Sender: TObject); 54 procedure FormContactNext(Sender: TObject); 53 55 public 54 56 property Contacts: TContacts read FContacts write SetContacts; … … 183 185 end; 184 186 187 procedure TFormContacts.FormContactPrevious(Sender: TObject); 188 var 189 I: Integer; 190 begin 191 I := ListViewSort1.List.IndexOf(TFormContact(Sender).Contact); 192 if (I <> -1) and (I > 0) then 193 TFormContact(Sender).Contact := TContact(ListViewSort1.List[I - 1]); 194 end; 195 196 procedure TFormContacts.FormContactNext(Sender: TObject); 197 var 198 I: Integer; 199 begin 200 I := ListViewSort1.List.IndexOf(TFormContact(Sender).Contact); 201 if (I <> -1) and (I < ListViewSort1.List.Count - 1) then 202 TFormContact(Sender).Contact := TContact(ListViewSort1.List[I + 1]); 203 end; 204 185 205 procedure TFormContacts.FormShow(Sender: TObject); 186 206 begin … … 204 224 Contact.Parent := Contacts.ContactsFile; 205 225 FormContact.Contact := Contact; 226 FormContact.OnPrevious := FormContactPrevious; 227 FormContact.OnNext := FormContactNext; 206 228 if FormContact.ShowModal = mrOK then begin 207 229 Contacts.Add(Contact); … … 230 252 Contact.Assign(TContact(ListView1.Selected.Data)); 231 253 FormContact.Contact := Contact; 254 FormContact.OnPrevious := FormContactPrevious; 255 FormContact.OnNext := FormContactNext; 232 256 try 233 257 if FormContact.ShowModal = mrOK then begin
Note:
See TracChangeset
for help on using the changeset viewer.