Ignore:
Timestamp:
Feb 14, 2022, 5:43:30 PM (3 years ago)
Author:
chronos
Message:
  • Added: Synced edit of full name and name parts.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormContact.pas

    r108 r109  
    735735
    736736procedure TFormContact.EditFullNameChange(Sender: TObject);
    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);
    747   UpdateInterface;
     737begin
     738  with TNameDetails.Create do
     739  try
     740    Prefix := EditTitleBefore.Text;
     741    First := EditFirstName.Text;
     742    Middle := EditMiddleName.Text;
     743    Last := EditLastName.Text;
     744    Suffix := EditTitleAfter.Text;
     745    Split(EditFullName.Text);
     746    UpdateEditNoOnChange(EditTitleBefore, Prefix);
     747    UpdateEditNoOnChange(EditFirstName, First);
     748    UpdateEditNoOnChange(EditMiddleName, Middle);
     749    UpdateEditNoOnChange(EditLastName, Last);
     750    UpdateEditNoOnChange(EditTitleAfter, Suffix);
     751    UpdateInterface;
     752  finally
     753    Free;
     754  end;
    748755end;
    749756
    750757procedure TFormContact.NamePartChange(Sender: TObject);
    751758begin
    752   UpdateEditNoOnChange(EditFullName, Contact.NamePartsToFullName(EditTitleBefore.Text,
    753     EditFirstName.Text, EditMiddleName.Text, EditLastName.Text, EditTitleAfter.Text));
     759  with TNameDetails.Create do
     760  try
     761    Prefix := EditTitleBefore.Text;
     762    First := EditFirstName.Text;
     763    Middle := EditMiddleName.Text;
     764    Last := EditLastName.Text;
     765    Suffix := EditTitleAfter.Text;
     766    UpdateEditNoOnChange(EditFullName, GetCombined);
     767  finally
     768    Free;
     769  end;
    754770end;
    755771
Note: See TracChangeset for help on using the changeset viewer.