- Timestamp:
- Dec 15, 2021, 9:03:17 PM (3 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormContact.lfm
r73 r77 429 429 Anchors = [akTop, akLeft, akRight] 430 430 Caption = 'Address' 431 ClientHeight = 21 2432 ClientWidth = 9 18431 ClientHeight = 215 432 ClientWidth = 920 433 433 TabOrder = 6 434 434 object Label36: TLabel … … 573 573 object TabSheetWork: TTabSheet 574 574 Caption = 'Work' 575 ClientHeight = 6 30576 ClientWidth = 9 61575 ClientHeight = 628 576 ClientWidth = 959 577 577 OnHide = TabSheetWorkHide 578 578 OnShow = TabSheetWorkShow 579 579 object EditOrganization: TEdit 580 580 Left = 173 581 Height = 33581 Height = 42 582 582 Top = 64 583 583 Width = 254 … … 587 587 object LabelOrganization: TLabel 588 588 Left = 10 589 Height = 2 5589 Height = 24 590 590 Top = 70 591 Width = 1 06591 Width = 114 592 592 Caption = 'Organization:' 593 593 ParentColor = False … … 596 596 object LabelOrganization1: TLabel 597 597 Left = 451 598 Height = 2 5598 Height = 24 599 599 Top = 24 600 Width = 99600 Width = 106 601 601 Caption = 'Department:' 602 602 ParentColor = False … … 605 605 object EditDepartment: TEdit 606 606 Left = 608 607 Height = 33607 Height = 42 608 608 Top = 20 609 609 Width = 254 … … 613 613 object Label18: TLabel 614 614 Left = 10 615 Height = 2 5615 Height = 24 616 616 Top = 20 617 Width = 36617 Width = 41 618 618 Caption = 'Title:' 619 619 ParentColor = False … … 622 622 object EditTitle: TEdit 623 623 Left = 173 624 Height = 33624 Height = 42 625 625 Top = 16 626 626 Width = 254 … … 630 630 object EditWorkWeb: TEdit 631 631 Left = 173 632 Height = 33632 Height = 42 633 633 Top = 256 634 634 Width = 683 … … 638 638 object Label32: TLabel 639 639 Left = 10 640 Height = 2 5640 Height = 24 641 641 Top = 264 642 Width = 1 07642 Width = 114 643 643 Caption = 'Web address:' 644 644 ParentColor = False … … 651 651 Width = 911 652 652 Caption = 'Address' 653 ClientHeight = 2 17654 ClientWidth = 90 7653 ClientHeight = 220 654 ClientWidth = 909 655 655 TabOrder = 4 656 656 object Label31: TLabel 657 657 Left = 10 658 Height = 2 5658 Height = 24 659 659 Top = 160 660 Width = 67660 Width = 71 661 661 Caption = 'Country:' 662 662 ParentColor = False … … 665 665 object EditAddressWorkCountry: TEdit 666 666 Left = 173 667 Height = 33667 Height = 42 668 668 Top = 160 669 669 Width = 254 … … 673 673 object EditAddressWorkRegion: TEdit 674 674 Left = 173 675 Height = 33675 Height = 42 676 676 Top = 112 677 677 Width = 254 … … 681 681 object Label30: TLabel 682 682 Left = 10 683 Height = 2 5683 Height = 24 684 684 Top = 112 685 Width = 59685 Width = 64 686 686 Caption = 'Region:' 687 687 ParentColor = False … … 690 690 object Label35: TLabel 691 691 Left = 10 692 Height = 2 5692 Height = 24 693 693 Top = 66 694 Width = 1 26694 Width = 137 695 695 Caption = 'Extended street:' 696 696 ParentColor = False … … 699 699 object EditAddressWorkStreetExtended: TEdit 700 700 Left = 173 701 Height = 33701 Height = 42 702 702 Top = 64 703 703 Width = 254 … … 707 707 object Label28: TLabel 708 708 Left = 10 709 Height = 2 5709 Height = 24 710 710 Top = 18 711 Width = 49711 Width = 54 712 712 Caption = 'Street:' 713 713 ParentColor = False … … 716 716 object EditAddressWorkStreet: TEdit 717 717 Left = 173 718 Height = 33718 Height = 42 719 719 Top = 8 720 720 Width = 254 … … 724 724 object Label34: TLabel 725 725 Left = 451 726 Height = 2 5726 Height = 24 727 727 Top = 18 728 Width = 1 22728 Width = 131 729 729 Caption = 'Post office box:' 730 730 ParentColor = False … … 733 733 object EditAddressWorkPostOfficeBox: TEdit 734 734 Left = 608 735 Height = 33735 Height = 42 736 736 Top = 8 737 737 Width = 254 … … 741 741 object EditAddressWorkCity: TEdit 742 742 Left = 608 743 Height = 33743 Height = 42 744 744 Top = 56 745 745 Width = 254 … … 749 749 object Label29: TLabel 750 750 Left = 451 751 Height = 2 5751 Height = 24 752 752 Top = 64 753 Width = 3 4753 Width = 36 754 754 Caption = 'City:' 755 755 ParentColor = False … … 758 758 object EditAddressWorkPostalCode: TEdit 759 759 Left = 608 760 Height = 33760 Height = 42 761 761 Top = 142 762 762 Width = 254 … … 766 766 object Label33: TLabel 767 767 Left = 451 768 Height = 2 5768 Height = 24 769 769 Top = 150 770 Width = 95770 Width = 103 771 771 Caption = 'Postal code:' 772 772 ParentColor = False … … 776 776 object Label15: TLabel 777 777 Left = 10 778 Height = 2 5778 Height = 24 779 779 Top = 116 780 Width = 5 4780 Width = 59 781 781 Caption = 'Phone:' 782 782 ParentColor = False … … 785 785 object EditWorkPhone: TEdit 786 786 Left = 173 787 Height = 33787 Height = 42 788 788 Top = 112 789 789 Width = 254 … … 793 793 object Label16: TLabel 794 794 Left = 451 795 Height = 2 5795 Height = 24 796 796 Top = 112 797 Width = 29797 Width = 34 798 798 Caption = 'Fax:' 799 799 ParentColor = False … … 802 802 object EditWorkFax: TEdit 803 803 Left = 608 804 Height = 33804 Height = 42 805 805 Top = 112 806 806 Width = 254 … … 810 810 object EditWorkPager: TEdit 811 811 Left = 608 812 Height = 33812 Height = 42 813 813 Top = 156 814 814 Width = 254 … … 818 818 object Label17: TLabel 819 819 Left = 448 820 Height = 2 5820 Height = 24 821 821 Top = 160 822 Width = 48822 Width = 54 823 823 Caption = 'Pager:' 824 824 ParentColor = False … … 827 827 object EditWorkMobile: TEdit 828 828 Left = 173 829 Height = 33829 Height = 42 830 830 Top = 160 831 831 Width = 254 … … 835 835 object Label19: TLabel 836 836 Left = 10 837 Height = 2 5837 Height = 24 838 838 Top = 160 839 Width = 59839 Width = 63 840 840 Caption = 'Mobile:' 841 841 ParentColor = False … … 844 844 object Label8: TLabel 845 845 Left = 10 846 Height = 2 5846 Height = 24 847 847 Top = 210 848 Width = 5 3848 Width = 58 849 849 Caption = 'E-mail:' 850 850 ParentColor = False … … 853 853 object EditWorkEmail: TEdit 854 854 Left = 173 855 Height = 33855 Height = 42 856 856 Top = 210 857 857 Width = 254 … … 1335 1335 Left = 144 1336 1336 Height = 37 1337 Top = 68 61337 Top = 688 1338 1338 Width = 115 1339 1339 Anchors = [akLeft, akBottom] -
trunk/Forms/UFormContact.pas
r71 r77 206 206 private 207 207 FContact: TContact; 208 FOn Next: TNotifyEvent;209 FOn Previous: TNotifyEvent;208 FOnGetNext: TGetContactEvent; 209 FOnGetPrevious: TGetContactEvent; 210 210 FormProperties: TFormProperties; 211 211 procedure SetContact(AValue: TContact); … … 216 216 procedure UpdateInterface; 217 217 property Contact: TContact read FContact write SetContact; 218 property On Previous: TNotifyEvent read FOnPrevious write FOnPrevious;219 property On Next: TNotifyEvent read FOnNext write FOnNext;218 property OnGetPrevious: TGetContactEvent read FOnGetPrevious write FOnGetPrevious; 219 property OnGetNext: TGetContactEvent read FOnGetNext write FOnGetNext; 220 220 end; 221 221 … … 654 654 procedure TFormContact.ButtonNextClick(Sender: TObject); 655 655 begin 656 if Assigned(FOnNext) then FOnNext(Self); 656 if Assigned(FOnGetNext) then 657 Contact := FOnGetNext(Contact); 657 658 end; 658 659 … … 679 680 procedure TFormContact.ButtonPreviousClick(Sender: TObject); 680 681 begin 681 if Assigned(FOnPrevious) then FOnPrevious(Self); 682 if Assigned(FOnGetPrevious) then 683 Contact := FOnGetPrevious(Contact); 682 684 end; 683 685 … … 699 701 APhotoSave.Enabled := ProfilePhotoActive; 700 702 APhotoClear.Enabled := ProfilePhotoActive; 703 //ButtonNext.Enabled := Assigned(FOnGetNext) and Assigned(FOnGetNext(Contact)); 704 //ButtonPrevious.Enabled := Assigned(FOnGetPrevious) and Assigned(FOnGetPrevious(Contact)); 701 705 end; 702 706 -
trunk/Forms/UFormContacts.pas
r76 r77 80 80 procedure FilterList(List: TFPGObjectList<TObject>); 81 81 procedure SetContacts(AValue: TContacts); 82 procedure FormContactPrevious(Sender: TObject);83 procedure FormContactNext(Sender: TObject);82 function GetPreviousContact(Contact: TContact): TContact; 83 function GetNextContact(Contact: TContact): TContact; 84 84 procedure DoUpdateInterface; 85 85 procedure UpdateColumns; … … 234 234 end; 235 235 236 procedure TFormContacts.FormContactPrevious(Sender: TObject);237 var 238 I: Integer; 239 begin 240 I := ListViewSort1.List.IndexOf( TFormContact(Sender).Contact);236 function TFormContacts.GetPreviousContact(Contact: TContact): TContact; 237 var 238 I: Integer; 239 begin 240 I := ListViewSort1.List.IndexOf(Contact); 241 241 if (I <> -1) and (I > 0) then 242 TFormContact(Sender).Contact := TContact(ListViewSort1.List[I - 1]); 243 end; 244 245 procedure TFormContacts.FormContactNext(Sender: TObject); 246 var 247 I: Integer; 248 begin 249 I := ListViewSort1.List.IndexOf(TFormContact(Sender).Contact); 242 Result := TContact(ListViewSort1.List[I - 1]) 243 else Result := nil; 244 end; 245 246 function TFormContacts.GetNextContact(Contact: TContact): TContact; 247 var 248 I: Integer; 249 begin 250 I := ListViewSort1.List.IndexOf(Contact); 250 251 if (I <> -1) and (I < ListViewSort1.List.Count - 1) then 251 TFormContact(Sender).Contact := TContact(ListViewSort1.List[I + 1]); 252 Result := TContact(ListViewSort1.List[I + 1]) 253 else Result := nil; 252 254 end; 253 255 … … 312 314 Contact.Parent := Contacts.ContactsFile; 313 315 FormContact.Contact := Contact; 314 FormContact.On Previous := FormContactPrevious;315 FormContact.On Next := FormContactNext;316 FormContact.OnGetPrevious := GetPreviousContact; 317 FormContact.OnGetNext := GetNextContact; 316 318 if FormContact.ShowModal = mrOK then begin 317 319 Contacts.Add(Contact); … … 342 344 Contact.Assign(TContact(ListView1.Selected.Data)); 343 345 FormContact.Contact := Contact; 344 FormContact.On Previous := FormContactPrevious;345 FormContact.On Next := FormContactNext;346 FormContact.OnGetPrevious := GetPreviousContact; 347 FormContact.OnGetNext := GetNextContact; 346 348 if FormContact.ShowModal = mrOK then begin 347 349 Contacts.Add(Contact); … … 443 445 Contact.Assign(TContact(ListView1.Selected.Data)); 444 446 FormContact.Contact := Contact; 445 FormContact.On Previous := FormContactPrevious;446 FormContact.On Next := FormContactNext;447 FormContact.OnGetPrevious := GetPreviousContact; 448 FormContact.OnGetNext := GetNextContact; 447 449 if FormContact.ShowModal = mrOK then begin 448 450 TContact(ListView1.Selected.Data).Assign(Contact); -
trunk/Languages/vCardStudio.cs.po
r76 r77 1249 1249 msgid "Invalid line length for encoded text" 1250 1250 msgstr "Neplatná délka řádky kódovaného textu" 1251 -
trunk/UContact.pas
r76 r77 119 119 TContact = class 120 120 private 121 FModified: Boolean; 122 FOnModify: TNotifyEvent; 121 123 function GetField(Index: TContactFieldIndex): string; 122 124 procedure SetField(Index: TContactFieldIndex; AValue: string); 125 procedure SetModified(AValue: Boolean); 126 procedure DoOnModify; 123 127 public 124 128 Properties: TContactProperties; … … 137 141 procedure LoadFromFile(FileName: string); 138 142 property Fields[Index: TContactFieldIndex]: string read GetField write SetField; 139 end; 143 property Modified: Boolean read FModified write SetModified; 144 property OnModify: TNotifyEvent read FOnModify write FOnModify; 145 end; 146 147 TGetContactEvent = function (Contact: TContact): TContact of object; 140 148 141 149 { TContacts } … … 850 858 end; 851 859 end; 860 Modified := True; 852 861 end else raise Exception.Create(SFieldIndexNotDefined); 862 end; 863 864 procedure TContact.SetModified(AValue: Boolean); 865 begin 866 if FModified = AValue then Exit; 867 FModified := AValue; 868 DoOnModify; 869 end; 870 871 procedure TContact.DoOnModify; 872 begin 873 if Assigned(FOnModify) then FOnModify(Self); 853 874 end; 854 875 … … 903 924 begin 904 925 Properties.Assign(Source.Properties); 926 FModified := Source.FModified; 905 927 end; 906 928
Note:
See TracChangeset
for help on using the changeset viewer.