Ignore:
Timestamp:
Jun 19, 2024, 11:15:44 PM (5 months ago)
Author:
chronos
Message:
  • Modified: Updated Common package.
File:
1 moved

Legend:

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

    r314 r315  
    1 unit ULastOpenedList;
    2 
    3 {$mode delphi}
     1unit LastOpenedList;
    42
    53interface
    64
    75uses
    8   Classes, SysUtils, Registry, URegistry, Menus, XMLConf, DOM;
     6  Classes, SysUtils, Registry, RegistryEx, Menus, XMLConf, DOM;
    97
    108type
     
    8482destructor TLastOpenedList.Destroy;
    8583begin
    86   Items.Free;
     84  FreeAndNil(Items);
    8785  inherited;
    8886end;
     
    9492begin
    9593  if Assigned(MenuItem) then begin
    96     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;
    97100    for I := 0 to Items.Count - 1 do begin
    98       NewMenuItem := TMenuItem.Create(MenuItem);
    99       NewMenuItem.Caption := Items[I];
    100       NewMenuItem.OnClick := ClickAction;
    101       MenuItem.Add(NewMenuItem);
     101      MenuItem.Items[I].Caption := Items[I];
     102      MenuItem.Items[I].OnClick := ClickAction;
    102103    end;
    103104  end;
     
    193194
    194195end.
    195 
Note: See TracChangeset for help on using the changeset viewer.