Changeset 358 for trunk/Packages


Ignore:
Timestamp:
Dec 31, 2024, 11:06:34 AM (3 weeks ago)
Author:
chronos
Message:
  • Fixed: Missing toolbar and context menu images in FormList form.
  • Fixed: FormList remove minimal item count limit on items remove.
Location:
trunk/Packages/Common/Forms
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Packages/Common/Forms/FormList.lfm

    r355 r358  
    11object FormList: TFormList
    22  Left = 1040
    3   Height = 312
     3  Height = 300
    44  Top = 540
    5   Width = 417
     5  Width = 400
    66  Caption = 'List'
    7   ClientHeight = 312
    8   ClientWidth = 417
    9   DesignTimePPI = 125
     7  ClientHeight = 300
     8  ClientWidth = 400
     9  DesignTimePPI = 120
    1010  OnCreate = FormCreate
    1111  OnDestroy = FormDestroy
     
    1414  object ListView1: TListView
    1515    Left = 0
    16     Height = 279
     16    Height = 268
    1717    Top = 0
    18     Width = 417
     18    Width = 400
    1919    Align = alClient
    2020    Columns = <   
    2121      item
    2222        Caption = 'Name'
    23         Width = 405
     23        Width = 389
    2424      end>
    2525    MultiSelect = True
     
    4040  object ToolBar1: TToolBar
    4141    Left = 0
    42     Height = 33
    43     Top = 279
    44     Width = 417
     42    Top = 268
     43    Width = 400
    4544    Align = alBottom
    46     Images = Core.ImageListSmall
    4745    ParentFont = False
    4846    ParentShowHint = False
     
    5553    end
    5654    object ToolButton2: TToolButton
    57       Left = 31
     55      Left = 30
    5856      Top = 2
    5957      Action = AModify
    6058    end
    6159    object ToolButton3: TToolButton
    62       Left = 61
     60      Left = 59
    6361      Top = 2
    6462      Action = ARemove
    6563    end
    6664    object ToolButton4: TToolButton
    67       Left = 91
     65      Left = 88
    6866      Top = 2
    6967      Action = AClone
     
    7169  end
    7270  object ActionList1: TActionList
    73     Images = Core.ImageListSmall
    74     Left = 181
    75     Top = 141
     71    Left = 174
     72    Top = 133
    7673    object AAdd: TAction
    7774      Caption = 'Add'
    7875      ImageIndex = 16
    7976      OnExecute = AAddExecute
     77      ShortCut = 45
    8078    end
    8179    object AModify: TAction
     
    8381      ImageIndex = 6
    8482      OnExecute = AModifyExecute
     83      ShortCut = 13
    8584    end
    8685    object ARemove: TAction
     
    8887      ImageIndex = 18
    8988      OnExecute = ARemoveExecute
     89      ShortCut = 46
    9090    end
    9191    object AClone: TAction
     
    101101  end
    102102  object PopupMenu1: TPopupMenu
    103     Images = Core.ImageListSmall
    104     Left = 306
    105     Top = 139
     103    Left = 294
     104    Top = 133
    106105    object MenuItem1: TMenuItem
    107106      Action = AAdd
  • trunk/Packages/Common/Forms/FormList.pas

    r355 r358  
    4747      Selected: Boolean);
    4848  private
     49    FImages: TImageList;
    4950    FList: TBaseItemList;
     51    procedure SetImages(AValue: TImageList);
    5052    procedure SetList(AValue: TBaseItemList);
    5153    procedure UpdateListViewColumns;
     
    5658    procedure UpdateList;
    5759    property List: TBaseItemList read FList write SetList;
     60    property Images: TImageList read FImages write SetImages;
    5861  end;
    5962
     
    264267end;
    265268
     269procedure TFormList.SetImages(AValue: TImageList);
     270begin
     271  if FImages = AValue then Exit;
     272  FImages := AValue;
     273  ToolBar1.Images := FImages;
     274  PopupMenu1.Images := FImages;
     275end;
     276
    266277procedure TFormList.UpdateListViewColumns;
    267278var
     
    293304procedure TFormList.UpdateInterface;
    294305begin
    295   ARemove.Enabled := Assigned(FList) and Assigned(ListView1.Selected) and (List.Count > MinItemCount);
     306  ARemove.Enabled := Assigned(FList) and Assigned(ListView1.Selected) and ((List.Count - ListView1.SelCount) >= MinItemCount);
    296307  AModify.Enabled := Assigned(FList) and Assigned(ListView1.Selected);
    297308  AAdd.Enabled := Assigned(FList) and ((MaxItemCount = -1) or ((MaxItemCount <> -1) and (List.Count < MaxItemCount)));
Note: See TracChangeset for help on using the changeset viewer.