Changeset 318 for trunk/Forms/FormKeyShortcuts.pas
- Timestamp:
- Jun 21, 2024, 3:20:20 PM (5 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/FormKeyShortcuts.pas
r317 r318 5 5 uses 6 6 Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs, 7 ComCtrls, ActnList, LCLProc, Menus, FormEx ;7 ComCtrls, ActnList, LCLProc, Menus, FormEx, Generics.Collections; 8 8 9 9 type … … 15 15 MenuItem1: TMenuItem; 16 16 PopupMenu1: TPopupMenu; 17 procedure FormCreate(Sender: TObject); 18 procedure FormDestroy(Sender: TObject); 17 19 procedure FormShow(Sender: TObject); 18 20 procedure MenuItem1Click(Sender: TObject); 19 21 public 22 SourceComponents: TObjectList<TComponent>; 20 23 procedure LoadFromComponent(C: TComponent); 21 24 end; … … 25 28 26 29 uses 27 FormMain , Core;30 FormMain; 28 31 29 32 resourcestring … … 34 37 35 38 procedure TFormKeyShortcuts.FormShow(Sender: TObject); 39 var 40 I: Integer; 36 41 begin 37 42 try 38 43 ListView1.BeginUpdate; 39 44 ListView1.Clear; 40 LoadFromComponent(Core.Core);41 LoadFromComponent(Core.Core.FormMain);45 for I := 0 to SourceComponents.Count - 1 do 46 LoadFromComponent(SourceComponents[I]); 42 47 finally 43 48 ListView1.EndUpdate; 44 49 end; 50 end; 51 52 procedure TFormKeyShortcuts.FormCreate(Sender: TObject); 53 begin 54 SourceComponents := TObjectList<TComponent>.Create; 55 SourceComponents.OwnsObjects := False; 56 end; 57 58 procedure TFormKeyShortcuts.FormDestroy(Sender: TObject); 59 begin 60 FreeAndNil(SourceComponents); 45 61 end; 46 62
Note:
See TracChangeset
for help on using the changeset viewer.