Changeset 227 for trunk/Forms/FormCategories.pas
- Timestamp:
- Jan 20, 2025, 11:38:55 AM (42 hours ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/FormCategories.pas
r219 r227 51 51 procedure ListViewSort1Filter(ListViewSort: TListViewSort); 52 52 public 53 AcronymDb: TAcronymDb; 53 54 Categories: TAcronymCategories; 54 55 procedure UpdateList; … … 60 61 61 62 {$R *.lfm} 62 63 uses64 Core;65 63 66 64 resourcestring … … 76 74 begin 77 75 UpdateList; 78 Core.Core.ScaleDPI1.ScaleControl(ToolBar1, Core.Core.ScaleDPI1.DesignDPI);76 ScaleDPI.ScaleControl(ToolBar1, ScaleDPI.DesignDPI); 79 77 end; 80 78 … … 84 82 if Assigned(Item) and (Change = ctState) then begin 85 83 TAcronymCategory(Item.Data).Enabled := Item.Checked; 86 Core.Core.AcronymDb.Modified := True;84 AcronymDb.Modified := True; 87 85 end; 88 86 end; … … 94 92 S := InputBox(SCategory, SCategoryQuery, ''); 95 93 if S <> '' then begin 96 if not Assigned( Core.Core.AcronymDb.Categories.SearchByName(S)) then begin;97 TAcronymCategory( Core.Core.AcronymDb.Categories[Core.Core.AcronymDb.Categories.Add(TAcronymCategory.Create)]).Name := S;98 Core.Core.AcronymDb.Modified := True;99 Core.Core.AcronymDb.Update;94 if not Assigned(AcronymDb.Categories.SearchByName(S)) then begin; 95 TAcronymCategory(AcronymDb.Categories[AcronymDb.Categories.Add(TAcronymCategory.Create)]).Name := S; 96 AcronymDb.Modified := True; 97 AcronymDb.Update; 100 98 UpdateList; 101 99 end else ShowMessage(Format(SCategoryAlreadyExists, [S])); … … 110 108 if ListViewCategories.Items[I].Selected then begin 111 109 TAcronymCategory(ListViewCategories.Items[I].Data).Enabled := False; 112 Core.Core.AcronymDb.Modified := True;110 AcronymDb.Modified := True; 113 111 end; 114 112 UpdateList; … … 122 120 if ListViewCategories.Items[I].Selected then begin 123 121 TAcronymCategory(ListViewCategories.Items[I].Data).Enabled := True; 124 Core.Core.AcronymDb.Modified := True;122 AcronymDb.Modified := True; 125 123 end; 126 124 UpdateList; … … 134 132 S := InputBox(SCategory, SCategoryQuery, ListViewCategories.Selected.Caption); 135 133 if S <> ListViewCategories.Selected.Caption then begin 136 if not Assigned( Core.Core.AcronymDb.Categories.SearchByName(S)) then begin;134 if not Assigned(AcronymDb.Categories.SearchByName(S)) then begin; 137 135 TAcronymCategory(ListViewCategories.Selected.Data).Name := S; 138 Core.Core.AcronymDb.Modified := True;139 Core.Core.AcronymDb.Update;136 AcronymDb.Modified := True; 137 AcronymDb.Update; 140 138 UpdateList; 141 139 end else ShowMessage(Format(SCategoryAlreadyExists, [S])); … … 221 219 procedure TFormCategories.ListViewSort1Filter(ListViewSort: TListViewSort); 222 220 begin 223 Core.Core.AcronymDb.Categories.AssignToList(ListViewSort1.List);221 AcronymDb.Categories.AssignToList(ListViewSort1.List); 224 222 end; 225 223 … … 227 225 begin 228 226 ListViewSort1.Refresh; 229 ListViewCategories.Items.Count := Core.Core.AcronymDb.Categories.Count;227 ListViewCategories.Items.Count := AcronymDb.Categories.Count; 230 228 ListViewCategories.Refresh; 231 229 UpdateInterface;
Note:
See TracChangeset
for help on using the changeset viewer.