Changeset 108 for trunk/Forms/UFormContact.pas
- Timestamp:
- Feb 11, 2022, 11:31:42 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormContact.pas
r104 r108 205 205 procedure ButtonWorkAddressShowClick(Sender: TObject); 206 206 procedure EditFullNameChange(Sender: TObject); 207 procedure NamePartChange(Sender: TObject); 207 208 procedure FormClose(Sender: TObject; var CloseAction: TCloseAction); 208 209 procedure FormCreate(Sender: TObject); … … 315 316 {$ENDIF} 316 317 Core.PersistentForm1.Load(Self); 317 318 FormProperties.ManualDock(TabSheetAll, nil, alClient);319 FormProperties.Align := alClient;320 FormProperties.Show;321 322 318 PhotoChange(nil); 323 319 324 PageControlContact.TabIndex := Core.LastContactTabIndex; 325 UpdateInterface; 320 FormProperties.BeginUpdate; 321 try 322 323 FormProperties.ManualDock(TabSheetAll, nil, alClient); 324 FormProperties.Align := alClient; 325 FormProperties.Show; 326 327 PageControlContact.TabIndex := Core.LastContactTabIndex; 328 UpdateInterface; 329 finally 330 FormProperties.EndUpdate; 331 end; 326 332 end; 327 333 … … 385 391 procedure TFormContact.TabSheetAllShow(Sender: TObject); 386 392 begin 387 FormProperties.Properties := Contact.Properties; 388 FormProperties.ReloadList; 389 FormProperties.UpdateInterface; 393 FormProperties.BeginUpdate; 394 try 395 FormProperties.Properties := Contact.Properties; 396 FormProperties.ReloadList; 397 FormProperties.UpdateInterface; 398 FormProperties.Show; 399 finally 400 FormProperties.EndUpdate; 401 end; 390 402 end; 391 403 … … 709 721 end; 710 722 723 procedure UpdateEditNoOnChange(Edit: TEdit; Text: string); 724 var 725 LastHandler: TNotifyEvent; 726 begin 727 LastHandler := Edit.OnChange; 728 Edit.OnChange := nil; 729 try 730 Edit.Text := Text; 731 finally 732 Edit.OnChange := LastHandler; 733 end; 734 end; 735 711 736 procedure TFormContact.EditFullNameChange(Sender: TObject); 712 begin 737 var 738 739 Before, First, Middle, Last, After: string; 740 begin 741 Contact.FullNameToNameParts(EditFullName.Text, Before, First, Middle, Last, After); 742 UpdateEditNoOnChange(EditTitleBefore, Before); 743 UpdateEditNoOnChange(EditFirstName, First); 744 UpdateEditNoOnChange(EditMiddleName, Middle); 745 UpdateEditNoOnChange(EditLastName, Last); 746 UpdateEditNoOnChange(EditTitleAfter, After); 713 747 UpdateInterface; 748 end; 749 750 procedure TFormContact.NamePartChange(Sender: TObject); 751 begin 752 UpdateEditNoOnChange(EditFullName, Contact.NamePartsToFullName(EditTitleBefore.Text, 753 EditFirstName.Text, EditMiddleName.Text, EditLastName.Text, EditTitleAfter.Text)); 714 754 end; 715 755 … … 732 772 733 773 procedure TFormContact.UpdateInterface; 734 begin 735 Caption := EditFullName.Text + ' - ' + SContact; 774 var 775 Title: string; 776 begin 777 Title := SContact; 778 if EditFullName.Text <> '' then Title := EditFullName.Text + ' - ' + Title 779 else 780 if EditOrganization.Text <> '' then Title := EditOrganization.Text + ' - ' + Title; 781 Caption := Title; 736 782 APhotoSave.Enabled := FPhoto.Used; 737 783 APhotoClear.Enabled := FPhoto.Used;
Note:
See TracChangeset
for help on using the changeset viewer.