Changeset 14 for trunk/UFormMain.pas


Ignore:
Timestamp:
Apr 28, 2016, 10:56:31 PM (9 years ago)
Author:
chronos
Message:
  • Added: Window for acronym categories management. There acronyms can be added, modifed and removed.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UFormMain.pas

    r13 r14  
    1919    AAcronymRemove: TAction;
    2020    AAcronymRemoveAll: TAction;
     21    AShowCategories: TAction;
    2122    ASettings: TAction;
    2223    AFileSaveAs: TAction;
     
    4546    MenuItem18: TMenuItem;
    4647    MenuItem19: TMenuItem;
     48    MenuItem20: TMenuItem;
     49    MenuItem21: TMenuItem;
    4750    MenuItemOpenRecent: TMenuItem;
    4851    MenuItem2: TMenuItem;
     
    7275    procedure AImportExecute(Sender: TObject);
    7376    procedure ASettingsExecute(Sender: TObject);
     77    procedure AShowCategoriesExecute(Sender: TObject);
    7478    procedure AShowExecute(Sender: TObject);
    7579    procedure EditSearchChange(Sender: TObject);
     
    111115
    112116uses
    113   UFormImport, UFormAcronym, UFormSettings;
     117  UFormImport, UFormAcronym, UFormSettings, UFormCategories;
    114118
    115119resourcestring
     
    230234  TempCategories: TStringList;
    231235  Meaning: TAcronymMeaning;
     236  I: Integer;
    232237begin
    233238  if Assigned(ListViewAcronyms.Selected) then
     
    252257        Meaning.Description := TempEntry.Description;
    253258        Meaning.Categories.AssignFromStrings(TempEntry.Categories);
     259        for I := 0 to Meaning.Categories.Count - 1 do
     260          TAcronymCategory(Meaning.Categories.Items[I]).AcronymMeanings.Add(Meaning);
    254261        UpdateAcronymsList;
    255262        UpdateInterface;
     
    289296  TempEntry: TAcronymEntry;
    290297  Meaning: TAcronymMeaning;
     298  I: Integer;
    291299begin
    292300  TempEntry := TAcronymEntry.Create;
     
    300308    Meaning.Description := TempEntry.Description;
    301309    Meaning.Categories.AssignFromStrings(TempEntry.Categories);
     310    for I := 0 to Meaning.Categories.Count - 1 do
     311      TAcronymCategory(Meaning.Categories.Items[I]).AcronymMeanings.Add(Meaning);
    302312    UpdateAcronymsList;
    303313    UpdateInterface;
     
    318328  if FormSettings.ShowModal = mrOk then
    319329    FormSettings.Save;
     330end;
     331
     332procedure TFormMain.AShowCategoriesExecute(Sender: TObject);
     333begin
     334  FormCategories.ShowModal;
    320335end;
    321336
     
    440455  EditSearch.Enabled := Assigned(AcronymDb);
    441456  AImport.Enabled := Assigned(AcronymDb);
     457  AShowCategories.Enabled := Assigned(AcronymDb);
    442458
    443459  Title := Application.Title;
Note: See TracChangeset for help on using the changeset viewer.