- Timestamp:
- Dec 10, 2021, 11:15:41 AM (3 years ago)
- Location:
- trunk
- Files:
-
- 6 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormFindDuplicity.pas
r29 r68 49 49 public 50 50 FoundItems: TFoundItems; 51 ContactField : TContactFieldIndex;51 ContactFieldIndex: TContactFieldIndex; 52 52 procedure Find; 53 53 procedure ReloadList; … … 107 107 108 108 procedure TFormFindDuplicity.SetContacts(AValue: TContacts); 109 var 110 ContactField: TContactField; 109 111 begin 110 112 if FContacts = AValue then Exit; … … 112 114 if Assigned(FContacts) then begin 113 115 Contacts.ContactsFile.Fields.LoadToStrings(ComboBoxField.Items); 114 ComboBoxField.ItemIndex := Integer(ContactField); 116 ContactField := Contacts.ContactsFile.Fields.GetByIndex(ContactFieldIndex); 117 ComboBoxField.ItemIndex := ComboBoxField.Items.IndexOfObject(ContactField); 115 118 if (ComboBoxField.Items.Count > 0) and (ComboBoxField.ItemIndex = -1) then 116 119 ComboBoxField.ItemIndex := 0; … … 133 136 FoundItems.Clear; 134 137 for I := 0 to Contacts.Count - 1 do begin 135 FieldName := TContact(Contacts[I]).Fields[ContactField];138 FieldName := Contacts[I].Fields[ContactFieldIndex]; 136 139 if FieldName <> '' then begin 137 140 Item := FoundItems.SearchByField(FieldName); … … 153 156 Core.Translator.TranslateComponentRecursive(Self); 154 157 Core.ThemeManager1.UseTheme(Self); 155 ContactField := cfTelCell;158 ContactFieldIndex := cfTelCell; 156 159 end; 157 160 158 161 procedure TFormFindDuplicity.ComboBoxFieldChange(Sender: TObject); 159 162 begin 160 ContactField := TContactFieldIndex(ComboBoxField.ItemIndex); 163 if ComboBoxField.ItemIndex <> -1 then 164 ContactFieldIndex := TContactField(ComboBoxField.Items.Objects[ComboBoxField.ItemIndex]).Index 165 else ContactFieldIndex := cfTelCell; 161 166 Find; 162 167 end; -
trunk/Forms/UFormProperty.lfm
r56 r68 95 95 object ComboBoxField: TComboBox 96 96 Left = 168 97 Height = 4 297 Height = 41 98 98 Top = 24 99 99 Width = 532 -
trunk/Forms/UFormProperty.pas
r56 r68 64 64 begin 65 65 if ComboBoxField.ItemIndex <> -1 then begin 66 Field := TContact sFile(Core.DataFile).Fields[ComboBoxField.ItemIndex];66 Field := TContactField(ComboBoxField.Items.Objects[ComboBoxField.ItemIndex]); 67 67 if Assigned(Field) then begin 68 68 EditName.Text := Field.SysName; … … 132 132 GroupsArray); 133 133 if Assigned(Field) then 134 ComboBoxField.ItemIndex := TContactsFile(Core.DataFile).Fields.IndexOf(Field);134 ComboBoxField.ItemIndex := ComboBoxField.Items.IndexOfObject(Field); 135 135 end; 136 136 -
trunk/Packages/Common/UCommon.pas
r22 r68 85 85 function TryHexToInt(Data: string; var Value: Integer): Boolean; 86 86 function TryBinToInt(Data: string; var Value: Integer): Boolean; 87 procedure SortStrings(Strings: TStrings); 87 88 88 89 … … 677 678 end; 678 679 680 procedure SortStrings(Strings: TStrings); 681 var 682 Tmp: TStringList; 683 begin 684 Strings.BeginUpdate; 685 try 686 if Strings is TStringList then begin 687 TStringList(Strings).Sort; 688 end else begin 689 Tmp := TStringList.Create; 690 try 691 Tmp.Assign(Strings); 692 Tmp.Sort; 693 Strings.Assign(Tmp); 694 finally 695 Tmp.Free; 696 end; 697 end; 698 finally 699 Strings.EndUpdate; 700 end; 701 end; 702 679 703 680 704 initialization -
trunk/UContact.pas
r66 r68 162 162 163 163 uses 164 UQuotedPrintable ;164 UQuotedPrintable, UCommon; 165 165 166 166 const … … 674 674 I: Integer; 675 675 begin 676 while AItems.Count < Count do AItems.Add(''); 677 while AItems.Count > Count do AItems.Delete(AItems.Count - 1); 678 for I := 0 to Count - 1 do 679 AItems[I] := Items[I].Title; 676 AItems.BeginUpdate; 677 try 678 while AItems.Count < Count do AItems.Add(''); 679 while AItems.Count > Count do AItems.Delete(AItems.Count - 1); 680 for I := 0 to Count - 1 do begin 681 AItems.Objects[I] := Items[I]; 682 AItems[I] := Items[I].Title; 683 end; 684 SortStrings(AItems); 685 finally 686 AItems.EndUpdate; 687 end; 680 688 end; 681 689
Note:
See TracChangeset
for help on using the changeset viewer.