Ignore:
Timestamp:
Aug 16, 2024, 9:51:02 AM (3 months ago)
Author:
chronos
Message:
  • Modified: Show action icons in key shortcuts form.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/FormKeyShortcuts.pas

    r154 r155  
    55uses
    66  Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
    7   ComCtrls, ActnList, LCLProc, Menus, FormEx, Generics.Collections;
     7  ComCtrls, ActnList, LCLProc, Menus, FormEx, Generics.Collections, ImgList;
    88
    99type
     
    1919    procedure FormShow(Sender: TObject);
    2020    procedure MenuItem1Click(Sender: TObject);
     21  private
     22    function GetImageList: TCustomImageList;
     23    procedure SetImageList(AValue: TCustomImageList);
    2124  public
    2225    SourceComponents: TObjectList<TComponent>;
     26    MainForm: TForm;
    2327    procedure LoadFromComponent(C: TComponent);
     28    property ImageList: TCustomImageList read GetImageList write SetImageList;
    2429  end;
    2530
     
    2732implementation
    2833
    29 uses
    30   FormMain;
     34{$R *.lfm}
    3135
    3236resourcestring
     
    6771end;
    6872
     73function TFormKeyShortcuts.GetImageList: TCustomImageList;
     74begin
     75  Result := ListView1.SmallImages;
     76end;
     77
     78procedure TFormKeyShortcuts.SetImageList(AValue: TCustomImageList);
     79begin
     80  ListView1.SmallImages := AValue
     81end;
     82
    6983procedure TFormKeyShortcuts.LoadFromComponent(C: TComponent);
    7084var
     
    8498          NewItem.Data := TAction(Actions[I]);
    8599          with NewItem.SubItems do begin
    86             if C.Owner is TFormMain then Add(SMainForm)
     100            if C.Owner = MainForm then Add(SMainForm)
    87101            else if C.Owner is TDataModule then Add(SGlobal)
    88102            else if C.Owner is TForm then Add(TForm(C.Owner).Caption)
     
    96110end;
    97111
    98 initialization
    99   {$I FormKeyShortcuts.lrs}
    100 
    101112end.
    102113
Note: See TracChangeset for help on using the changeset viewer.