Changeset 85 for trunk/Packages/Common/LastOpenedList.pas
- Timestamp:
- Jun 7, 2024, 11:59:43 AM (5 months ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/Packages/Common/LastOpenedList.pas
r84 r85 1 unit ULastOpenedList; 2 3 {$mode delphi} 1 unit LastOpenedList; 4 2 5 3 interface 6 4 7 5 uses 8 Classes, SysUtils, Registry, URegistry, Menus, XMLConf, DOM;6 Classes, SysUtils, Registry, RegistryEx, Menus, XMLConf, DOM; 9 7 10 8 type … … 84 82 destructor TLastOpenedList.Destroy; 85 83 begin 86 Items.Free;84 FreeAndNil(Items); 87 85 inherited; 88 86 end; … … 94 92 begin 95 93 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; 97 100 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; 102 103 end; 103 104 end; … … 193 194 194 195 end. 195
Note:
See TracChangeset
for help on using the changeset viewer.