Changeset 155 for trunk/Forms


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

Legend:

Unmodified
Added
Removed
  • trunk/Forms/FormKeyShortcuts.lfm

    r154 r155  
    3232        Width = 127
    3333      end>
    34     LargeImages = Core.ImageListLarge
    3534    PopupMenu = PopupMenu1
    3635    ReadOnly = True
    3736    RowSelect = True
    38     SmallImages = Core.ImageListSmall
    3937    TabOrder = 0
    4038    ViewStyle = vsReport
  • 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
  • trunk/Forms/FormMain.pas

    r154 r155  
    513513begin
    514514  if not Assigned(FormKeyShortcuts) then FormKeyShortcuts := TFormKeyShortcuts.Create(nil);
     515  FormKeyShortcuts.ImageList := Core.Core.ImageListMain;
     516  FormKeyShortcuts.MainForm := Self;
    515517  FormKeyShortcuts.SourceComponents.Clear;
    516518  FormKeyShortcuts.SourceComponents.Add(Self);
Note: See TracChangeset for help on using the changeset viewer.