Ignore:
Timestamp:
Apr 25, 2022, 6:22:53 PM (3 years ago)
Author:
chronos
Message:
  • Modified: Update Common package to version 0.10.
  • Modified: fgl unit replaced by Generics.Collections.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Packages/Common/ULastOpenedList.pas

    r423 r424  
    8282destructor TLastOpenedList.Destroy;
    8383begin
    84   Items.Free;
     84  FreeAndNil(Items);
    8585  inherited;
    8686end;
     
    9292begin
    9393  if Assigned(MenuItem) then begin
    94     MenuItem.Clear;
     94    while MenuItem.Count > Items.Count do
     95      MenuItem.Delete(MenuItem.Count - 1);
     96    while MenuItem.Count < Items.Count do begin
     97      NewMenuItem := TMenuItem.Create(MenuItem);
     98      MenuItem.Add(NewMenuItem);
     99    end;
    95100    for I := 0 to Items.Count - 1 do begin
    96       NewMenuItem := TMenuItem.Create(MenuItem);
    97       NewMenuItem.Caption := Items[I];
    98       NewMenuItem.OnClick := ClickAction;
    99       MenuItem.Add(NewMenuItem);
     101      MenuItem.Items[I].Caption := Items[I];
     102      MenuItem.Items[I].OnClick := ClickAction;
    100103    end;
    101104  end;
Note: See TracChangeset for help on using the changeset viewer.