Changeset 52
- Timestamp:
- Dec 3, 2021, 8:50:43 PM (3 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormContact.lfm
r49 r52 25 25 object TabSheetGeneral: TTabSheet 26 26 Caption = 'General' 27 ClientHeight = 74 428 ClientWidth = 9 3127 ClientHeight = 742 28 ClientWidth = 929 29 29 OnHide = TabSheetGeneralHide 30 30 OnShow = TabSheetGeneralShow … … 298 298 object TabSheetHome: TTabSheet 299 299 Caption = 'Home' 300 ClientHeight = 74 4301 ClientWidth = 9 31300 ClientHeight = 742 301 ClientWidth = 929 302 302 OnHide = TabSheetHomeHide 303 303 OnShow = TabSheetHomeShow … … 394 394 Anchors = [akTop, akLeft, akRight] 395 395 Caption = 'Address' 396 ClientHeight = 21 2397 ClientWidth = 8 88396 ClientHeight = 215 397 ClientWidth = 890 398 398 TabOrder = 6 399 399 object Label36: TLabel … … 538 538 object TabSheetWork: TTabSheet 539 539 Caption = 'Work' 540 ClientHeight = 74 4541 ClientWidth = 9 31540 ClientHeight = 742 541 ClientWidth = 929 542 542 OnHide = TabSheetWorkHide 543 543 OnShow = TabSheetWorkShow … … 616 616 Width = 911 617 617 Caption = 'Address' 618 ClientHeight = 2 17619 ClientWidth = 90 7618 ClientHeight = 220 619 ClientWidth = 909 620 620 TabOrder = 4 621 621 object Label31: TLabel … … 827 827 object TabSheetOthers: TTabSheet 828 828 Caption = 'Others' 829 ClientHeight = 74 4830 ClientWidth = 9 31829 ClientHeight = 742 830 ClientWidth = 929 831 831 OnHide = TabSheetOthersHide 832 832 OnShow = TabSheetOthersShow -
trunk/Forms/UFormContacts.lfm
r51 r52 14 14 object ListView1: TListView 15 15 Left = 0 16 Height = 8 0116 Height = 810 17 17 Top = 0 18 18 Width = 1210 … … 58 58 Left = 0 59 59 Height = 39 60 Top = 8 3360 Top = 842 61 61 Width = 1210 62 62 Align = alBottom … … 90 90 Left = 0 91 91 Height = 32 92 Top = 8 0192 Top = 810 93 93 Width = 1210 94 94 OnChange = ListViewFilter1Change … … 97 97 object StatusBar1: TStatusBar 98 98 Left = 0 99 Height = 36100 Top = 8 7299 Height = 27 100 Top = 881 101 101 Width = 1210 102 102 Panels = < -
trunk/Forms/UFormContacts.pas
r51 r52 53 53 private 54 54 FContacts: TContacts; 55 FUpdateCount: Integer; 55 56 procedure FilterList(List: TFPGObjectList<TObject>); 56 57 procedure SetContacts(AValue: TContacts); 57 58 procedure FormContactPrevious(Sender: TObject); 58 59 procedure FormContactNext(Sender: TObject); 60 procedure DoUpdateInterface; 59 61 public 60 62 property Contacts: TContacts read FContacts write SetContacts; 61 63 procedure ReloadList; 64 procedure BeginUpdate; 65 procedure EndUpdate; 62 66 procedure UpdateInterface; 63 67 end; … … 80 84 SFiltered = 'Filtered'; 81 85 SSelected = 'Selected'; 86 SEndUpdateTooLow = 'Update counter error'; 82 87 83 88 { TFormContacts } … … 99 104 if Item.Index < ListViewSort1.List.Count then 100 105 with TContact(ListViewSort1.List[Item.Index]) do begin 101 102 106 AddItem(Fields[cfFullName], True); 103 107 AddItem(Fields[cfFirstName]); … … 220 224 end; 221 225 226 procedure TFormContacts.DoUpdateInterface; 227 var 228 Text: string; 229 SelectedCount: Integer; 230 begin 231 AAdd.Enabled := Assigned(Contacts); 232 AModify.Enabled := Assigned(Contacts) and Assigned(ListView1.Selected); 233 ARemove.Enabled := Assigned(Contacts) and Assigned(ListView1.Selected); 234 235 Text := ''; 236 if Assigned(Contacts) then begin 237 Text := STotal + ': ' + IntToStr(Contacts.Count); 238 if ListView1.Items.Count < Contacts.Count then 239 Text := Text + ', ' + SFiltered + ': ' + IntToStr(ListView1.Items.Count); 240 SelectedCount := ListView1.SelCount; 241 if SelectedCount > 0 then 242 Text := Text + ', ' + SSelected + ': ' + IntToStr(SelectedCount); 243 end; 244 StatusBar1.Panels[0].Text := Text; 245 end; 246 222 247 procedure TFormContacts.FormShow(Sender: TObject); 223 248 begin … … 268 293 Contact := TContact.Create; 269 294 try 295 Contact.Parent := Contacts.ContactsFile; 270 296 Contact.Assign(TContact(ListView1.Selected.Data)); 271 297 FormContact.Contact := Contact; … … 297 323 Contact := TContact.Create; 298 324 try 325 Contact.Parent := Contacts.ContactsFile; 299 326 Contact.Assign(TContact(ListView1.Selected.Data)); 300 327 FormContact.Contact := Contact; … … 333 360 334 361 procedure TFormContacts.ASelectAllExecute(Sender: TObject); 335 begin 336 ListView1.SelectAll; 337 UpdateInterface; 362 var 363 I: Integer; 364 begin 365 BeginUpdate; 366 ListView1.BeginUpdate; 367 for I := 0 to ListView1.Items.Count - 1 do 368 ListView1.Items[I].Selected := True; 369 //ListView1.SelectAll; 370 ListView1.EndUpdate; 371 EndUpdate; 338 372 end; 339 373 … … 360 394 end; 361 395 396 procedure TFormContacts.BeginUpdate; 397 begin 398 Inc(FUpdateCount); 399 end; 400 401 procedure TFormContacts.EndUpdate; 402 begin 403 if FUpdateCount <= 0 then raise Exception(SEndUpdateTooLow); 404 Dec(FUpdateCount); 405 if FUpdateCount = 0 then DoUpdateInterface; 406 end; 407 362 408 procedure TFormContacts.UpdateInterface; 363 var 364 Text: string; 365 SelectedCount: Integer; 366 begin 367 AAdd.Enabled := Assigned(Contacts); 368 AModify.Enabled := Assigned(Contacts) and Assigned(ListView1.Selected); 369 ARemove.Enabled := Assigned(Contacts) and Assigned(ListView1.Selected); 370 371 Text := ''; 372 if Assigned(Contacts) then begin 373 Text := STotal + ': ' + IntToStr(Contacts.Count); 374 if ListView1.Items.Count < Contacts.Count then 375 Text := Text + ', ' + SFiltered + ': ' + IntToStr(ListView1.Items.Count); 376 SelectedCount := ListView1.SelCount; 377 if SelectedCount > 0 then 378 Text := Text + ', ' + SSelected + ': ' + IntToStr(SelectedCount); 379 end; 380 StatusBar1.Panels[0].Text := Text; 409 begin 410 if FUpdateCount = 0 then DoUpdateInterface; 381 411 end; 382 412 -
trunk/Forms/UFormProperties.lfm
r51 r52 14 14 object ListView1: TListView 15 15 Left = 0 16 Height = 8 0116 Height = 810 17 17 Top = 0 18 18 Width = 1210 … … 46 46 Left = 0 47 47 Height = 39 48 Top = 8 3348 Top = 842 49 49 Width = 1210 50 50 Align = alBottom … … 73 73 Left = 0 74 74 Height = 32 75 Top = 8 0175 Top = 810 76 76 Width = 1210 77 77 OnChange = ListViewFilter1Change … … 80 80 object StatusBar1: TStatusBar 81 81 Left = 0 82 Height = 3683 Top = 8 7282 Height = 27 83 Top = 881 84 84 Width = 1210 85 85 Panels = < -
trunk/Languages/vCardStudio.cs.po
r51 r52 602 602 msgstr "Kategorie" 603 603 604 #: ucontact.scontacthasnoparent 605 msgid "Contact has no parent" 606 msgstr "Kontakt nemá rodiče" 607 604 608 #: ucontact.sdayofbirth 605 609 msgid "Day of birth" … … 871 875 msgstr "Soubor" 872 876 877 #: uformcontacts.sendupdatetoolow 878 msgid "Update counter error" 879 msgstr "Chyba čítače aktualizací" 880 873 881 #: uformcontacts.sfiltered 874 882 msgctxt "uformcontacts.sfiltered" -
trunk/Languages/vCardStudio.po
r51 r52 590 590 msgstr "" 591 591 592 #: ucontact.scontacthasnoparent 593 msgid "Contact has no parent" 594 msgstr "" 595 592 596 #: ucontact.sdayofbirth 593 597 msgid "Day of birth" … … 859 863 msgstr "" 860 864 865 #: uformcontacts.sendupdatetoolow 866 msgid "Update counter error" 867 msgstr "" 868 861 869 #: uformcontacts.sfiltered 862 870 msgctxt "uformcontacts.sfiltered" -
trunk/UContact.pas
r46 r52 143 143 SFoundBlockEndWithoutBlockStart = 'Found block end without block start'; 144 144 SFieldIndexNotDefined = 'Field index not defined'; 145 SContactHasNoParent = 'Contact has no parent'; 145 146 SLastName = 'Last Name'; 146 147 SFirstName = 'First Name'; … … 478 479 var 479 480 I: Integer; 480 begin 481 C: Integer; 482 begin 483 C := Count; 481 484 I := 0; 482 485 while (I < Count) and (Items[I].Index <> Index) do Inc(I); … … 502 505 Field: TContactField; 503 506 begin 507 if not Assigned(Parent) then raise Exception.Create(SContactHasNoParent); 504 508 Prop := GetProperty(Index); 505 509 if Assigned(Prop) then begin … … 517 521 I: Integer; 518 522 begin 523 if not Assigned(Parent) then raise Exception.Create(SContactHasNoParent); 519 524 Field := Parent.Fields.GetByIndex(Index); 520 525 if Assigned(Field) then begin … … 542 547 function TContact.GetProperty(Index: TContactFieldIndex): TContactProperty; 543 548 var 544 Prop: TContactProperty;545 549 Field: TContactField; 546 550 begin 551 if not Assigned(Parent) then raise Exception.Create(SContactHasNoParent); 547 552 Field := Parent.Fields.GetByIndex(Index); 548 553 if Assigned(Field) then begin … … 555 560 I: Integer; 556 561 begin 557 Parent := Source.Parent;558 562 while Properties.Count < Source.Properties.Count do 559 563 Properties.Add(TContactProperty.Create); … … 568 572 I: Integer; 569 573 begin 574 if not Assigned(Parent) then raise Exception.Create(SContactHasNoParent); 570 575 Result := False; 571 576 for I := 0 to Parent.Fields.Count - 1 do begin -
trunk/UCore.pas
r49 r52 374 374 if not Assigned(NewContact) then begin 375 375 NewContact := TContact.Create; 376 NewContact.Assign(TempFile.Contacts[I]); 376 377 NewContact.Parent := TContactsFile(DataFile); 377 NewContact.Assign(TempFile.Contacts[I]);378 378 TContactsFile(DataFile).Contacts.Add(NewContact); 379 379 Inc(Result.New);
Note:
See TracChangeset
for help on using the changeset viewer.