Ignore:
Timestamp:
Aug 8, 2016, 1:41:25 PM (8 years ago)
Author:
chronos
Message:
  • Modified: Non-visual code moved from FormMain to Core data module.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormCategories.pas

    r85 r86  
    5353
    5454uses
    55   UFormMain;
     55  UCore;
    5656
    5757resourcestring
     
    7575  S := InputBox(SCategory, SCategoryQuery, '');
    7676  if S <> '' then begin
    77     if not Assigned(FormMain.AcronymDb.Categories.SearchByName(S)) then begin;
    78       TAcronymCategory(FormMain.AcronymDb.Categories[FormMain.AcronymDb.Categories.Add(TAcronymCategory.Create)]).Name := S;
    79       FormMain.AcronymDb.Modified := True;
     77    if not Assigned(Core.AcronymDb.Categories.SearchByName(S)) then begin;
     78      TAcronymCategory(Core.AcronymDb.Categories[Core.AcronymDb.Categories.Add(TAcronymCategory.Create)]).Name := S;
     79      Core.AcronymDb.Modified := True;
    8080      UpdateList;
    8181    end else ShowMessage(Format(SCategoryAlreadyExists, [S]));
     
    9090    S := InputBox(SCategory, SCategoryQuery, ListViewCategories.Selected.Caption);
    9191    if S <> ListViewCategories.Selected.Caption then begin
    92       if not Assigned(FormMain.AcronymDb.Categories.SearchByName(S)) then begin;
     92      if not Assigned(Core.AcronymDb.Categories.SearchByName(S)) then begin;
    9393        TAcronymCategory(ListViewCategories.Selected.Data).Name := S;
    94         FormMain.AcronymDb.Modified := True;
     94        Core.AcronymDb.Modified := True;
    9595        UpdateList;
    9696      end else ShowMessage(Format(SCategoryAlreadyExists, [S]));
     
    124124procedure TFormCategories.ListViewCategoriesData(Sender: TObject; Item: TListItem);
    125125begin
    126   if Item.Index < FormMain.AcronymDb.Categories.Count then
    127   with TAcronymCategory(FormMain.AcronymDb.Categories[Item.Index]) do begin
     126  if Item.Index < Core.AcronymDb.Categories.Count then
     127  with TAcronymCategory(Core.AcronymDb.Categories[Item.Index]) do begin
    128128    Item.Caption := Name;
    129     Item.Data := FormMain.AcronymDb.Categories[Item.Index];
     129    Item.Data := Core.AcronymDb.Categories[Item.Index];
    130130    Item.SubItems.Add(IntToStr(AcronymMeanings.Count));
    131131  end;
     
    151151procedure TFormCategories.UpdateList;
    152152begin
    153   ListViewCategories.Items.Count := FormMain.AcronymDb.Categories.Count;
     153  ListViewCategories.Items.Count := Core.AcronymDb.Categories.Count;
    154154  ListViewCategories.Refresh;
    155155  UpdateInterface;
Note: See TracChangeset for help on using the changeset viewer.