Changeset 86 for trunk/Forms/UFormCategories.pas
- Timestamp:
- Aug 8, 2016, 1:41:25 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormCategories.pas
r85 r86 53 53 54 54 uses 55 U FormMain;55 UCore; 56 56 57 57 resourcestring … … 75 75 S := InputBox(SCategory, SCategoryQuery, ''); 76 76 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; 80 80 UpdateList; 81 81 end else ShowMessage(Format(SCategoryAlreadyExists, [S])); … … 90 90 S := InputBox(SCategory, SCategoryQuery, ListViewCategories.Selected.Caption); 91 91 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; 93 93 TAcronymCategory(ListViewCategories.Selected.Data).Name := S; 94 FormMain.AcronymDb.Modified := True;94 Core.AcronymDb.Modified := True; 95 95 UpdateList; 96 96 end else ShowMessage(Format(SCategoryAlreadyExists, [S])); … … 124 124 procedure TFormCategories.ListViewCategoriesData(Sender: TObject; Item: TListItem); 125 125 begin 126 if Item.Index < FormMain.AcronymDb.Categories.Count then127 with TAcronymCategory( FormMain.AcronymDb.Categories[Item.Index]) do begin126 if Item.Index < Core.AcronymDb.Categories.Count then 127 with TAcronymCategory(Core.AcronymDb.Categories[Item.Index]) do begin 128 128 Item.Caption := Name; 129 Item.Data := FormMain.AcronymDb.Categories[Item.Index];129 Item.Data := Core.AcronymDb.Categories[Item.Index]; 130 130 Item.SubItems.Add(IntToStr(AcronymMeanings.Count)); 131 131 end; … … 151 151 procedure TFormCategories.UpdateList; 152 152 begin 153 ListViewCategories.Items.Count := FormMain.AcronymDb.Categories.Count;153 ListViewCategories.Items.Count := Core.AcronymDb.Categories.Count; 154 154 ListViewCategories.Refresh; 155 155 UpdateInterface;
Note:
See TracChangeset
for help on using the changeset viewer.