Changeset 108 for trunk/Forms
- Timestamp:
- Feb 11, 2022, 11:31:42 AM (3 years ago)
- Location:
- trunk/Forms
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormContact.lfm
r103 r108 43 43 Top = 75 44 44 Width = 161 45 OnChange = NamePartChange 45 46 ParentFont = False 46 47 TabOrder = 1 … … 95 96 end 96 97 object EditLastName: TEdit 97 Left = 69998 Left = 700 98 99 Height = 43 99 100 Top = 75 100 101 Width = 161 102 OnChange = NamePartChange 101 103 ParentFont = False 102 104 TabOrder = 2 … … 167 169 Top = 125 168 170 Width = 161 171 OnChange = NamePartChange 169 172 ParentFont = False 170 173 TabOrder = 4 … … 179 182 end 180 183 object EditTitleBefore: TEdit 181 Left = 37 5184 Left = 376 182 185 Height = 43 183 186 Top = 175 184 187 Width = 161 188 OnChange = NamePartChange 185 189 ParentFont = False 186 190 TabOrder = 5 … … 199 203 Top = 175 200 204 Width = 161 205 OnChange = NamePartChange 201 206 ParentFont = False 202 207 TabOrder = 6 … … 699 704 Width = 920 700 705 Caption = 'Address' 701 ClientHeight = 2 55706 ClientHeight = 281 702 707 ClientWidth = 918 703 708 TabOrder = 9 -
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; -
trunk/Forms/UFormContacts.pas
r104 r108 260 260 Selected: Boolean; 261 261 begin 262 if not ListView1.HandleAllocated then Exit; 263 262 264 Selected := Assigned(ListView1.Selected); 263 265 AAdd.Enabled := Assigned(Contacts); -
trunk/Forms/UFormMain.lfm
r90 r108 1 1 object FormMain: TFormMain 2 Left = 6012 Left = 553 3 3 Height = 829 4 Top = 4 474 Top = 401 5 5 Width = 1227 6 6 Caption = 'vCard Studio' -
trunk/Forms/UFormProperties.pas
r104 r108 65 65 private 66 66 FProperties: TContactProperties; 67 FUpdateCount: Integer; 67 68 procedure FilterList(List: TFPGObjectList<TObject>); 68 69 procedure SetProperties(AValue: TContactProperties); 70 procedure DoUpdateInterface; 69 71 public 70 72 property Properties: TContactProperties read FProperties write SetProperties; 71 73 procedure ReloadList; 74 procedure BeginUpdate; 75 procedure EndUpdate; 72 76 procedure UpdateInterface; 73 77 end; … … 93 97 STextFiles = 'Text files'; 94 98 SValue = 'Value'; 99 SEndUpdateTooLow = 'Update counter error'; 95 100 96 101 const … … 365 370 end; 366 371 367 procedure TFormProperties.UpdateInterface; 372 procedure TFormProperties.BeginUpdate; 373 begin 374 Inc(FUpdateCount); 375 end; 376 377 procedure TFormProperties.EndUpdate; 378 begin 379 if FUpdateCount <= 0 then raise Exception(SEndUpdateTooLow); 380 Dec(FUpdateCount); 381 if FUpdateCount = 0 then DoUpdateInterface; 382 end; 383 384 procedure TFormProperties.DoUpdateInterface; 368 385 var 369 386 Text: string; … … 371 388 Selected: Boolean; 372 389 begin 390 if not ListView1.HandleAllocated then Exit; 391 373 392 Selected := Assigned(ListView1.Selected); 374 393 AAdd.Enabled := Assigned(Properties); … … 392 411 end; 393 412 413 procedure TFormProperties.UpdateInterface; 414 begin 415 if FUpdateCount = 0 then DoUpdateInterface; 416 end; 417 394 418 end. 395 419
Note:
See TracChangeset
for help on using the changeset viewer.