Changeset 108 for trunk/Forms/UFormProperties.pas
- Timestamp:
- Feb 11, 2022, 11:31:42 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.