Ignore:
Timestamp:
Dec 9, 2021, 12:31:17 AM (3 years ago)
Author:
chronos
Message:
  • Fixed: Build with older FPC version.
  • Added: Show also normal phone and work phone in the contact list.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormContacts.pas

    r53 r61  
    120120    AddItem(Fields[cfMiddleName]);
    121121    AddItem(Fields[cfLastName]);
     122    AddItem(Fields[cfTel]);
    122123    AddItem(Fields[cfTelCell]);
    123124    AddItem(Fields[cfTelHome]);
     125    AddItem(Fields[cfTelWork]);
    124126    Item.Data := ListViewSort1.List[Item.Index];
    125127  end;
     
    158160      2: Result := CompareString(TContact(Item1).Fields[cfMiddleName], TContact(Item2).Fields[cfMiddleName]);
    159161      3: Result := CompareString(TContact(Item1).Fields[cfLastName], TContact(Item2).Fields[cfLastName]);
    160       4: Result := CompareString(TContact(Item1).Fields[cfTelCell], TContact(Item2).Fields[cfTelCell]);
    161       5: Result := CompareString(TContact(Item1).Fields[cfTelHome], TContact(Item2).Fields[cfTelHome]);
     162      4: Result := CompareString(TContact(Item1).Fields[cfTel], TContact(Item2).Fields[cfTel]);
     163      5: Result := CompareString(TContact(Item1).Fields[cfTelCell], TContact(Item2).Fields[cfTelCell]);
     164      6: Result := CompareString(TContact(Item1).Fields[cfTelHome], TContact(Item2).Fields[cfTelHome]);
     165      7: Result := CompareString(TContact(Item1).Fields[cfTelWork], TContact(Item2).Fields[cfTelWork]);
    162166    end;
    163167    if ListViewSort1.Order = soDown then Result := -Result;
     
    196200             UTF8LowerCase(TContact(List.Items[I]).Fields[cfLastName])) > 0 then Inc(FoundCount);
    197201           if Pos(UTF8LowerCase(StringGrid.Cells[4, 0]),
     202             UTF8LowerCase(TContact(List.Items[I]).Fields[cfTel])) > 0 then Inc(FoundCount);
     203           if Pos(UTF8LowerCase(StringGrid.Cells[5, 0]),
    198204             UTF8LowerCase(TContact(List.Items[I]).Fields[cfTelCell])) > 0 then Inc(FoundCount);
    199            if Pos(UTF8LowerCase(StringGrid.Cells[5, 0]),
     205           if Pos(UTF8LowerCase(StringGrid.Cells[6, 0]),
    200206             UTF8LowerCase(TContact(List.Items[I]).Fields[cfTelHome])) > 0 then Inc(FoundCount);
     207           if Pos(UTF8LowerCase(StringGrid.Cells[7, 0]),
     208             UTF8LowerCase(TContact(List.Items[I]).Fields[cfTelWork])) > 0 then Inc(FoundCount);
    201209           if FoundCount <> EnteredCount then List.Delete(I);
    202210         end;
Note: See TracChangeset for help on using the changeset viewer.