Changeset 88 for trunk/Forms
- Timestamp:
- Jan 3, 2022, 11:05:44 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormContacts.pas
r82 r88 201 201 with TContact(List.Items[I]) do begin 202 202 FoundCount := 0; 203 for J := 0 to FilterItems.Count - 1 do begin 204 if FilterItems[J].FieldIndex = cfNone then begin 205 for K := 0 to TContact(List.Items[I]).GetFields.Count - 1 do begin 206 if Pos(UTF8LowerCase(FilterItems[J].Value), 207 UTF8LowerCase(TContact(List.Items[I]).Fields[TContact(List.Items[I]).GetFields[K].Index])) > 0 then begin 208 Inc(FoundCount); 209 Break; 210 end; 211 end; 212 end else begin 203 for J := 0 to FilterItems.Count - 1 do 204 if FilterItems[J].FieldIndex = cfNone then begin 205 for K := 0 to TContact(List.Items[I]).GetFields.Count - 1 do begin 213 206 if Pos(UTF8LowerCase(FilterItems[J].Value), 214 UTF8LowerCase(TContact(List.Items[I]).Fields[ FilterItems[J].FieldIndex])) > 0 then207 UTF8LowerCase(TContact(List.Items[I]).Fields[TContact.GetFields[K].Index])) > 0 then begin 215 208 Inc(FoundCount); 209 Break; 210 end; 216 211 end; 212 end else begin 213 if Pos(UTF8LowerCase(FilterItems[J].Value), 214 UTF8LowerCase(TContact(List.Items[I]).Fields[FilterItems[J].FieldIndex])) > 0 then 215 Inc(FoundCount); 217 216 end; 218 if FoundCount <> FilterItems.Count then List.Delete(I); 219 end; 220 end else 221 if TContact(List.Items[I]) is TContact then begin 222 List.Delete(I); 217 end; 218 if FoundCount <> FilterItems.Count then List.Delete(I); 223 219 end; 224 220 end; … … 230 226 FContacts := AValue; 231 227 ReloadList; 232 UpdateInterface; 233 ListViewFilter1.Reset; 228 BeginUpdate; 229 try 230 ListViewFilter1.Reset; 231 finally 232 EndUpdate; 233 end; 234 234 end; 235 235 … … 280 280 Field: TContactField; 281 281 begin 282 while ListView1.Columns.Count < ListViewColumns.Count do 283 ListView1.Columns.Add; 284 while ListView1.Columns.Count > ListViewColumns.Count do 285 ListView1.Columns.Delete(ListView1.Columns.Count - 1); 286 for I := 0 to ListView1.Columns.Count - 1 do begin 287 if Assigned(Contacts) and Assigned(Contacts.ContactsFile) then begin 288 Field := TContact.GetFields.GetByIndex(ListViewColumns[I]); 289 if Assigned(Field) then 290 ListView1.Columns[I].Caption := Field.Title; 291 end; 282 ListView1.Columns.BeginUpdate; 283 try 284 while ListView1.Columns.Count < ListViewColumns.Count do 285 ListView1.Columns.Add; 286 while ListView1.Columns.Count > ListViewColumns.Count do 287 ListView1.Columns.Delete(ListView1.Columns.Count - 1); 288 for I := 0 to ListView1.Columns.Count - 1 do begin 289 if Assigned(Contacts) and Assigned(Contacts.ContactsFile) then begin 290 Field := TContact.GetFields.GetByIndex(ListViewColumns[I]); 291 if Assigned(Field) then 292 ListView1.Columns[I].Caption := Field.Title; 293 end; 294 end; 295 finally 296 ListView1.Columns.EndUpdate; 292 297 end; 293 298 end; … … 558 563 559 564 ListViewColumns := TContactFieldIndexes.Create; 560 ListViewColumns.Add(cfFullName); 561 ListViewColumns.Add(cfFirstName); 562 ListViewColumns.Add(cfMiddleName); 563 ListViewColumns.Add(cfLastName); 564 ListViewColumns.Add(cfTel); 565 ListViewColumns.Add(cfTelCell); 566 ListViewColumns.Add(cfTelHome); 567 ListViewColumns.Add(cfTelWork); 568 ListViewColumns.Add(cfEmailWork); 565 with ListViewColumns do begin 566 Add(cfFullName); 567 Add(cfFirstName); 568 Add(cfMiddleName); 569 Add(cfLastName); 570 Add(cfTel); 571 Add(cfTelCell); 572 Add(cfTelHome); 573 Add(cfTelWork); 574 Add(cfEmailWork); 575 end; 569 576 570 577 FContacts := nil;
Note:
See TracChangeset
for help on using the changeset viewer.