Ignore:
Timestamp:
May 4, 2016, 6:50:29 PM (9 years ago)
Author:
chronos
Message:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormCategories.pas

    r14 r20  
    3636    { private declarations }
    3737  public
     38    Categories: TAcronymCategories;
    3839    procedure UpdateList;
    3940    procedure UpdateInterface;
     
    5354  SCategory = 'Category';
    5455  SCategoryQuery = 'Enter name of category';
    55   SRemoveCategory = 'Remove category';
    56   SRemoveCategoryQuery = 'Do you really want to remove category?';
     56  SRemoveCategory = 'Remove categories';
     57  SRemoveCategoryQuery = 'Do you really want to remove selected categories?';
    5758  SCategoryAlreadyExists = 'Category %s already exists!';
    5859
     
    9596
    9697procedure TFormCategories.ARemoveExecute(Sender: TObject);
     98var
     99  I: Integer;
    97100begin
    98101  if Assigned(ListViewCategories.Selected) then begin
    99102    if MessageDlg(SRemoveCategory, SRemoveCategoryQuery,
    100103    TMsgDlgType.mtConfirmation, [mbCancel, mbOk], 0) = mrOk then begin
    101       FormMain.AcronymDb.Categories.Remove(ListViewCategories.Selected.Data);
     104      for I := ListViewCategories.Items.Count - 1 downto 0 do
     105      if ListViewCategories.Items[I].Selected then
     106        Categories.Remove(ListViewCategories.Items[I].Data);
    102107      UpdateList;
    103108    end;
Note: See TracChangeset for help on using the changeset viewer.