Changeset 131 for trunk/Packages/Common/ULastOpenedList.pas
- Timestamp:
- Mar 18, 2022, 1:37:03 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Packages/Common/ULastOpenedList.pas
r122 r131 30 30 procedure SaveToXMLConfig(XMLConfig: TXMLConfig; Path: string); 31 31 procedure AddItem(FileName: string); 32 function GetFirstFileName: string; 32 33 published 33 34 property MaxCount: Integer read FMaxCount write SetMaxCount; … … 83 84 destructor TLastOpenedList.Destroy; 84 85 begin 85 Items.Free;86 FreeAndNil(Items); 86 87 inherited; 87 88 end; … … 93 94 begin 94 95 if Assigned(MenuItem) then begin 95 MenuItem.Clear; 96 while MenuItem.Count > Items.Count do 97 MenuItem.Delete(MenuItem.Count - 1); 98 while MenuItem.Count < Items.Count do begin 99 NewMenuItem := TMenuItem.Create(MenuItem); 100 MenuItem.Add(NewMenuItem); 101 end; 96 102 for I := 0 to Items.Count - 1 do begin 97 NewMenuItem := TMenuItem.Create(MenuItem); 98 NewMenuItem.Caption := Items[I]; 99 NewMenuItem.OnClick := ClickAction; 100 MenuItem.Add(NewMenuItem); 103 MenuItem.Items[I].Caption := Items[I]; 104 MenuItem.Items[I].OnClick := ClickAction; 101 105 end; 102 106 end; … … 185 189 end; 186 190 191 function TLastOpenedList.GetFirstFileName: string; 192 begin 193 if Items.Count > 0 then Result := Items[0] 194 else Result := ''; 195 end; 196 187 197 end. 188 198
Note:
See TracChangeset
for help on using the changeset viewer.