Ignore:
Timestamp:
Jun 21, 2024, 3:20:20 PM (5 months ago)
Author:
chronos
Message:
  • Modified: Code cleanup.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/FormKeyShortcuts.pas

    r317 r318  
    55uses
    66  Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
    7   ComCtrls, ActnList, LCLProc, Menus, FormEx;
     7  ComCtrls, ActnList, LCLProc, Menus, FormEx, Generics.Collections;
    88
    99type
     
    1515    MenuItem1: TMenuItem;
    1616    PopupMenu1: TPopupMenu;
     17    procedure FormCreate(Sender: TObject);
     18    procedure FormDestroy(Sender: TObject);
    1719    procedure FormShow(Sender: TObject);
    1820    procedure MenuItem1Click(Sender: TObject);
    1921  public
     22    SourceComponents: TObjectList<TComponent>;
    2023    procedure LoadFromComponent(C: TComponent);
    2124  end;
     
    2528
    2629uses
    27   FormMain, Core;
     30  FormMain;
    2831
    2932resourcestring
     
    3437
    3538procedure TFormKeyShortcuts.FormShow(Sender: TObject);
     39var
     40  I: Integer;
    3641begin
    3742  try
    3843    ListView1.BeginUpdate;
    3944    ListView1.Clear;
    40     LoadFromComponent(Core.Core);
    41     LoadFromComponent(Core.Core.FormMain);
     45    for I := 0 to SourceComponents.Count - 1 do
     46      LoadFromComponent(SourceComponents[I]);
    4247  finally
    4348    ListView1.EndUpdate;
    4449  end;
     50end;
     51
     52procedure TFormKeyShortcuts.FormCreate(Sender: TObject);
     53begin
     54  SourceComponents := TObjectList<TComponent>.Create;
     55  SourceComponents.OwnsObjects := False;
     56end;
     57
     58procedure TFormKeyShortcuts.FormDestroy(Sender: TObject);
     59begin
     60  FreeAndNil(SourceComponents);
    4561end;
    4662
Note: See TracChangeset for help on using the changeset viewer.