Changeset 219 for trunk/Forms
- Timestamp:
- Jan 17, 2025, 9:05:54 PM (5 days ago)
- Location:
- trunk/Forms
- Files:
-
- 42 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/FormAcronym.lfm
r218 r219 1 1 object FormAcronym: TFormAcronym 2 2 Left = 845 3 Height = 7444 Top = 5285 Width = 8583 Height = 893 4 Top = 480 5 Width = 1030 6 6 Caption = 'Acronym' 7 ClientHeight = 744 8 ClientWidth = 858 9 DesignTimePPI = 120 10 OnClose = FormClose 11 OnCreate = FormCreate 7 ClientHeight = 893 8 ClientWidth = 1030 9 DesignTimePPI = 144 12 10 OnShow = FormShow 13 11 Position = poScreenCenter 14 LCLVersion = ' 2.0.2.0'12 LCLVersion = '3.6.0.0' 15 13 object Label1: TLabel 16 Left = 1 017 Height = 2 018 Top = 2 019 Width = 4314 Left = 12 15 Height = 26 16 Top = 24 17 Width = 56 20 18 Caption = 'Name:' 21 19 ParentColor = False … … 23 21 end 24 22 object EditAcronym: TEdit 25 Left = 191 26 Height = 28 27 Top = 19 28 Width = 652 29 Anchors = [akTop, akLeft, akRight] 30 OnKeyPress = EditMeaningKeyPress 23 Left = 229 24 Height = 43 25 Top = 23 26 Width = 783 27 Anchors = [akTop, akLeft, akRight] 31 28 ParentFont = False 32 29 TabOrder = 0 30 OnKeyPress = EditMeaningKeyPress 33 31 end 34 32 object Label2: TLabel 35 Left = 1 036 Height = 2 037 Top = 6138 Width = 6133 Left = 12 34 Height = 26 35 Top = 73 36 Width = 79 39 37 Caption = 'Meaning:' 40 38 ParentColor = False … … 42 40 end 43 41 object EditMeaning: TEdit 44 Left = 191 45 Height = 28 46 Top = 61 47 Width = 652 48 Anchors = [akTop, akLeft, akRight] 49 OnKeyPress = EditMeaningKeyPress 42 Left = 229 43 Height = 43 44 Top = 73 45 Width = 783 46 Anchors = [akTop, akLeft, akRight] 50 47 ParentFont = False 51 48 TabOrder = 1 49 OnKeyPress = EditMeaningKeyPress 52 50 end 53 51 object ButtonOk: TButton 54 Left = 73355 Height = 3 156 Top = 69457 Width = 9452 Left = 880 53 Height = 37 54 Top = 833 55 Width = 113 58 56 Anchors = [akRight, akBottom] 59 57 Caption = 'Ok' 60 58 ModalResult = 1 61 OnKeyPress = EditMeaningKeyPress62 59 ParentFont = False 63 60 TabOrder = 7 61 OnKeyPress = EditMeaningKeyPress 64 62 end 65 63 object ButtonCancel: TButton 66 Left = 61367 Height = 3 168 Top = 69469 Width = 9464 Left = 736 65 Height = 37 66 Top = 833 67 Width = 113 70 68 Anchors = [akRight, akBottom] 71 69 Caption = 'Cancel' 72 70 ModalResult = 2 73 OnKeyPress = EditMeaningKeyPress74 71 ParentFont = False 75 72 TabOrder = 6 73 OnKeyPress = EditMeaningKeyPress 76 74 end 77 75 object Label3: TLabel 78 Left = 1 079 Height = 2 080 Top = 1 1081 Width = 7976 Left = 12 77 Height = 26 78 Top = 132 79 Width = 102 82 80 Caption = 'Description:' 83 81 ParentColor = False … … 85 83 end 86 84 object MemoDescription: TMemo 87 Left = 191 88 Height = 142 89 Top = 110 90 Width = 652 91 Anchors = [akTop, akLeft, akRight] 92 OnKeyPress = EditMeaningKeyPress 85 Left = 229 86 Height = 170 87 Top = 132 88 Width = 783 89 Anchors = [akTop, akLeft, akRight] 93 90 ParentFont = False 94 91 ScrollBars = ssAutoBoth 95 92 TabOrder = 2 93 OnKeyPress = EditMeaningKeyPress 96 94 end 97 95 object Label4: TLabel 98 Left = 1 599 Height = 2 0100 Top = 260101 Width = 7496 Left = 18 97 Height = 26 98 Top = 312 99 Width = 95 102 100 Caption = 'Categories:' 103 101 ParentColor = False … … 105 103 end 106 104 object ListBoxCategories: TListBox 107 Left = 191108 Height = 176109 Top = 260110 Width = 651105 Left = 229 106 Height = 211 107 Top = 312 108 Width = 782 111 109 Anchors = [akTop, akLeft, akRight] 112 110 ItemHeight = 0 113 111 MultiSelect = True 114 OnKeyPress = EditMeaningKeyPress115 OnSelectionChange = ListBoxCategoriesSelectionChange116 112 ParentFont = False 117 113 PopupMenu = PopupMenuCategory 118 114 ScrollWidth = 518 119 115 TabOrder = 3 116 TopIndex = -1 117 OnKeyPress = EditMeaningKeyPress 118 OnSelectionChange = ListBoxCategoriesSelectionChange 120 119 end 121 120 object Button1: TButton 122 Left = 191123 Height = 3 1124 Top = 450125 Width = 1 09121 Left = 229 122 Height = 37 123 Top = 540 124 Width = 131 126 125 Action = ACategoryAdd 127 OnKeyPress = EditMeaningKeyPress128 126 ParentFont = False 129 127 TabOrder = 4 128 OnKeyPress = EditMeaningKeyPress 130 129 end 131 130 object Button2: TButton 132 Left = 320 133 Height = 31 134 Top = 450 131 Left = 384 132 Height = 37 133 Top = 540 134 Width = 156 135 Action = ACategoryRemove 136 ParentFont = False 137 TabOrder = 5 138 OnKeyPress = EditMeaningKeyPress 139 end 140 object Label5: TLabel 141 Left = 12 142 Height = 26 143 Top = 588 135 144 Width = 130 136 Action = ACategoryRemove137 OnKeyPress = EditMeaningKeyPress138 ParentFont = False139 TabOrder = 5140 end141 object Label5: TLabel142 Left = 10143 Height = 20144 Top = 490145 Width = 101146 145 Caption = 'Imported from:' 147 146 ParentColor = False … … 149 148 end 150 149 object ListBoxImportSources: TListBox 151 Left = 191152 Height = 1 40153 Top = 490154 Width = 652150 Left = 229 151 Height = 168 152 Top = 588 153 Width = 783 155 154 Anchors = [akTop, akLeft, akRight] 156 155 ItemHeight = 0 157 156 MultiSelect = True 158 OnKeyPress = EditMeaningKeyPress159 OnSelectionChange = ListBoxCategoriesSelectionChange160 157 ParentFont = False 161 158 ScrollWidth = 519 162 159 TabOrder = 8 160 TopIndex = -1 161 OnKeyPress = EditMeaningKeyPress 162 OnSelectionChange = ListBoxCategoriesSelectionChange 163 163 end 164 164 object ActionList1: TActionList 165 left = 451166 top = 300165 Left = 541 166 Top = 360 167 167 object ACategoryRemove: TAction 168 168 Caption = 'Remove' … … 177 177 end 178 178 object PopupMenuCategory: TPopupMenu 179 left = 240180 top = 305179 Left = 288 180 Top = 366 181 181 object MenuItem2: TMenuItem 182 182 Action = ACategoryAdd -
trunk/Forms/FormAcronym.pas
r218 r219 1 unit UFormAcronym; 2 3 {$mode delphi} 1 unit FormAcronym; 4 2 5 3 interface … … 7 5 uses 8 6 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, Menus, 9 StdCtrls, ActnList, UAcronym;7 StdCtrls, ActnList, Acronym, FormEx; 10 8 11 9 type … … 13 11 { TFormAcronym } 14 12 15 TFormAcronym = class(TForm )13 TFormAcronym = class(TFormEx) 16 14 ACategoryRemove: TAction; 17 15 ACategoryAdd: TAction; … … 37 35 procedure ACategoryRemoveExecute(Sender: TObject); 38 36 procedure EditMeaningKeyPress(Sender: TObject; var Key: char); 39 procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);40 procedure FormCreate(Sender: TObject);41 37 procedure FormShow(Sender: TObject); 42 38 procedure ListBoxCategoriesSelectionChange(Sender: TObject; User: boolean); … … 48 44 end; 49 45 50 var51 FormAcronym: TFormAcronym;52 46 53 47 implementation … … 56 50 57 51 uses 58 UCore, UFormCategorySelect;52 FormCategorySelect; 59 53 60 54 { TFormAcronym } 61 62 procedure TFormAcronym.FormClose(Sender: TObject; var CloseAction: TCloseAction63 );64 begin65 Core.PersistentForm1.Save(Self);66 end;67 68 procedure TFormAcronym.FormCreate(Sender: TObject);69 begin70 Core.Translator.TranslateComponentRecursive(Self);71 Core.ThemeManager.UseTheme(Self);72 end;73 55 74 56 procedure TFormAcronym.ACategoryAddExecute(Sender: TObject); 75 57 var 76 58 I: Integer; 59 FormCategorySelect: TFormCategorySelect; 77 60 begin 78 61 FormCategorySelect := TFormCategorySelect.Create(Self); … … 111 94 procedure TFormAcronym.FormShow(Sender: TObject); 112 95 begin 113 Core.PersistentForm1.Load(Self);114 96 UpdateInterface; 115 97 end; -
trunk/Forms/FormAcronyms.lfm
r218 r219 1 1 object FormAcronyms: TFormAcronyms 2 Left = 4263 Height = 5584 Top = 2 515 Width = 7402 Left = 755 3 Height = 670 4 Top = 284 5 Width = 888 6 6 Caption = 'Acronyms' 7 ClientHeight = 558 8 ClientWidth = 740 9 DesignTimePPI = 120 10 OnClose = FormClose 7 ClientHeight = 670 8 ClientWidth = 888 9 DesignTimePPI = 144 11 10 OnCreate = FormCreate 12 11 OnShow = FormShow 13 12 Position = poScreenCenter 14 LCLVersion = ' 2.0.2.0'13 LCLVersion = '3.6.0.0' 15 14 object ListViewAcronyms: TListView 16 Left = 417 Height = 46618 Top = 3419 Width = 73215 Left = 5 16 Height = 563 17 Top = 41 18 Width = 878 20 19 Align = alClient 21 BorderSpacing.Left = 422 BorderSpacing.Right = 423 BorderSpacing.Bottom = 420 BorderSpacing.Left = 5 21 BorderSpacing.Right = 5 22 BorderSpacing.Bottom = 5 24 23 Columns = < 25 24 item 26 25 Caption = 'Name' 27 Width = 1 0026 Width = 120 28 27 end 29 28 item 30 29 Caption = 'Description' 31 Width = 3 0030 Width = 360 32 31 end 33 32 item 34 33 Caption = 'Categories' 35 Width = 3 1234 Width = 383 36 35 end> 37 36 MultiSelect = True … … 49 48 end 50 49 object ListViewFilter1: TListViewFilter 51 Left = 452 Height = 3 053 Top = 454 Width = 73250 Left = 5 51 Height = 36 52 Top = 5 53 Width = 878 55 54 OnChange = ListViewFilter1Change 56 55 Align = alTop 57 BorderSpacing.Left = 4 58 BorderSpacing.Top = 4 59 BorderSpacing.Right = 4 60 end 61 object StatusBar1: TStatusBar 62 Left = 0 63 Height = 28 64 Top = 530 65 Width = 740 66 Panels = < 67 item 68 Width = 120 69 end 70 item 71 Width = 120 72 end> 73 SimplePanel = False 56 BorderSpacing.Left = 5 57 BorderSpacing.Top = 5 58 BorderSpacing.Right = 5 74 59 end 75 60 object ToolBar1: TToolBar 61 AnchorSideBottom.Control = StatusBar1 76 62 Left = 0 77 Height = 2678 Top = 50479 Width = 74063 Height = 33 64 Top = 609 65 Width = 888 80 66 Align = alBottom 81 67 Caption = 'ToolBar1' … … 83 69 ParentShowHint = False 84 70 ShowHint = True 85 TabOrder = 371 TabOrder = 2 86 72 object ToolButton1: TToolButton 87 73 Left = 1 … … 90 76 end 91 77 object ToolButton2: TToolButton 92 Left = 3 078 Left = 36 93 79 Top = 2 94 80 Action = AModify 95 81 end 96 82 object ToolButton3: TToolButton 97 Left = 5983 Left = 71 98 84 Top = 2 99 85 Action = ARemove 100 86 end 87 end 88 object StatusBar1: TStatusBar 89 Left = 0 90 Height = 28 91 Top = 642 92 Width = 888 93 Panels = < 94 item 95 Width = 144 96 end 97 item 98 Width = 144 99 end> 100 SimplePanel = False 101 101 end 102 102 object ListViewSort1: TListViewSort … … 107 107 Column = 0 108 108 Order = soUp 109 left = 248110 top = 168109 Left = 298 110 Top = 202 111 111 end 112 112 object ActionList1: TActionList 113 113 Images = Core.ImageList1 114 left = 248115 top = 232114 Left = 298 115 Top = 278 116 116 object AAdd: TAction 117 117 Caption = 'Add' … … 140 140 object PopupMenuAcronym: TPopupMenu 141 141 Images = Core.ImageList1 142 left = 248143 top = 296142 Left = 298 143 Top = 355 144 144 object MenuItem4: TMenuItem 145 145 Action = AAdd -
trunk/Forms/FormAcronyms.pas
r218 r219 1 unit UFormAcronyms; 2 3 {$mode delphi} 1 unit FormAcronyms; 4 2 5 3 interface … … 7 5 uses 8 6 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls, 9 Menus, ActnList, UListViewSort, UAcronym, LazUTF8, fgl; 7 Menus, ActnList, ListViewSort, Acronym, LazUTF8, Generics.Collections, 8 Generics.Defaults, FormEx; 10 9 11 10 type … … 13 12 { TFormAcronyms } 14 13 15 TFormAcronyms = class(TForm )14 TFormAcronyms = class(TFormEx) 16 15 AAdd: TAction; 17 16 ASelectAll: TAction; … … 36 35 procedure ARemoveExecute(Sender: TObject); 37 36 procedure ASelectAllExecute(Sender: TObject); 38 procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);39 37 procedure FormCreate(Sender: TObject); 40 38 procedure FormShow(Sender: TObject); … … 52 50 FAcronyms: TAcronyms; 53 51 MeaningCount: Integer; 54 procedure FilterList(List: TFPGObjectList<TObject>); 52 function AcronymComparer(constref Item1, Item2: TAcronym): Integer; 53 procedure FilterList(List: TObjectList<TObject>); 55 54 procedure SetAcronyms(AValue: TAcronyms); 56 55 procedure UpdateAcronymsList; … … 61 60 end; 62 61 63 var64 FormAcronyms: TFormAcronyms;65 62 66 63 implementation … … 69 66 70 67 uses 71 UCore, UFormMain, UFormAcronym;68 Core, FormAcronym; 72 69 73 70 resourcestring … … 117 114 I: Integer; 118 115 begin 119 Core.PersistentForm1.Load(Self);120 116 ListViewFilter1.UpdateFromListView(ListViewAcronyms); 121 117 UpdateAcronymsList; 122 Core. ScaleDPI1.ScaleControl(ToolBar1,Core.ScaleDPI1.DesignDPI);118 Core.Core.ScaleDPI1.ScaleControl(ToolBar1, Core.Core.ScaleDPI1.DesignDPI); 123 119 124 120 // Focus line with acronym … … 140 136 Meaning: TAcronymMeaning; 141 137 I: Integer; 138 FormAcronym: TFormAcronym; 142 139 begin 143 140 TempEntry := TAcronymEntry.Create; … … 175 172 Meaning: TAcronymMeaning; 176 173 I: Integer; 174 FormAcronym: TFormAcronym; 177 175 begin 178 176 if Assigned(ListViewAcronyms.Selected) then … … 194 192 (TempEntry.Meaning <> Name) or 195 193 (TempEntry.Description <> Description) or 196 not FormMain.CompareStrings(TempEntry.Categories, TempCategories) then begin194 not Core.Core.CompareStrings(TempEntry.Categories, TempCategories) then begin 197 195 // TODO: Update item inplace if possible 198 196 Acronyms.Db.RemoveMeaning(TAcronymMeaning(ListViewAcronyms.Selected.Data)); … … 246 244 end; 247 245 248 procedure TFormAcronyms.FormClose(Sender: TObject; var CloseAction: TCloseAction249 );250 begin251 Core.PersistentForm1.Save(Self);252 end;253 254 246 procedure TFormAcronyms.FormCreate(Sender: TObject); 255 247 var … … 258 250 FocusAcronym := nil; 259 251 MeaningCount := 0; 260 Core.Translator.TranslateComponentRecursive(Self);261 Core.ThemeManager.UseTheme(Self);262 252 for I := 0 to ToolBar1.ButtonCount - 1 do 263 253 ToolBar1.Buttons[I].Hint := ToolBar1.Buttons[I].Caption; … … 288 278 end; 289 279 280 function TFormAcronyms.AcronymComparer(constref Item1, Item2: TAcronym): Integer; 281 begin 282 Result := CompareStr(TAcronym(Item1).Name, TAcronym(Item2).Name); 283 end; 284 290 285 procedure TFormAcronyms.ListViewSort1Filter(ListViewSort: TListViewSort); 291 286 begin 292 Acronyms.Db.Acronyms.Sort( AcronymComparer);287 Acronyms.Db.Acronyms.Sort(TComparer<TAcronym>.Construct(AcronymComparer)); 293 288 Acronyms.Db.AssignToList(ListViewSort1.List); 294 289 MeaningCount := ListViewSort1.List.Count; … … 296 291 end; 297 292 298 procedure TFormAcronyms.FilterList(List: T FPGObjectList<TObject>);293 procedure TFormAcronyms.FilterList(List: TObjectList<TObject>); 299 294 var 300 295 I: Integer; -
trunk/Forms/FormCategories.lfm
r218 r219 1 1 object FormCategories: TFormCategories 2 2 Left = 516 3 Height = 4293 Height = 515 4 4 Top = 439 5 Width = 7845 Width = 941 6 6 Caption = 'Acronym categories' 7 ClientHeight = 429 8 ClientWidth = 784 9 DesignTimePPI = 120 10 OnClose = FormClose 7 ClientHeight = 515 8 ClientWidth = 941 9 DesignTimePPI = 144 11 10 OnCreate = FormCreate 12 11 OnShow = FormShow 13 12 Position = poScreenCenter 14 LCLVersion = ' 2.0.2.0'13 LCLVersion = '3.6.0.0' 15 14 object ListViewCategories: TListView 16 Left = 417 Height = 39518 Top = 419 Width = 77615 Left = 5 16 Height = 472 17 Top = 5 18 Width = 931 20 19 Align = alClient 21 BorderSpacing.Around = 420 BorderSpacing.Around = 5 22 21 Checkboxes = True 23 22 Columns = < 24 23 item 25 24 Caption = 'Name' 26 Width = 3 0025 Width = 360 27 26 end 28 27 item 29 28 Caption = 'Used count' 30 Width = 45629 Width = 556 31 30 end> 32 31 MultiSelect = True … … 45 44 object ToolBar1: TToolBar 46 45 Left = 0 47 Height = 2648 Top = 4 0349 Width = 78446 Height = 33 47 Top = 482 48 Width = 941 50 49 Align = alBottom 51 50 Images = Core.ImageList1 … … 59 58 end 60 59 object ToolButton2: TToolButton 61 Left = 3 060 Left = 36 62 61 Top = 2 63 62 Action = AModify 64 63 end 65 64 object ToolButton3: TToolButton 66 Left = 5965 Left = 71 67 66 Top = 2 68 67 Action = ARemove … … 71 70 object ActionList1: TActionList 72 71 Images = Core.ImageList1 73 left = 38074 top = 19672 Left = 456 73 Top = 235 75 74 object AAdd: TAction 76 75 Caption = 'Add' … … 107 106 object PopupMenuCategory: TPopupMenu 108 107 Images = Core.ImageList1 109 left = 119110 top = 192108 Left = 143 109 Top = 230 111 110 object MenuItem1: TMenuItem 112 111 Action = AAdd … … 137 136 Column = 0 138 137 Order = soNone 139 left = 536140 top = 184138 Left = 643 139 Top = 221 141 140 end 142 141 end -
trunk/Forms/FormCategories.pas
r218 r219 1 unit UFormCategories; 2 3 {$mode delphi} 1 unit FormCategories; 4 2 5 3 interface … … 7 5 uses 8 6 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls, 9 ActnList, Menus, UAcronym, UListViewSort;7 ActnList, Menus, Acronym, ListViewSort, FormEx; 10 8 11 9 type … … 13 11 { TFormCategories } 14 12 15 TFormCategories = class(TForm )13 TFormCategories = class(TFormEx) 16 14 AAdd: TAction; 17 15 AEnable: TAction; … … 41 39 procedure ARemoveExecute(Sender: TObject); 42 40 procedure ASelectAllExecute(Sender: TObject); 43 procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);44 41 procedure FormCreate(Sender: TObject); 45 42 procedure FormShow(Sender: TObject); … … 53 50 function ListViewSort1CompareItem(Item1, Item2: TObject): Integer; 54 51 procedure ListViewSort1Filter(ListViewSort: TListViewSort); 55 private56 { private declarations }57 52 public 58 53 Categories: TAcronymCategories; … … 61 56 end; 62 57 63 var64 FormCategories: TFormCategories;65 58 66 59 implementation … … 69 62 70 63 uses 71 UCore;64 Core; 72 65 73 66 resourcestring … … 82 75 procedure TFormCategories.FormShow(Sender: TObject); 83 76 begin 84 Core.PersistentForm1.Load(Self);85 77 UpdateList; 86 Core. ScaleDPI1.ScaleControl(ToolBar1,Core.ScaleDPI1.DesignDPI);78 Core.Core.ScaleDPI1.ScaleControl(ToolBar1, Core.Core.ScaleDPI1.DesignDPI); 87 79 end; 88 80 … … 92 84 if Assigned(Item) and (Change = ctState) then begin 93 85 TAcronymCategory(Item.Data).Enabled := Item.Checked; 94 Core. AcronymDb.Modified := True;86 Core.Core.AcronymDb.Modified := True; 95 87 end; 96 88 end; … … 102 94 S := InputBox(SCategory, SCategoryQuery, ''); 103 95 if S <> '' then begin 104 if not Assigned(Core. AcronymDb.Categories.SearchByName(S)) then begin;105 TAcronymCategory(Core. AcronymDb.Categories[Core.AcronymDb.Categories.Add(TAcronymCategory.Create)]).Name := S;106 Core. AcronymDb.Modified := True;107 Core. AcronymDb.Update;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; 108 100 UpdateList; 109 101 end else ShowMessage(Format(SCategoryAlreadyExists, [S])); … … 118 110 if ListViewCategories.Items[I].Selected then begin 119 111 TAcronymCategory(ListViewCategories.Items[I].Data).Enabled := False; 120 Core. AcronymDb.Modified := True;112 Core.Core.AcronymDb.Modified := True; 121 113 end; 122 114 UpdateList; … … 130 122 if ListViewCategories.Items[I].Selected then begin 131 123 TAcronymCategory(ListViewCategories.Items[I].Data).Enabled := True; 132 Core. AcronymDb.Modified := True;124 Core.Core.AcronymDb.Modified := True; 133 125 end; 134 126 UpdateList; … … 142 134 S := InputBox(SCategory, SCategoryQuery, ListViewCategories.Selected.Caption); 143 135 if S <> ListViewCategories.Selected.Caption then begin 144 if not Assigned(Core. AcronymDb.Categories.SearchByName(S)) then begin;136 if not Assigned(Core.Core.AcronymDb.Categories.SearchByName(S)) then begin; 145 137 TAcronymCategory(ListViewCategories.Selected.Data).Name := S; 146 Core. AcronymDb.Modified := True;147 Core. AcronymDb.Update;138 Core.Core.AcronymDb.Modified := True; 139 Core.Core.AcronymDb.Update; 148 140 UpdateList; 149 141 end else ShowMessage(Format(SCategoryAlreadyExists, [S])); … … 177 169 end; 178 170 179 procedure TFormCategories.FormClose(Sender: TObject;180 var CloseAction: TCloseAction);181 begin182 Core.PersistentForm1.Save(Self);183 end;184 185 171 procedure TFormCategories.FormCreate(Sender: TObject); 186 172 var 187 173 I: Integer; 188 174 begin 189 Core.Translator.TranslateComponentRecursive(Self);190 Core.ThemeManager.UseTheme(Self);191 175 for I := 0 to ToolBar1.ButtonCount - 1 do 192 176 ToolBar1.Buttons[I].Hint := ToolBar1.Buttons[I].Caption; … … 237 221 procedure TFormCategories.ListViewSort1Filter(ListViewSort: TListViewSort); 238 222 begin 239 Core. AcronymDb.Categories.AssignToList(ListViewSort1.List);223 Core.Core.AcronymDb.Categories.AssignToList(ListViewSort1.List); 240 224 end; 241 225 … … 243 227 begin 244 228 ListViewSort1.Refresh; 245 ListViewCategories.Items.Count := Core. AcronymDb.Categories.Count;229 ListViewCategories.Items.Count := Core.Core.AcronymDb.Categories.Count; 246 230 ListViewCategories.Refresh; 247 231 UpdateInterface; -
trunk/Forms/FormCategorySelect.lfm
r218 r219 1 1 object FormCategorySelect: TFormCategorySelect 2 2 Left = 500 3 Height = 5843 Height = 701 4 4 Top = 253 5 Width = 7915 Width = 949 6 6 Caption = 'Select categories' 7 ClientHeight = 584 8 ClientWidth = 791 9 DesignTimePPI = 120 10 OnCreate = FormCreate 11 OnShow = FormShow 7 ClientHeight = 701 8 ClientWidth = 949 9 DesignTimePPI = 144 12 10 Position = poScreenCenter 13 LCLVersion = ' 2.0.2.0'11 LCLVersion = '3.6.0.0' 14 12 object ListBox1: TListBox 15 Left = 1 616 Height = 51817 Top = 818 Width = 76113 Left = 19 14 Height = 621 15 Top = 10 16 Width = 913 19 17 Anchors = [akTop, akLeft, akRight, akBottom] 20 18 ItemHeight = 0 21 19 MultiSelect = True 20 ScrollWidth = 762 21 TabOrder = 0 22 TopIndex = -1 22 23 OnDblClick = ListBox1DblClick 23 24 OnKeyPress = ListBox1KeyPress 24 ScrollWidth = 76225 TabOrder = 026 25 end 27 26 object ButtonOk: TButton 28 Left = 70129 Height = 2530 Top = 54131 Width = 7527 Left = 841 28 Height = 30 29 Top = 649 30 Width = 90 32 31 Anchors = [akRight, akBottom] 33 32 Caption = 'Select' … … 36 35 end 37 36 object ButtonCancel: TButton 38 Left = 60539 Height = 2540 Top = 54241 Width = 7537 Left = 726 38 Height = 30 39 Top = 651 40 Width = 90 42 41 Anchors = [akRight, akBottom] 43 42 Caption = 'Cancel' -
trunk/Forms/FormCategorySelect.pas
r218 r219 1 unit UFormCategorySelect; 2 3 {$mode delphi} 1 unit FormCategorySelect; 4 2 5 3 interface … … 7 5 uses 8 6 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, 9 UAcronym;7 Acronym, FormEx; 10 8 11 9 type … … 13 11 { TFormCategorySelect } 14 12 15 TFormCategorySelect = class(TForm )13 TFormCategorySelect = class(TFormeX) 16 14 ButtonOk: TButton; 17 15 ButtonCancel: TButton; 18 16 ListBox1: TListBox; 19 procedure FormCreate(Sender: TObject);20 procedure FormShow(Sender: TObject);21 17 procedure ListBox1DblClick(Sender: TObject); 22 18 procedure ListBox1KeyPress(Sender: TObject; var Key: char); 23 private24 { private declarations }25 19 public 26 20 procedure Load(RemoveItems: TStrings); 27 21 end; 28 29 var30 FormCategorySelect: TFormCategorySelect;31 22 32 23 resourcestring … … 35 26 SRemoveCategoryQuery = 'Do you really want to remove selected categories?'; 36 27 28 37 29 implementation 38 30 … … 40 32 41 33 uses 42 UCore;34 Core; 43 35 44 36 { TFormCategorySelect } 45 46 procedure TFormCategorySelect.FormShow(Sender: TObject);47 begin48 end;49 50 procedure TFormCategorySelect.FormCreate(Sender: TObject);51 begin52 Core.Translator.TranslateComponentRecursive(Self);53 Core.ThemeManager.UseTheme(Self);54 end;55 37 56 38 procedure TFormCategorySelect.ListBox1DblClick(Sender: TObject); … … 69 51 I: Integer; 70 52 begin 71 with Core. AcronymDb do begin53 with Core.Core.AcronymDb do begin 72 54 ListBox1.Sorted := False; 73 55 while ListBox1.Items.Count < Categories.Count do … … 76 58 ListBox1.Items.Delete(ListBox1.Items.Count - 1); 77 59 for I := 0 to Categories.Count - 1 do begin 78 ListBox1.Items.Strings[I] := TAcronymCategory(Categories[I]).Name;60 ListBox1.Items.Strings[I] := Categories[I].Name; 79 61 ListBox1.Items.Objects[I] := Categories[I]; 80 62 ListBox1.Selected[I] := False; -
trunk/Forms/FormCheck.lfm
r218 r219 1 1 object FormCheck: TFormCheck 2 2 Left = 483 3 Height = 6353 Height = 762 4 4 Top = 257 5 Width = 8915 Width = 1069 6 6 Caption = 'Check document' 7 ClientHeight = 635 8 ClientWidth = 891 9 DesignTimePPI = 120 10 OnClose = FormClose 7 ClientHeight = 762 8 ClientWidth = 1069 9 DesignTimePPI = 144 11 10 OnCreate = FormCreate 12 11 OnDestroy = FormDestroy 13 12 OnShow = FormShow 14 LCLVersion = ' 2.0.2.0'13 LCLVersion = '3.6.0.0' 15 14 object Panel1: TPanel 16 15 Left = 0 17 Height = 63516 Height = 762 18 17 Top = 0 19 Width = 2 2418 Width = 269 20 19 Align = alLeft 21 20 BevelOuter = bvNone 22 ClientHeight = 63523 ClientWidth = 2 2421 ClientHeight = 762 22 ClientWidth = 269 24 23 TabOrder = 0 25 24 object ButtonCheck: TButton 26 Left = 1 127 Height = 3 128 Top = 1 329 Width = 9425 Left = 13 26 Height = 37 27 Top = 16 28 Width = 113 30 29 Caption = 'Check' 30 TabOrder = 0 31 31 OnClick = ButtonCheckClick 32 TabOrder = 033 32 end 34 33 object GroupBox1: TGroupBox 35 Left = 1 136 Height = 2 1737 Top = 19938 Width = 2 0634 Left = 13 35 Height = 260 36 Top = 239 37 Width = 248 39 38 Anchors = [akTop, akLeft, akRight] 40 39 Caption = 'Summary section' 41 ClientHeight = 19242 ClientWidth = 2 0240 ClientHeight = 233 41 ClientWidth = 246 43 42 TabOrder = 1 44 43 object ButtonAcronymsSummary: TButton 45 Left = 646 Height = 3 147 Top = 848 Width = 1 5044 Left = 7 45 Height = 37 46 Top = 10 47 Width = 180 49 48 Caption = 'Acronyms' 49 TabOrder = 0 50 50 OnClick = ButtonAcronymsSummaryClick 51 TabOrder = 052 51 end 53 52 object LabelAcronymCountSummary: TLabel 54 Left = 655 Height = 2 056 Top = 4857 Width = 1 0353 Left = 7 54 Height = 26 55 Top = 58 56 Width = 134 58 57 Caption = 'Acronym count:' 59 58 ParentColor = False 60 59 end 61 60 object Label1: TLabel 62 Left = 863 Height = 2 064 Top = 7265 Width = 7561 Left = 10 62 Height = 26 63 Top = 86 64 Width = 98 66 65 Caption = 'Start string:' 67 66 ParentColor = False 68 67 end 69 68 object EditSummaryStart: TEdit 70 Left = 871 Height = 2872 Top = 9673 Width = 18469 Left = 10 70 Height = 43 71 Top = 115 72 Width = 224 74 73 Anchors = [akTop, akLeft, akRight] 75 74 TabOrder = 1 76 75 end 77 76 object Label2: TLabel 78 Left = 879 Height = 2 080 Top = 1 2881 Width = 6977 Left = 10 78 Height = 26 79 Top = 154 80 Width = 91 82 81 Caption = 'End string:' 83 82 ParentColor = False 84 83 end 85 84 object EditSummaryEnd: TEdit 86 Left = 887 Height = 2888 Top = 1 5289 Width = 18485 Left = 10 86 Height = 43 87 Top = 182 88 Width = 224 90 89 Anchors = [akTop, akLeft, akRight] 91 90 TabOrder = 2 … … 93 92 end 94 93 object GroupBox2: TGroupBox 95 Left = 1 196 Height = 9997 Top = 9698 Width = 2 0794 Left = 13 95 Height = 119 96 Top = 115 97 Width = 249 99 98 Anchors = [akTop, akLeft, akRight] 100 99 Caption = 'Content' 101 ClientHeight = 74102 ClientWidth = 2 03100 ClientHeight = 92 101 ClientWidth = 247 103 102 TabOrder = 2 104 103 object ButtonAcronymsContent: TButton 105 Left = 8106 Height = 3 1104 Left = 10 105 Height = 37 107 106 Top = 0 108 Width = 1 50107 Width = 180 109 108 Caption = 'Acronyms' 109 TabOrder = 0 110 110 OnClick = ButtonAcronymsContentClick 111 TabOrder = 0112 111 end 113 112 object LabelAcronymCountContent: TLabel 114 Left = 8115 Height = 2 0116 Top = 4 0117 Width = 1 03113 Left = 10 114 Height = 26 115 Top = 48 116 Width = 134 118 117 Caption = 'Acronym count:' 119 118 ParentColor = False … … 121 120 end 122 121 object ButtonLoadFromFile: TButton 123 Left = 1 1124 Height = 3 1125 Top = 48126 Width = 1 34122 Left = 13 123 Height = 37 124 Top = 58 125 Width = 161 127 126 Caption = 'Load from file' 127 TabOrder = 3 128 128 OnClick = ButtonLoadFromFileClick 129 TabOrder = 3130 129 end 131 130 object CheckBoxCaseSensitive: TCheckBox 132 Left = 1 1133 Height = 24134 Top = 424135 Width = 197131 Left = 13 132 Height = 30 133 Top = 509 134 Width = 251 136 135 Caption = 'Case sensitive comparison' 137 136 TabOrder = 4 … … 139 138 end 140 139 object Splitter1: TSplitter 141 Left = 2 24142 Height = 635140 Left = 269 141 Height = 762 143 142 Top = 0 144 Width = 6143 Width = 7 145 144 end 146 145 object Panel2: TPanel 147 Left = 2 30148 Height = 635146 Left = 276 147 Height = 762 149 148 Top = 0 150 Width = 661149 Width = 793 151 150 Align = alClient 152 151 BevelOuter = bvNone 153 ClientHeight = 635154 ClientWidth = 661152 ClientHeight = 762 153 ClientWidth = 793 155 154 TabOrder = 2 156 155 object PageControl1: TPageControl 157 Left = 8158 Height = 619159 Top = 8160 Width = 645156 Left = 10 157 Height = 742 158 Top = 10 159 Width = 773 161 160 ActivePage = TabSheetReport 162 161 Align = alClient 163 BorderSpacing.Around = 8162 BorderSpacing.Around = 10 164 163 TabIndex = 1 165 164 TabOrder = 0 166 165 object TabSheetSource: TTabSheet 167 166 Caption = 'Source' 168 ClientHeight = 586169 ClientWidth = 637167 ClientHeight = 702 168 ClientWidth = 763 170 169 object MemoDocument: TMemo 171 Left = 8172 Height = 570173 Top = 8174 Width = 620170 Left = 10 171 Height = 682 172 Top = 10 173 Width = 742 175 174 Anchors = [akTop, akLeft, akRight, akBottom] 176 175 ScrollBars = ssAutoBoth … … 181 180 object TabSheetReport: TTabSheet 182 181 Caption = 'Report' 183 ClientHeight = 586184 ClientWidth = 637182 ClientHeight = 702 183 ClientWidth = 763 185 184 object ListViewReport: TListView 186 Left = 7187 Height = 564188 Top = 1 3189 Width = 625185 Left = 8 186 Height = 675 187 Top = 16 188 Width = 749 190 189 Anchors = [akTop, akLeft, akRight, akBottom] 191 190 Columns = < 192 191 item 193 192 Caption = 'Position' 194 Width = 80193 Width = 96 195 194 end 196 195 item 197 196 Caption = 'Type' 198 Width = 1 00197 Width = 120 199 198 end 200 199 item 201 200 Caption = 'Message' 202 Width = 800201 Width = 960 203 202 end> 204 203 OwnerData = True … … 216 215 DefaultExt = '.txt' 217 216 Filter = 'Text files (.txt)|*.txt|Any file|*.*' 218 left = 544219 top = 288217 Left = 653 218 Top = 346 220 219 end 221 220 object PopupMenuReport: TPopupMenu 222 left = 376223 top = 202221 Left = 451 222 Top = 242 224 223 object MenuItemGoTo: TMenuItem 225 224 Action = AGoToLocation … … 231 230 end 232 231 object ActionList1: TActionList 233 left = 546234 top = 203232 Left = 655 233 Top = 244 235 234 object ASaveToCsv: TAction 236 235 Caption = 'Save to CSV...' … … 243 242 end 244 243 object SaveDialog1: TSaveDialog 245 left = 378246 top = 288244 Left = 454 245 Top = 346 247 246 end 248 247 end -
trunk/Forms/FormCheck.pas
r218 r219 1 unit UFormCheck; 2 3 {$mode delphi} 1 unit FormCheck; 4 2 5 3 interface … … 7 5 uses 8 6 Classes, SysUtils, LazFileUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, 9 ExtCtrls, ComCtrls, Menus, ActnList, UAcronym, URegistry, Registry, UCommon,10 fgl;7 ExtCtrls, ComCtrls, Menus, ActnList, Acronym, RegistryEx, Registry, Common, 8 Generics.Collections; 11 9 12 10 type … … 21 19 { TReportItems } 22 20 23 TReportItems = class(T FPGObjectList<TReportItem>)21 TReportItems = class(TObjectList<TReportItem>) 24 22 function AddNew(Message: string; Position: TPoint; 25 23 Kind: TReportType = rtNone): TReportItem; … … 65 63 procedure ButtonCheckClick(Sender: TObject); 66 64 procedure ButtonLoadFromFileClick(Sender: TObject); 67 procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);68 65 procedure FormCreate(Sender: TObject); 69 66 procedure FormDestroy(Sender: TObject); … … 98 95 end; 99 96 100 var101 FormCheck: TFormCheck;102 103 97 const 104 98 ReportTypeString: array[TReportType] of string = ('', 'Note', 'Warning', 'Error'); … … 110 104 111 105 uses 112 UFormAcronyms, UCore;106 FormAcronyms, Core; 113 107 114 108 resourcestring … … 198 192 end; 199 193 200 procedure TFormCheck.FormClose(Sender: TObject; var CloseAction: TCloseAction);201 begin202 Core.PersistentForm1.Save(Self);203 end;204 205 194 procedure TFormCheck.FormCreate(Sender: TObject); 206 195 begin 207 196 AcronymDbSummary := TAcronymDb.Create; 208 197 AcronymDbContent := TAcronymDb.Create; 209 Core.Translator.TranslateComponentRecursive(Self);210 Core.ThemeManager.UseTheme(Self);211 198 ReportItems := TReportItems.Create; 212 199 end; … … 214 201 procedure TFormCheck.FormDestroy(Sender: TObject); 215 202 begin 216 ReportItems.Free;217 AcronymDbSummary.Free;218 AcronymDbContent.Free;203 FreeAndNil(ReportItems); 204 FreeAndNil(AcronymDbSummary); 205 FreeAndNil(AcronymDbContent); 219 206 end; 220 207 … … 222 209 begin 223 210 PageControl1.TabIndex := 0; 224 Core.PersistentForm1.Load(Self);225 211 if FileExists(LastDocumentFileName) then 226 212 MemoDocument.Lines.LoadFromFile(LastDocumentFileName); … … 724 710 with TRegistryEx.Create do 725 711 try 726 RootKey := RegistryRootHKEY[Core. ApplicationInfo1.RegistryRoot];727 OpenKey(Core. ApplicationInfo1.RegistryKey, True);712 RootKey := RegistryRootHKEY[Core.Core.ApplicationInfo1.RegistryRoot]; 713 OpenKey(Core.Core.ApplicationInfo1.RegistryKey, True); 728 714 EditSummaryStart.Text := ReadStringWithDefault('SummaryStart', 'ACRONYMS AND ABBREVIATIONS'); 729 715 EditSummaryEnd.Text := ReadStringWithDefault('SummaryEnd', 'Appendix'); … … 739 725 with TRegistryEx.Create do 740 726 try 741 RootKey := RegistryRootHKEY[Core. ApplicationInfo1.RegistryRoot];742 OpenKey(Core. ApplicationInfo1.RegistryKey, True);727 RootKey := RegistryRootHKEY[Core.Core.ApplicationInfo1.RegistryRoot]; 728 OpenKey(Core.Core.ApplicationInfo1.RegistryKey, True); 743 729 WriteString('SummaryStart', EditSummaryStart.Text); 744 730 WriteString('SummaryEnd', EditSummaryEnd.Text); -
trunk/Forms/FormExport.lfm
r218 r219 1 1 object FormExport: TFormExport 2 2 Left = 281 3 Height = 6543 Height = 785 4 4 Top = 221 5 Width = 8505 Width = 1020 6 6 Caption = 'Export' 7 ClientHeight = 654 8 ClientWidth = 850 9 DesignTimePPI = 120 10 OnClose = FormClose 11 OnCreate = FormCreate 12 OnShow = FormShow 7 ClientHeight = 785 8 ClientWidth = 1020 9 DesignTimePPI = 144 13 10 Position = poScreenCenter 14 LCLVersion = ' 2.0.2.0'11 LCLVersion = '3.6.0.0' 15 12 object ButtonProcess: TButton 16 Left = 1817 Height = 3318 Top = 919 Width = 1 3913 Left = 22 14 Height = 40 15 Top = 11 16 Width = 167 20 17 Caption = 'Process' 18 TabOrder = 0 21 19 OnClick = ButtonProcessClick 22 TabOrder = 023 20 end 24 21 object ComboBoxDataFormat: TComboBox 25 Left = 34126 Height = 2827 Top = 528 Width = 18229 ItemHeight = 2022 Left = 409 23 Height = 38 24 Top = 6 25 Width = 218 26 ItemHeight = 0 30 27 ItemIndex = 0 31 28 Items.Strings = ( … … 39 36 end 40 37 object ButtonSaveToFile: TButton 41 Left = 65342 Height = 3343 Top = 944 Width = 18138 Left = 784 39 Height = 40 40 Top = 11 41 Width = 217 45 42 Anchors = [akTop, akRight] 46 43 Caption = 'Save to file' 44 TabOrder = 2 47 45 OnClick = ButtonSaveToFileClick 48 TabOrder = 249 46 end 50 47 object Memo1: TMemo 51 Left = 852 Height = 59753 Top = 5154 Width = 83048 Left = 10 49 Height = 717 50 Top = 61 51 Width = 996 55 52 Anchors = [akTop, akLeft, akRight, akBottom] 56 53 ScrollBars = ssAutoBoth … … 58 55 end 59 56 object SaveDialog1: TSaveDialog 60 left = 39561 top = 12457 Left = 474 58 Top = 149 62 59 end 63 60 end -
trunk/Forms/FormExport.pas
r218 r219 1 unit UFormExport; 2 3 {$mode delphi} 1 unit FormExport; 4 2 5 3 interface … … 7 5 uses 8 6 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, 9 UJobProgressView;7 JobProgressView; 10 8 11 9 type … … 21 19 procedure ButtonProcessClick(Sender: TObject); 22 20 procedure ButtonSaveToFileClick(Sender: TObject); 23 procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);24 procedure FormCreate(Sender: TObject);25 procedure FormShow(Sender: TObject);26 21 private 27 22 ItemCount: Integer; … … 30 25 procedure JobExportMediaWiki(Job: TJob); 31 26 procedure JobExportMediaWikiTable(Job: TJob); 32 public33 { public declarations }34 27 end; 35 28 36 var37 FormExport: TFormExport;38 29 39 30 implementation … … 42 33 43 34 uses 44 UCore, UAcronym;35 Core, Acronym; 45 36 46 37 resourcestring … … 60 51 end; 61 52 62 procedure TFormExport.FormClose(Sender: TObject; var CloseAction: TCloseAction);63 begin64 Core.PersistentForm1.Save(Self);65 end;66 67 procedure TFormExport.FormCreate(Sender: TObject);68 begin69 Core.Translator.TranslateComponentRecursive(Self);70 Core.ThemeManager.UseTheme(Self);71 end;72 73 procedure TFormExport.FormShow(Sender: TObject);74 begin75 Core.PersistentForm1.Load(Self);76 end;77 78 53 procedure TFormExport.JobExportCSV(Job: TJob); 79 54 var … … 81 56 J: Integer; 82 57 begin 83 Job.Progress.Max := Core. AcronymDb.Acronyms.Count;58 Job.Progress.Max := Core.Core.AcronymDb.Acronyms.Count; 84 59 ItemCount := 0; 85 60 Content := ''; 86 for I := 0 to Core. AcronymDb.Acronyms.Count - 1 do87 with TAcronym(Core.AcronymDb.Acronyms[I])do begin61 for I := 0 to Core.Core.AcronymDb.Acronyms.Count - 1 do 62 with Core.Core.AcronymDb.Acronyms[I] do begin 88 63 for J := 0 to Meanings.Count - 1 do 89 with TAcronymMeaning(Meanings[J])do begin64 with Meanings[J] do begin 90 65 Content := Content + '"' + Acronym.Name + '","' + Name + '","' + Description + '","' + Categories.GetString + '"' + LineEnding; 91 66 Inc(ItemCount); … … 101 76 J: Integer; 102 77 begin 103 Job.Progress.Max := Core. AcronymDb.Acronyms.Count;78 Job.Progress.Max := Core.Core.AcronymDb.Acronyms.Count; 104 79 ItemCount := 0; 105 80 Content := ''; 106 for I := 0 to Core. AcronymDb.Acronyms.Count - 1 do107 with TAcronym(Core.AcronymDb.Acronyms[I])do begin81 for I := 0 to Core.Core.AcronymDb.Acronyms.Count - 1 do 82 with Core.Core.AcronymDb.Acronyms[I] do begin 108 83 Content := Content + '; ' + Name + LineEnding; 109 84 for J := 0 to Meanings.Count - 1 do 110 with TAcronymMeaning(Meanings[J])do begin85 with Meanings[J] do begin 111 86 Content := Content + ': ' + Name + LineEnding; 112 87 Inc(ItemCount); … … 122 97 J: Integer; 123 98 begin 124 Job.Progress.Max := Core. AcronymDb.Acronyms.Count;99 Job.Progress.Max := Core.Core.AcronymDb.Acronyms.Count; 125 100 ItemCount := 0; 126 101 Content := '{| class="wikitable sortable"' + LineEnding + 127 102 '! Name !! Meaning !! Description !! Categories' + LineEnding; 128 for I := 0 to Core. AcronymDb.Acronyms.Count - 1 do129 with TAcronym(Core.AcronymDb.Acronyms[I])do begin103 for I := 0 to Core.Core.AcronymDb.Acronyms.Count - 1 do 104 with Core.Core.AcronymDb.Acronyms[I] do begin 130 105 for J := 0 to Meanings.Count - 1 do 131 with TAcronymMeaning(Meanings[J])do begin106 with Meanings[J] do begin 132 107 Content := Content + '|-' + LineEnding + 133 108 '| ' + Acronym.Name + LineEnding + '| ' + Name + LineEnding + … … 144 119 begin 145 120 if ComboBoxDataFormat.ItemIndex = 0 then 146 Core. JobProgressView1.AddJob(SExporting, JobExportCSV);121 Core.Core.JobProgressView1.AddJob(SExporting, JobExportCSV); 147 122 if ComboBoxDataFormat.ItemIndex = 1 then 148 Core. JobProgressView1.AddJob(SExporting, JobExportMediaWiki);123 Core.Core.JobProgressView1.AddJob(SExporting, JobExportMediaWiki); 149 124 if ComboBoxDataFormat.ItemIndex = 2 then 150 Core. JobProgressView1.AddJob(SExporting, JobExportMediaWikiTable);151 Core. JobProgressView1.Start;125 Core.Core.JobProgressView1.AddJob(SExporting, JobExportMediaWikiTable); 126 Core.Core.JobProgressView1.Start; 152 127 Memo1.Lines.Text := Content; 153 128 ShowMessage(Format(SExportedAcronyms, [ItemCount])); -
trunk/Forms/FormImport.lfm
r218 r219 8 8 ClientWidth = 782 9 9 DesignTimePPI = 144 10 OnClose = FormClose11 OnCreate = FormCreate12 OnShow = FormShow13 10 Position = poScreenCenter 14 LCLVersion = ' 2.0.12.0'11 LCLVersion = '3.6.0.0' 15 12 object ButtonProcess: TButton 16 13 Left = 19 … … 19 16 Width = 128 20 17 Caption = 'Process' 21 OnClick = ButtonProcessClick22 18 ParentFont = False 23 19 TabOrder = 0 20 OnClick = ButtonProcessClick 24 21 end 25 22 object Memo1: TMemo … … 51 48 object Label1: TLabel 52 49 Left = 184 53 Height = 2 450 Height = 26 54 51 Top = 11 55 52 Width = 106 … … 65 62 Anchors = [akTop, akRight] 66 63 Caption = 'Load from file' 67 OnClick = ButtonLoadFromFileClick68 64 ParentFont = False 69 65 TabOrder = 2 66 OnClick = ButtonLoadFromFileClick 70 67 end 71 68 object OpenDialog1: TOpenDialog -
trunk/Forms/FormImport.pas
r218 r219 1 unit UFormImport; 2 3 {$mode delphi}{$H+} 1 unit FormImport; 4 2 5 3 interface … … 7 5 uses 8 6 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, 9 UAcronym;7 Acronym, FormEx; 10 8 11 9 type … … 13 11 { TFormImport } 14 12 15 TFormImport = class(TForm )13 TFormImport = class(TFormEx) 16 14 ButtonLoadFromFile: TButton; 17 15 ButtonProcess: TButton; … … 22 20 procedure ButtonProcessClick(Sender: TObject); 23 21 procedure ButtonLoadFromFileClick(Sender: TObject); 24 procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);25 procedure FormCreate(Sender: TObject);26 procedure FormShow(Sender: TObject);27 22 private 28 23 procedure ImportMediaWiki; 29 24 procedure ImportCSV; 30 public31 { public declarations }32 25 end; 33 26 34 var35 FormImport: TFormImport;36 27 37 28 implementation … … 40 31 41 32 uses 42 UCore;33 Core; 43 34 44 35 resourcestring 45 36 SImportedNewAcronyms = 'Imported %d new acronyms.'; 46 47 37 48 38 { TFormImport } … … 60 50 if OpenDialog1.Execute then 61 51 Memo1.Lines.LoadFromFile(OpenDialog1.FileName); 62 end;63 64 procedure TFormImport.FormClose(Sender: TObject; var CloseAction: TCloseAction);65 begin66 Core.PersistentForm1.Save(Self);67 end;68 69 procedure TFormImport.FormCreate(Sender: TObject);70 begin71 Core.Translator.TranslateComponentRecursive(Self);72 Core.ThemeManager.UseTheme(Self);73 end;74 75 procedure TFormImport.FormShow(Sender: TObject);76 begin77 Core.PersistentForm1.Load(Self);78 52 end; 79 53 … … 101 75 AcronymMeaning := Trim(Copy(Line, 2, Length(Line))); 102 76 if (AcronymName <> '') and (AcronymMeaning <> '') then begin 103 Acronym := Core. AcronymDb.Acronyms.SearchByName(AcronymName);77 Acronym := Core.Core.AcronymDb.Acronyms.SearchByName(AcronymName); 104 78 if not Assigned(Acronym) then begin 105 79 Acronym := TAcronym.Create; 106 80 Acronym.Name := AcronymName; 107 Core. AcronymDb.Acronyms.Add(Acronym);81 Core.Core.AcronymDb.Acronyms.Add(Acronym); 108 82 end; 109 83 Meaning := Acronym.Meanings.SearchByName(AcronymMeaning); … … 118 92 end; 119 93 end; 120 if AddedCount > 0 then Core. AcronymDb.Modified := True;94 if AddedCount > 0 then Core.Core.AcronymDb.Modified := True; 121 95 ShowMessage(Format(SImportedNewAcronyms, [AddedCount])); 122 96 end; … … 147 121 else AcronymDescription := ''; 148 122 if (AcronymName <> '') and (AcronymDescription <> '') then begin 149 Acronym := Core. AcronymDb.Acronyms.SearchByName(AcronymName);123 Acronym := Core.Core.AcronymDb.Acronyms.SearchByName(AcronymName); 150 124 if not Assigned(Acronym) then begin 151 125 Acronym := TAcronym.Create; 152 126 Acronym.Name := AcronymName; 153 Core. AcronymDb.Acronyms.Add(Acronym);127 Core.Core.AcronymDb.Acronyms.Add(Acronym); 154 128 end; 155 129 Meaning := Acronym.Meanings.SearchByName(AcronymDescription); … … 165 139 end; 166 140 Columns.Free; 167 if AddedCount > 0 then Core. AcronymDb.Modified := True;141 if AddedCount > 0 then Core.Core.AcronymDb.Modified := True; 168 142 ShowMessage(Format(SImportedNewAcronyms, [AddedCount])); 169 143 end; -
trunk/Forms/FormImportFormat.lfm
r218 r219 1 1 object FormImportFormat: TFormImportFormat 2 2 Left = 462 3 Height = 4393 Height = 527 4 4 Top = 322 5 Width = 6295 Width = 755 6 6 Caption = 'Import format' 7 ClientHeight = 439 8 ClientWidth = 629 9 DesignTimePPI = 120 10 OnClose = FormClose 7 ClientHeight = 527 8 ClientWidth = 755 9 DesignTimePPI = 144 11 10 OnCreate = FormCreate 12 11 OnShow = FormShow 13 12 Position = poScreenCenter 14 LCLVersion = ' 2.0.2.0'13 LCLVersion = '3.6.0.0' 15 14 object ButtonOk: TButton 16 Left = 52517 Height = 2518 Top = 39019 Width = 7515 Left = 630 16 Height = 30 17 Top = 468 18 Width = 90 20 19 Anchors = [akRight, akBottom] 21 20 Caption = 'Ok' … … 24 23 end 25 24 object ButtonCancel: TButton 26 Left = 42927 Height = 2528 Top = 39029 Width = 7525 Left = 515 26 Height = 30 27 Top = 468 28 Width = 90 30 29 Anchors = [akRight, akBottom] 31 30 Caption = 'Cancel' … … 34 33 end 35 34 object Label1: TLabel 36 Left = 2 037 Height = 2 038 Top = 5339 Width = 4335 Left = 24 36 Height = 26 37 Top = 64 38 Width = 56 40 39 Caption = 'Name:' 41 40 ParentColor = False 42 41 end 43 42 object EditName: TEdit 44 Left = 17945 Height = 2846 Top = 4847 Width = 42643 Left = 215 44 Height = 43 45 Top = 58 46 Width = 511 48 47 Anchors = [akTop, akLeft, akRight] 49 48 TabOrder = 1 50 49 end 51 50 object Label8: TLabel 52 Left = 2 053 Height = 2 054 Top = 9055 Width = 7251 Left = 24 52 Height = 26 53 Top = 108 54 Width = 95 56 55 Caption = 'Block start:' 57 56 ParentColor = False 58 57 end 59 58 object EditBlockStart: TEdit 60 Left = 17961 Height = 2862 Top = 8563 Width = 42659 Left = 215 60 Height = 43 61 Top = 102 62 Width = 511 64 63 Anchors = [akTop, akLeft, akRight] 65 64 TabOrder = 2 66 65 end 67 66 object Label9: TLabel 68 Left = 2 069 Height = 2 070 Top = 1 3071 Width = 6867 Left = 24 68 Height = 26 69 Top = 156 70 Width = 89 72 71 Caption = 'Block end:' 73 72 ParentColor = False 74 73 end 75 74 object EditBlockEnd: TEdit 76 Left = 17977 Height = 2878 Top = 1 2579 Width = 42675 Left = 215 76 Height = 43 77 Top = 150 78 Width = 511 80 79 Anchors = [akTop, akLeft, akRight] 81 80 TabOrder = 3 82 81 end 83 82 object ListViewItemRules: TListView 84 Left = 2 085 Height = 19886 Top = 18187 Width = 58583 Left = 24 84 Height = 238 85 Top = 217 86 Width = 702 88 87 Anchors = [akTop, akLeft, akRight, akBottom] 89 88 Columns = < 90 89 item 91 90 Caption = 'Start string' 92 Width = 1 0091 Width = 120 93 92 end 94 93 item 95 94 Caption = 'End string' 96 Width = 1 0095 Width = 120 97 96 end 98 97 item 99 98 Caption = 'Action' 100 Width = 1 0099 Width = 120 101 100 end 102 101 item 103 102 Caption = 'Variable' 104 Width = 1 00103 Width = 120 105 104 end 106 105 item 107 106 Caption = 'Repetition' 108 Width = 165107 Width = 207 109 108 end> 110 109 OwnerData = True … … 118 117 end 119 118 object Label2: TLabel 120 Left = 2 0121 Height = 2 0122 Top = 1 57123 Width = 68119 Left = 24 120 Height = 26 121 Top = 188 122 Width = 91 124 123 Caption = 'Item rules:' 125 124 ParentColor = False 126 125 end 127 126 object Label3: TLabel 128 Left = 2 0129 Height = 2 0130 Top = 1 3131 Width = 35127 Left = 24 128 Height = 26 129 Top = 16 130 Width = 45 132 131 Caption = 'Type:' 133 132 ParentColor = False 134 133 end 135 134 object ComboBoxType: TComboBox 136 Left = 179137 Height = 28138 Top = 1 3139 Width = 197140 ItemHeight = 20135 Left = 215 136 Height = 38 137 Top = 16 138 Width = 236 139 ItemHeight = 0 141 140 Items.Strings = ( 142 141 'Text parse HTTP' … … 148 147 end 149 148 object PopupMenu1: TPopupMenu 150 left = 181151 top = 277149 Left = 217 150 Top = 332 152 151 object MenuItem1: TMenuItem 153 152 Action = AAdd … … 275 274 end 276 275 object ActionList1: TActionList 277 left = 383278 top = 282276 Left = 460 277 Top = 338 279 278 object AAdd: TAction 280 279 Caption = 'Add' -
trunk/Forms/FormImportFormat.pas
r218 r219 1 unit UFormImportFormat; 2 3 {$mode delphi} 1 unit FormImportFormat; 4 2 5 3 interface … … 7 5 uses 8 6 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, 9 ComCtrls, Menus, ActnList, UAcronym;7 ComCtrls, Menus, ActnList, Acronym; 10 8 11 9 type … … 43 41 procedure AMoveUpExecute(Sender: TObject); 44 42 procedure ARemoveExecute(Sender: TObject); 45 procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);46 43 procedure FormCreate(Sender: TObject); 47 44 procedure FormShow(Sender: TObject); 48 45 procedure ListViewItemRulesData(Sender: TObject; Item: TListItem); 49 private50 { private declarations }51 46 public 52 47 ImportFormat: TImportFormat; … … 64 59 65 60 uses 66 UCore, UFormImportPattern;61 Core, FormImportPattern; 67 62 68 63 {$R *.lfm} … … 80 75 var 81 76 NewImportPattern: TImportPattern; 77 FormImportPattern: TFormImportPattern; 82 78 begin 83 79 FormImportPattern := TFormImportPattern.Create(Self); … … 100 96 var 101 97 NewImportPattern: TImportPattern; 98 FormImportPattern: TFormImportPattern; 102 99 begin 103 100 FormImportPattern := TFormImportPattern.Create(Self); … … 152 149 end; 153 150 154 procedure TFormImportFormat.FormClose(Sender: TObject;155 var CloseAction: TCloseAction);156 begin157 Core.PersistentForm1.Save(Self);158 end;159 160 151 procedure TFormImportFormat.FormCreate(Sender: TObject); 161 152 begin 162 Core.Translator.TranslateComponentRecursive(Self);163 Core.ThemeManager.UseTheme(Self);164 153 YesNoString[False] := SNo; 165 154 YesNoString[True] := SYes; … … 168 157 procedure TFormImportFormat.FormShow(Sender: TObject); 169 158 begin 170 Core.PersistentForm1.Load(Self);171 159 ReloadList; 172 160 end; -
trunk/Forms/FormImportFormats.lfm
r218 r219 1 1 object FormImportFormats: TFormImportFormats 2 2 Left = 473 3 Height = 5183 Height = 622 4 4 Top = 327 5 Width = 7395 Width = 887 6 6 Caption = 'Import formats' 7 ClientHeight = 518 8 ClientWidth = 739 9 DesignTimePPI = 120 10 OnClose = FormClose 7 ClientHeight = 622 8 ClientWidth = 887 9 DesignTimePPI = 144 11 10 OnCreate = FormCreate 12 11 OnShow = FormShow 13 12 Position = poScreenCenter 14 LCLVersion = ' 2.0.2.0'13 LCLVersion = '3.6.0.0' 15 14 object ListView1: TListView 16 Left = 517 Height = 47618 Top = 519 Width = 72915 Left = 6 16 Height = 577 17 Top = 6 18 Width = 875 20 19 Align = alClient 21 BorderSpacing.Around = 520 BorderSpacing.Around = 6 22 21 Columns = < 23 22 item 24 23 Caption = 'Name' 25 Width = 70424 Width = 860 26 25 end> 27 26 MultiSelect = True … … 40 39 object ToolBar1: TToolBar 41 40 Left = 0 42 Top = 486 43 Width = 739 41 Height = 33 42 Top = 589 43 Width = 887 44 44 Align = alBottom 45 Images = Core.ImageList146 45 ParentFont = False 47 46 ParentShowHint = False … … 54 53 end 55 54 object ToolButton2: TToolButton 56 Left = 3 055 Left = 36 57 56 Top = 2 58 57 Action = AModify 59 58 end 60 59 object ToolButton3: TToolButton 61 Left = 5960 Left = 71 62 61 Top = 2 63 62 Action = ARemove … … 65 64 end 66 65 object ActionList1: TActionList 67 Images = Core.ImageList1 68 left = 510 69 top = 280 66 Left = 612 67 Top = 336 70 68 object AAdd: TAction 71 69 Caption = 'Add' … … 88 86 end 89 87 object PopupMenuImportSource: TPopupMenu 90 Images = Core.ImageList1 91 left = 184 92 top = 275 88 Left = 221 89 Top = 330 93 90 object MenuItem1: TMenuItem 94 91 Action = AAdd -
trunk/Forms/FormImportFormats.pas
r218 r219 1 unit UFormImportFormats; 2 3 {$mode delphi} 1 unit FormImportFormats; 4 2 5 3 interface … … 7 5 uses 8 6 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls, 9 ActnList, Menus, UAcronym;7 ActnList, Menus, Acronym, FormEx; 10 8 11 9 type … … 13 11 { TFormImportFormats } 14 12 15 TFormImportFormats = class(TForm )13 TFormImportFormats = class(TFormEx) 16 14 AAdd: TAction; 17 15 ActionList1: TActionList; … … 30 28 procedure AModifyExecute(Sender: TObject); 31 29 procedure ARemoveExecute(Sender: TObject); 32 procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);33 30 procedure FormCreate(Sender: TObject); 34 31 procedure FormShow(Sender: TObject); … … 38 35 procedure ListView1SelectItem(Sender: TObject; Item: TListItem; 39 36 Selected: Boolean); 40 private41 { private declarations }42 37 public 43 38 ImportFormats: TImportFormats; … … 46 41 end; 47 42 48 var49 FormImportFormats: TFormImportFormats;50 43 51 44 implementation … … 54 47 55 48 uses 56 UCore, UFormImportFormat;49 Core, FormImportFormat; 57 50 58 51 resourcestring … … 104 97 procedure TFormImportFormats.FormShow(Sender: TObject); 105 98 begin 106 Core.PersistentForm1.Load(Self);107 99 UpdateList; 108 Core. ScaleDPI1.ScaleControl(ToolBar1,Core.ScaleDPI1.DesignDPI);100 Core.Core.ScaleDPI1.ScaleControl(ToolBar1, Core.Core.ScaleDPI1.DesignDPI); 109 101 end; 110 102 … … 112 104 var 113 105 NewImportFormat: TImportFormat; 106 FormImportFormat: TFormImportFormat; 114 107 begin 115 108 NewImportFormat := TImportFormat.Create; … … 123 116 ImportFormats.Add(NewImportFormat); 124 117 NewImportFormat := nil; 125 Core. AcronymDb.Modified := True;118 Core.Core.AcronymDb.Modified := True; 126 119 UpdateList; 127 120 end else ShowMessage(Format(SImportFormatAlreadyExists, [NewImportFormat.Name])); … … 136 129 var 137 130 NewImportFormat: TImportFormat; 131 FormImportFormat: TFormImportFormat; 138 132 begin 139 133 if Assigned(ListView1.Selected) then begin … … 148 142 if not Assigned(ImportFormats.SearchByName(NewImportFormat.Name)) then begin; 149 143 TImportFormat(ListView1.Selected.Data).Assign(NewImportFormat); 150 Core. AcronymDb.Modified := True;144 Core.Core.AcronymDb.Modified := True; 151 145 UpdateList; 152 146 end else ShowMessage(Format(SImportFormatAlreadyExists, [NewImportFormat.Name])); 153 147 end else begin 154 148 TImportFormat(ListView1.Selected.Data).Assign(NewImportFormat); 155 Core. AcronymDb.Modified := True;149 Core.Core.AcronymDb.Modified := True; 156 150 UpdateList; 157 151 end; … … 179 173 end; 180 174 181 procedure TFormImportFormats.FormClose(Sender: TObject;182 var CloseAction: TCloseAction);183 begin184 Core.PersistentForm1.Save(Self);185 end;186 187 175 procedure TFormImportFormats.FormCreate(Sender: TObject); 188 176 var 189 177 I: Integer; 190 178 begin 191 Core.Translator.TranslateComponentRecursive(Self);192 Core.ThemeManager.UseTheme(Self);193 179 for I := 0 to ToolBar1.ButtonCount - 1 do 194 180 ToolBar1.Buttons[I].Hint := ToolBar1.Buttons[I].Caption; -
trunk/Forms/FormImportPattern.lfm
r218 r219 1 1 object FormImportPattern: TFormImportPattern 2 2 Left = 459 3 Height = 4313 Height = 517 4 4 Top = 235 5 Width = 6625 Width = 794 6 6 Caption = 'Import pattern' 7 ClientHeight = 4318 ClientWidth = 6629 DesignTimePPI = 1 207 ClientHeight = 517 8 ClientWidth = 794 9 DesignTimePPI = 144 10 10 OnCreate = FormCreate 11 11 OnShow = FormShow 12 12 Position = poScreenCenter 13 LCLVersion = ' 2.0.2.0'13 LCLVersion = '3.6.0.0' 14 14 object Label8: TLabel 15 Left = 2 416 Height = 2 017 Top = 1 318 Width = 7515 Left = 29 16 Height = 26 17 Top = 16 18 Width = 98 19 19 Caption = 'Start string:' 20 20 ParentColor = False 21 21 end 22 22 object Label9: TLabel 23 Left = 2 424 Height = 2 025 Top = 5326 Width = 6923 Left = 29 24 Height = 26 25 Top = 64 26 Width = 91 27 27 Caption = 'End string:' 28 28 ParentColor = False 29 29 end 30 30 object EditBlockEnd: TEdit 31 Left = 18332 Height = 2833 Top = 4834 Width = 46131 Left = 220 32 Height = 43 33 Top = 58 34 Width = 552 35 35 Anchors = [akTop, akLeft, akRight] 36 36 TabOrder = 1 37 37 end 38 38 object EditBlockStart: TEdit 39 Left = 18340 Height = 2841 Top = 842 Width = 46139 Left = 220 40 Height = 43 41 Top = 10 42 Width = 552 43 43 Anchors = [akTop, akLeft, akRight] 44 44 TabOrder = 0 45 45 end 46 46 object ButtonCancel: TButton 47 Left = 46448 Height = 2549 Top = 38450 Width = 7547 Left = 556 48 Height = 30 49 Top = 461 50 Width = 90 51 51 Anchors = [akRight, akBottom] 52 52 Caption = 'Cancel' … … 55 55 end 56 56 object ButtonOk: TButton 57 Left = 56058 Height = 2559 Top = 38460 Width = 7557 Left = 672 58 Height = 30 59 Top = 461 60 Width = 90 61 61 Anchors = [akRight, akBottom] 62 62 Caption = 'Ok' … … 65 65 end 66 66 object Label10: TLabel 67 Left = 2 468 Height = 2 069 Top = 8870 Width = 4667 Left = 29 68 Height = 26 69 Top = 106 70 Width = 59 71 71 Caption = 'Action:' 72 72 ParentColor = False 73 73 end 74 74 object Label11: TLabel 75 Left = 2 476 Height = 2 077 Top = 1 2078 Width = 5875 Left = 29 76 Height = 26 77 Top = 144 78 Width = 73 79 79 Caption = 'Variable:' 80 80 ParentColor = False 81 81 end 82 82 object ComboBoxAction: TComboBox 83 Left = 18384 Height = 2885 Top = 8786 Width = 46183 Left = 220 84 Height = 42 85 Top = 104 86 Width = 552 87 87 Anchors = [akTop, akLeft, akRight] 88 ItemHeight = 2088 ItemHeight = 0 89 89 Style = csDropDownList 90 90 TabOrder = 2 91 91 end 92 92 object ComboBoxVariable: TComboBox 93 Left = 18394 Height = 2895 Top = 1 2096 Width = 46193 Left = 220 94 Height = 38 95 Top = 144 96 Width = 552 97 97 Anchors = [akTop, akLeft, akRight] 98 ItemHeight = 2098 ItemHeight = 0 99 99 Items.Strings = ( 100 100 '' … … 104 104 end 105 105 object CheckBoxRepetition: TCheckBox 106 Left = 2 4107 Height = 24108 Top = 1 60109 Width = 93106 Left = 29 107 Height = 30 108 Top = 192 109 Width = 112 110 110 Caption = 'Repetition' 111 111 TabOrder = 4 -
trunk/Forms/FormImportPattern.pas
r218 r219 1 unit UFormImportPattern; 2 3 {$mode delphi} 1 unit FormImportPattern; 4 2 5 3 interface … … 7 5 uses 8 6 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, 9 UAcronym;7 Acronym; 10 8 11 9 type … … 34 32 end; 35 33 36 var37 FormImportPattern: TFormImportPattern;38 34 39 35 implementation … … 42 38 43 39 uses 44 UCore;40 Core; 45 41 46 42 { TFormImportPattern } … … 53 49 procedure TFormImportPattern.FormCreate(Sender: TObject); 54 50 begin 55 Core.Translator.TranslateComponentRecursive(Self);56 Core.ThemeManager.UseTheme(Self);57 51 InitControls; 58 52 end; -
trunk/Forms/FormImportSource.lfm
r218 r219 1 1 object FormImportSource: TFormImportSource 2 2 Left = 493 3 Height = 4593 Height = 551 4 4 Top = 315 5 Width = 6205 Width = 744 6 6 Caption = 'Import source' 7 ClientHeight = 459 8 ClientWidth = 620 9 DesignTimePPI = 120 10 OnClose = FormClose 11 OnCreate = FormCreate 7 ClientHeight = 551 8 ClientWidth = 744 9 DesignTimePPI = 144 12 10 OnShow = FormShow 13 11 Position = poScreenCenter 14 LCLVersion = ' 2.0.2.0'12 LCLVersion = '3.6.0.0' 15 13 object EditName: TEdit 16 Left = 1 3517 Height = 2818 Top = 1 019 Width = 47114 Left = 162 15 Height = 43 16 Top = 12 17 Width = 565 20 18 Anchors = [akTop, akLeft, akRight] 21 19 TabOrder = 0 22 20 end 23 21 object Label1: TLabel 24 Left = 1 025 Height = 2 026 Top = 927 Width = 4322 Left = 12 23 Height = 26 24 Top = 11 25 Width = 56 28 26 Caption = 'Name:' 29 27 ParentColor = False 30 28 end 31 29 object Label2: TLabel 32 Left = 1 033 Height = 2 034 Top = 4935 Width = 7830 Left = 12 31 Height = 26 32 Top = 59 33 Width = 101 36 34 Caption = 'Source URL:' 37 35 ParentColor = False 38 36 end 39 37 object EditURL: TEdit 40 Left = 1 3641 Height = 2842 Top = 4943 Width = 35038 Left = 163 39 Height = 43 40 Top = 59 41 Width = 420 44 42 Anchors = [akTop, akLeft, akRight] 45 43 TabOrder = 1 46 44 end 47 45 object ButtonOk: TButton 48 Left = 53149 Height = 2550 Top = 42151 Width = 7546 Left = 637 47 Height = 30 48 Top = 505 49 Width = 90 52 50 Anchors = [akRight, akBottom] 53 51 Caption = 'Ok' … … 56 54 end 57 55 object ButtonCancel: TButton 58 Left = 42959 Height = 2560 Top = 42161 Width = 7556 Left = 515 57 Height = 30 58 Top = 505 59 Width = 90 62 60 Anchors = [akRight, akBottom] 63 61 Caption = 'Cancel' … … 66 64 end 67 65 object Label3: TLabel 68 Left = 1 069 Height = 2 070 Top = 9671 Width = 8466 Left = 12 67 Height = 26 68 Top = 115 69 Width = 106 72 70 Caption = 'Data format:' 73 71 ParentColor = False 74 72 end 75 73 object ComboBox1: TComboBox 76 Left = 1 3577 Height = 2878 Top = 9179 Width = 35080 Anchors = [akTop, akLeft, akRight] 81 ItemHeight = 2074 Left = 162 75 Height = 42 76 Top = 109 77 Width = 420 78 Anchors = [akTop, akLeft, akRight] 79 ItemHeight = 0 82 80 Style = csDropDownList 83 81 TabOrder = 2 84 82 end 85 83 object ButtonShowFormat: TButton 86 Left = 49387 Height = 2588 Top = 9189 Width = 1 1284 Left = 592 85 Height = 30 86 Top = 109 87 Width = 134 90 88 Anchors = [akTop, akRight] 91 89 Caption = 'Configure' 90 TabOrder = 3 92 91 OnClick = ButtonShowFormatClick 93 TabOrder = 394 92 end 95 93 object CheckBoxEnabled: TCheckBox 96 Left = 1 097 Height = 2498 Top = 1 2899 Width = 7894 Left = 12 95 Height = 30 96 Top = 154 97 Width = 94 100 98 Caption = 'Enabled' 101 99 TabOrder = 4 102 100 end 103 101 object Label4: TLabel 104 Left = 1 0105 Height = 2 0106 Top = 1 60107 Width = 74102 Left = 12 103 Height = 26 104 Top = 192 105 Width = 95 108 106 Caption = 'Categories:' 109 107 ParentColor = False 110 108 end 111 109 object ListBox1: TListBox 112 Left = 1 35113 Height = 1 41114 Top = 1 60115 Width = 471110 Left = 162 111 Height = 169 112 Top = 192 113 Width = 565 116 114 Anchors = [akTop, akLeft, akRight] 117 115 ItemHeight = 0 … … 120 118 ScrollWidth = 469 121 119 TabOrder = 5 120 TopIndex = -1 122 121 end 123 122 object Button1: TButton 124 Left = 1 35125 Height = 25126 Top = 3 12127 Width = 75123 Left = 162 124 Height = 30 125 Top = 374 126 Width = 90 128 127 Action = ACategoryAdd 129 128 TabOrder = 6 130 129 end 131 130 object Button2: TButton 132 Left = 2 31133 Height = 25134 Top = 3 12135 Width = 75131 Left = 277 132 Height = 30 133 Top = 374 134 Width = 90 136 135 Action = ACategoryRemove 137 136 TabOrder = 7 138 137 end 139 138 object Bevel1: TBevel 140 Left = 1 0139 Left = 12 141 140 Height = 2 142 Top = 4 08143 Width = 597141 Top = 490 142 Width = 716 144 143 Anchors = [akLeft, akRight, akBottom] 145 144 end 146 145 object Label5: TLabel 147 Left = 1 0148 Height = 2 0149 Top = 352150 Width = 73146 Left = 12 147 Height = 26 148 Top = 422 149 Width = 97 151 150 Caption = 'User name:' 152 151 ParentColor = False 153 152 end 154 153 object Label6: TLabel 155 Left = 3 05156 Height = 2 0157 Top = 351158 Width = 65154 Left = 366 155 Height = 26 156 Top = 421 157 Width = 87 159 158 Caption = 'Password:' 160 159 ParentColor = False 161 160 end 162 161 object EditUserName: TEdit 163 Left = 1 36164 Height = 28165 Top = 351166 Width = 1 53162 Left = 163 163 Height = 43 164 Top = 421 165 Width = 184 167 166 TabOrder = 8 168 167 end 169 168 object EditPassword: TEdit 170 Left = 436171 Height = 28172 Top = 351173 Width = 1 53169 Left = 523 170 Height = 43 171 Top = 421 172 Width = 184 174 173 EchoMode = emPassword 175 174 PasswordChar = '*' … … 177 176 end 178 177 object ButtonOpenURL: TButton 179 Left = 493180 Height = 25181 Top = 52182 Width = 1 12178 Left = 592 179 Height = 30 180 Top = 62 181 Width = 134 183 182 Anchors = [akTop, akRight] 184 183 Caption = 'Open URL' 184 TabOrder = 12 185 185 OnClick = ButtonOpenURLClick 186 TabOrder = 12187 186 end 188 187 object ActionList1: TActionList 189 left = 384190 top = 208188 Left = 461 189 Top = 250 191 190 object ACategoryRemove: TAction 192 191 Caption = 'Remove' … … 201 200 end 202 201 object PopupMenuCategory: TPopupMenu 203 left = 208204 top = 208202 Left = 250 203 Top = 250 205 204 object MenuItem2: TMenuItem 206 205 Action = ACategoryAdd -
trunk/Forms/FormImportSource.pas
r218 r219 1 unit UFormImportSource; 2 3 {$mode delphi} 1 unit FormImportSource; 4 2 5 3 interface … … 7 5 uses 8 6 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, 9 ActnList, Menus, ExtCtrls, UAcronym, LCLIntf;7 ActnList, Menus, ExtCtrls, Acronym, LCLIntf; 10 8 11 9 type … … 44 42 procedure ButtonOpenURLClick(Sender: TObject); 45 43 procedure ButtonShowFormatClick(Sender: TObject); 46 procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);47 procedure FormCreate(Sender: TObject);48 44 procedure FormShow(Sender: TObject); 49 private50 { private declarations }51 45 public 52 46 procedure UpdateInterface; … … 55 49 end; 56 50 57 var58 FormImportSource: TFormImportSource;59 51 60 52 implementation … … 63 55 64 56 uses 65 UCore, UFormImportFormat, UFormCategorySelect;57 Core, FormImportFormat, FormCategorySelect; 66 58 67 59 { TFormImportSource } … … 70 62 var 71 63 NewImportFormat: TImportFormat; 64 FormImportFormat: TFormImportFormat; 72 65 begin 73 66 if ComboBox1.ItemIndex <> -1 then begin … … 80 73 FormImportFormat.Save(NewImportFormat); 81 74 TImportFormat(ComboBox1.Items.Objects[ComboBox1.ItemIndex]).Assign(NewImportFormat); 82 Core. AcronymDb.Modified := True;75 Core.Core.AcronymDb.Modified := True; 83 76 ComboBox1.Items.Strings[ComboBox1.ItemIndex] := NewImportFormat.Name; 84 77 end; … … 90 83 end; 91 84 92 procedure TFormImportSource.FormClose(Sender: TObject;93 var CloseAction: TCloseAction);94 begin95 Core.PersistentForm1.Save(Self);96 end;97 98 procedure TFormImportSource.FormCreate(Sender: TObject);99 begin100 Core.Translator.TranslateComponentRecursive(Self);101 Core.ThemeManager.UseTheme(Self);102 end;103 104 85 procedure TFormImportSource.FormShow(Sender: TObject); 105 86 begin 106 Core.PersistentForm1.Load(Self);107 87 UpdateInterface; 108 88 end; … … 116 96 var 117 97 I: Integer; 98 FormCategorySelect: TFormCategorySelect; 118 99 begin 119 100 FormCategorySelect := TFormCategorySelect.Create(Self); … … 155 136 EditName.Text := ImportSource.Name; 156 137 EditURL.Text := ImportSource.URL; 157 while ComboBox1.Items.Count > Core. AcronymDb.ImportFormats.Count do138 while ComboBox1.Items.Count > Core.Core.AcronymDb.ImportFormats.Count do 158 139 ComboBox1.Items.Delete(ComboBox1.Items.Count - 1); 159 while ComboBox1.Items.Count < Core. AcronymDb.ImportFormats.Count do140 while ComboBox1.Items.Count < Core.Core.AcronymDb.ImportFormats.Count do 160 141 ComboBox1.Items.Add(''); 161 for I := 0 to Core. AcronymDb.ImportFormats.Count - 1 do begin162 ComboBox1.Items[I] := TImportFormat(Core. AcronymDb.ImportFormats[I]).Name;163 ComboBox1.Items.Objects[I] := Core. AcronymDb.ImportFormats[I];142 for I := 0 to Core.Core.AcronymDb.ImportFormats.Count - 1 do begin 143 ComboBox1.Items[I] := TImportFormat(Core.Core.AcronymDb.ImportFormats[I]).Name; 144 ComboBox1.Items.Objects[I] := Core.Core.AcronymDb.ImportFormats[I]; 164 145 end; 165 146 ComboBox1.ItemIndex := ComboBox1.Items.IndexOfObject(ImportSource.Format); -
trunk/Forms/FormImportSources.lfm
r218 r219 1 1 object FormImportSources: TFormImportSources 2 2 Left = 475 3 Height = 4 143 Height = 497 4 4 Top = 329 5 Width = 8125 Width = 974 6 6 Caption = 'Import sources' 7 ClientHeight = 414 8 ClientWidth = 812 9 DesignTimePPI = 120 10 OnClose = FormClose 7 ClientHeight = 497 8 ClientWidth = 974 9 DesignTimePPI = 144 11 10 OnCreate = FormCreate 12 11 OnShow = FormShow 13 12 Position = poScreenCenter 14 LCLVersion = ' 2.0.2.0'13 LCLVersion = '3.6.0.0' 15 14 object ToolBar1: TToolBar 16 15 Left = 0 17 Height = 2618 Top = 38819 Width = 81216 Height = 33 17 Top = 464 18 Width = 974 20 19 Align = alBottom 21 20 Caption = 'ToolBar1' … … 30 29 end 31 30 object ToolButton2: TToolButton 32 Left = 3 031 Left = 36 33 32 Top = 2 34 33 Action = AModify 35 34 end 36 35 object ToolButton3: TToolButton 37 Left = 5936 Left = 71 38 37 Top = 2 39 38 Action = ARemove 40 39 end 41 40 object ToolButton4: TToolButton 42 Left = 8841 Left = 106 43 42 Top = 2 44 43 Action = AProcess … … 46 45 end 47 46 object ListView1: TListView 48 Left = 449 Height = 35150 Top = 3351 Width = 80447 Left = 5 48 Height = 419 49 Top = 40 50 Width = 964 52 51 Align = alClient 53 BorderSpacing.Left = 454 BorderSpacing.Right = 455 BorderSpacing.Bottom = 452 BorderSpacing.Left = 5 53 BorderSpacing.Right = 5 54 BorderSpacing.Bottom = 5 56 55 Checkboxes = True 57 56 Columns = < 58 57 item 59 58 Caption = 'Name' 60 Width = 1 5059 Width = 180 61 60 end 62 61 item 63 62 Caption = 'URL' 64 Width = 25063 Width = 300 65 64 end 66 65 item 67 66 Caption = 'Categories' 68 Width = 2 0067 Width = 240 69 68 end 70 69 item 71 70 Caption = 'Count' 72 Width = 7071 Width = 84 73 72 end 74 73 item 75 74 Caption = 'Date' 76 Width = 1 1475 Width = 145 77 76 end> 78 77 MultiSelect = True … … 91 90 end 92 91 object ListViewFilter1: TListViewFilter 93 Left = 494 Height = 2995 Top = 496 Width = 80492 Left = 5 93 Height = 35 94 Top = 5 95 Width = 964 97 96 OnChange = ListViewFilter1Change 98 97 Align = alTop 99 BorderSpacing.Left = 4100 BorderSpacing.Top = 4101 BorderSpacing.Right = 498 BorderSpacing.Left = 5 99 BorderSpacing.Top = 5 100 BorderSpacing.Right = 5 102 101 end 103 102 object ActionList1: TActionList 104 103 Images = Core.ImageList1 105 left = 408106 top = 224104 Left = 490 105 Top = 269 107 106 object AAdd: TAction 108 107 Caption = 'Add' … … 139 138 object PopupMenuImportSource: TPopupMenu 140 139 Images = Core.ImageList1 141 left = 147142 top = 220140 Left = 176 141 Top = 264 143 142 object MenuItem1: TMenuItem 144 143 Action = AAdd … … 167 166 ShowDelay = 0 168 167 AutoClose = False 169 left = 299170 top = 119168 Left = 359 169 Top = 143 171 170 end 172 171 object ListViewSort1: TListViewSort … … 177 176 Column = 0 178 177 Order = soNone 179 left = 547180 top = 172178 Left = 656 179 Top = 206 181 180 end 182 181 end -
trunk/Forms/FormImportSources.pas
r218 r219 1 unit UFormImportSources; 2 3 {$mode delphi} 1 unit FormImportSources; 4 2 5 3 interface … … 7 5 uses 8 6 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls, 9 ActnList, Menus, UAcronym, UJobProgressView, UListViewSort, LazUTF8, fgl; 7 ActnList, Menus, Acronym, JobProgressView, ListViewSort, LazUTF8, 8 Generics.Collections; 10 9 11 10 type … … 44 43 procedure AProcessExecute(Sender: TObject); 45 44 procedure ARemoveExecute(Sender: TObject); 46 procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);47 45 procedure FormCreate(Sender: TObject); 48 46 procedure FormShow(Sender: TObject); 49 47 procedure ListView1Change(Sender: TObject; Item: TListItem; 50 48 Change: TItemChange); 51 procedure ListView1Click(Sender: TObject);52 49 procedure ListView1Data(Sender: TObject; Item: TListItem); 53 50 procedure ListView1DblClick(Sender: TObject); … … 62 59 private 63 60 procedure ProcessImportJob(Job: TJob); 64 procedure FilterList(List: T FPGObjectList<TObject>);61 procedure FilterList(List: TObjectList<TObject>); 65 62 public 66 63 ImportSources: TImportSources; … … 69 66 end; 70 67 71 var72 FormImportSources: TFormImportSources;73 68 74 69 implementation … … 77 72 78 73 uses 79 UCore, UFormMain, UFormImportSource;74 Core, FormMain, FormImportSource; 80 75 81 76 resourcestring … … 172 167 procedure TFormImportSources.FormShow(Sender: TObject); 173 168 begin 174 Core.PersistentForm1.Load(Self);175 169 UpdateList; 176 Core. ScaleDPI1.ScaleControl(ToolBar1,Core.ScaleDPI1.DesignDPI);170 Core.Core.ScaleDPI1.ScaleControl(ToolBar1, Core.Core.ScaleDPI1.DesignDPI); 177 171 end; 178 172 … … 182 176 if Assigned(Item) and (Change = ctState) then begin 183 177 TImportSource(Item.Data).Enabled := Item.Checked; 184 Core.AcronymDb.Modified := True; 185 end; 186 end; 187 188 procedure TFormImportSources.ListView1Click(Sender: TObject); 189 begin 190 178 Core.Core.AcronymDb.Modified := True; 179 end; 191 180 end; 192 181 … … 194 183 var 195 184 NewImportSource: TImportSource; 185 FormImportSource: TFormImportSource; 196 186 I: Integer; 197 187 begin … … 212 202 213 203 NewImportSource := nil; 214 Core. AcronymDb.Modified := True;204 Core.Core.AcronymDb.Modified := True; 215 205 UpdateList; 216 206 end else ShowMessage(Format(SImportSourceAlreadyExists, [NewImportSource.Name])); … … 229 219 if ListView1.Items[I].Selected then begin 230 220 TImportSource(ListView1.Items[I].Data).Enabled := False; 231 Core. AcronymDb.Modified := True;221 Core.Core.AcronymDb.Modified := True; 232 222 end; 233 223 UpdateList; … … 241 231 if ListView1.Items[I].Selected then begin 242 232 TImportSource(ListView1.Items[I].Data).Enabled := True; 243 Core. AcronymDb.Modified := True;233 Core.Core.AcronymDb.Modified := True; 244 234 end; 245 235 UpdateList; … … 249 239 var 250 240 NewImportSource: TImportSource; 241 FormImportSource: TFormImportSource; 251 242 begin 252 243 if Assigned(ListView1.Selected) then begin … … 261 252 if not Assigned(ImportSources.SearchByName(NewImportSource.Name)) then begin; 262 253 TImportSource(ListView1.Selected.Data).Assign(NewImportSource); 263 Core. AcronymDb.Modified := True;254 Core.Core.AcronymDb.Modified := True; 264 255 end else ShowMessage(Format(SImportSourceAlreadyExists, [NewImportSource.Name])); 265 256 end else begin 266 257 TImportSource(ListView1.Selected.Data).Assign(NewImportSource); 267 Core. AcronymDb.Modified := True;258 Core.Core.AcronymDb.Modified := True; 268 259 end; 269 260 … … 283 274 begin 284 275 if Assigned(ListView1.Selected) then begin 285 Core. AcronymDb.AddedCount := 0;276 Core.Core.AcronymDb.AddedCount := 0; 286 277 JobProgressView1.AddJob(SProcessSelectedSource, ProcessImportJob); 287 278 JobProgressView1.Start; 288 279 ShowMessage(Format(SAddedCount, [TImportSource(ListView1.Selected.Data).ItemCount, 289 Core. AcronymDb.AddedCount]));280 Core.Core.AcronymDb.AddedCount])); 290 281 end; 291 282 end; … … 296 287 end; 297 288 298 procedure TFormImportSources.FilterList(List: T FPGObjectList<TObject>);289 procedure TFormImportSources.FilterList(List: TObjectList<TObject>); 299 290 var 300 291 I: Integer; … … 344 335 end; 345 336 346 procedure TFormImportSources.FormClose(Sender: TObject;347 var CloseAction: TCloseAction);348 begin349 Core.PersistentForm1.Save(Self);350 end;351 352 337 procedure TFormImportSources.FormCreate(Sender: TObject); 353 338 var 354 339 I: Integer; 355 340 begin 356 Core.Translator.TranslateComponentRecursive(Self);357 Core.ThemeManager.UseTheme(Self);358 341 for I := 0 to ToolBar1.ButtonCount - 1 do 359 342 ToolBar1.Buttons[I].Hint := ToolBar1.Buttons[I].Caption; -
trunk/Forms/FormMain.lfm
r218 r219 1 1 object FormMain: TFormMain 2 2 Left = 417 3 Height = 7 473 Height = 713 4 4 Top = 453 5 5 Width = 1106 … … 12 12 OnCloseQuery = FormCloseQuery 13 13 OnCreate = FormCreate 14 OnDestroy = FormDestroy15 14 OnHide = FormHide 16 15 OnResize = FormResize 17 16 OnShow = FormShow 18 LCLVersion = ' 2.0.12.0'17 LCLVersion = '3.6.0.0' 19 18 object PanelMain: TPanel 20 19 Left = 0 21 Height = 60 520 Height = 604 22 21 Top = 81 23 22 Width = 1106 24 23 Align = alClient 25 24 BevelOuter = bvNone 26 ClientHeight = 60 525 ClientHeight = 604 27 26 ClientWidth = 1106 28 27 ParentFont = False … … 38 37 object ListViewAcronyms: TListView 39 38 Left = 5 40 Height = 54 939 Height = 548 41 40 Top = 50 42 41 Width = 1095 … … 317 316 object StatusBar1: TStatusBar 318 317 Left = 0 319 Height = 2 7320 Top = 68 6318 Height = 28 319 Top = 685 321 320 Width = 1106 322 321 Panels = < … … 605 604 end 606 605 end 607 object AboutDialog1: TAboutDialog608 Translator = Core.Translator609 ThemeManager = Core.ThemeManager610 ApplicationInfo = Core.ApplicationInfo1611 Left = 392612 Top = 448613 end614 606 end -
trunk/Forms/FormMain.pas
r218 r219 1 unit UFormMain; 2 3 {$mode delphi}{$H+} 1 unit FormMain; 4 2 5 3 interface … … 7 5 uses 8 6 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, Menus, 9 ComCtrls, StdCtrls, ExtCtrls, ActnList, Grids, UAcronym, UPersistentForm,10 URegistry, ULastOpenedList, UListViewSort, UJobProgressView, UAboutDialog,11 Registry, fgl, LazUTF8, LazFileUtils;7 ComCtrls, StdCtrls, ExtCtrls, ActnList, Grids, Acronym, PersistentForm, 8 RegistryEx, LastOpenedList, ListViewSort, JobProgressView, FormAbout, 9 Registry, Generics.Collections, LazUTF8, LazFileUtils, FormEx; 12 10 13 11 type … … 15 13 { TFormMain } 16 14 17 TFormMain = class(TForm) 18 AboutDialog1: TAboutDialog; 15 TFormMain = class(TFormEx) 19 16 AFilterShowItemsWithoutFilter: TAction; 20 17 ADocumentCheck: TAction; … … 138 135 procedure FormCloseQuery(Sender: TObject; var CanClose: boolean); 139 136 procedure FormCreate(Sender: TObject); 140 procedure FormDestroy(Sender: TObject);141 137 procedure LastOpenedList1Change(Sender: TObject); 142 138 procedure ListViewAcronymsData(Sender: TObject; Item: TListItem); … … 158 154 function FilterCell(Text1, Text2: string): Boolean; 159 155 procedure ProcessImportsJob(Job: TJob); 160 procedure FilterList(List: T FPGObjectList<TObject>);156 procedure FilterList(List: TObjectList<TObject>); 161 157 procedure OpenRecentClick(Sender: TObject); 162 158 procedure SetToolbarHints; … … 167 163 procedure UpdateInterface; 168 164 procedure ProjectOpen(FileName: string); 169 function CompareStrings(Strings1, Strings2: TStrings): Boolean; 170 end; 171 172 var 173 FormMain: TFormMain; 165 end; 174 166 175 167 resourcestring … … 186 178 187 179 uses 188 UFormImport, UFormSettings, UFormCategories, UFormAcronyms, UFormExport,189 UFormImportSources, UFormImportFormats, UCore, UFormCheck;180 FormImport, FormSettings, FormCategories, FormAcronyms, FormExport, 181 FormImportSources, FormImportFormats, Core, FormCheck; 190 182 191 183 resourcestring … … 232 224 procedure TFormMain.FormHide(Sender: TObject); 233 225 begin 234 if Core. InitializeFinished thenCore.PersistentForm1.Save(Self);226 if Core.Core.InitializeFinished then Core.Core.PersistentForm1.Save(Self); 235 227 UpdateInterface; 236 228 end; … … 243 235 procedure TFormMain.FormClose(Sender: TObject; var CloseAction: TCloseAction); 244 236 begin 245 Core.PersistentForm1.Save(Self); 246 Core.SaveConfig; 237 Core.Core.SaveConfig; 247 238 end; 248 239 … … 260 251 261 252 procedure TFormMain.ADocumentCheckExecute(Sender: TObject); 253 var 254 FormCheck: TFormCheck; 262 255 begin 263 256 FormCheck := TFormCheck.Create(Self); … … 272 265 273 266 procedure TFormMain.AExportExecute(Sender: TObject); 267 var 268 FormExport: TFormExport; 274 269 begin 275 270 FormExport := TFormExport.Create(Self); … … 287 282 begin 288 283 DoClose := False; 289 if Assigned(Core. AcronymDb) then begin290 if Core. AcronymDb.Modified then begin284 if Assigned(Core.Core.AcronymDb) then begin 285 if Core.Core.AcronymDb.Modified then begin 291 286 ModalResult := MessageDlg(SAppExit, SAppExitQuery, 292 287 mtConfirmation, [mbYes, mbNo, mbCancel], 0); … … 301 296 end; 302 297 if DoClose then begin 303 FreeAndNil(Core. AcronymDb);298 FreeAndNil(Core.Core.AcronymDb); 304 299 UpdateAcronymsList; 305 300 UpdateInterface; … … 311 306 begin 312 307 AFileClose.Execute; 313 if not Assigned(Core. AcronymDb) then begin314 Core. AcronymDb := TAcronymDb.Create;315 Core. AcronymDb.FileName := DefaultFileName;316 Core. AcronymDb.Acronyms.Clear;317 Core. AcronymDb.OnUpdate.Add(AcronymDbUpdate);308 if not Assigned(Core.Core.AcronymDb) then begin 309 Core.Core.AcronymDb := TAcronymDb.Create; 310 Core.Core.AcronymDb.FileName := DefaultFileName; 311 Core.Core.AcronymDb.Acronyms.Clear; 312 Core.Core.AcronymDb.OnUpdate.Add(AcronymDbUpdate); 318 313 UpdateAcronymsList; 319 314 UpdateInterface; … … 324 319 begin 325 320 OpenDialog1.DefaultExt := ProjectExt; 326 if Assigned(Core. AcronymDb) then begin327 OpenDialog1.InitialDir := ExtractFileDir(Core. AcronymDb.FileName);321 if Assigned(Core.Core.AcronymDb) then begin 322 OpenDialog1.InitialDir := ExtractFileDir(Core.Core.AcronymDb.FileName); 328 323 OpenDialog1.Filter := SFileFilter; 329 OpenDialog1.FileName := ExtractFileName(Core. AcronymDb.FileName);324 OpenDialog1.FileName := ExtractFileName(Core.Core.AcronymDb.FileName); 330 325 end; 331 326 if OpenDialog1.Execute then begin … … 337 332 begin 338 333 SaveDialog1.DefaultExt := ProjectExt; 339 SaveDialog1.InitialDir := ExtractFileDir(Core. AcronymDb.FileName);334 SaveDialog1.InitialDir := ExtractFileDir(Core.Core.AcronymDb.FileName); 340 335 SaveDialog1.Filter := SFileFilter; 341 SaveDialog1.FileName := ExtractFileName(Core. AcronymDb.FileName);336 SaveDialog1.FileName := ExtractFileName(Core.Core.AcronymDb.FileName); 342 337 if SaveDialog1.Execute then begin 343 Core. AcronymDb.SaveToFile(SaveDialog1.FileName);338 Core.Core.AcronymDb.SaveToFile(SaveDialog1.FileName); 344 339 LastOpenedList1.AddItem(SaveDialog1.FileName); 345 340 UpdateInterface; … … 349 344 procedure TFormMain.AFileSaveExecute(Sender: TObject); 350 345 begin 351 if FileExists(Core. AcronymDb.FileName) then begin352 Core. AcronymDb.SaveToFile(Core.AcronymDb.FileName);353 LastOpenedList1.AddItem(Core. AcronymDb.FileName);346 if FileExists(Core.Core.AcronymDb.FileName) then begin 347 Core.Core.AcronymDb.SaveToFile(Core.Core.AcronymDb.FileName); 348 LastOpenedList1.AddItem(Core.Core.AcronymDb.FileName); 354 349 UpdateInterface; 355 350 end else AFileSaveAs.Execute; … … 382 377 383 378 procedure TFormMain.AImportExecute(Sender: TObject); 379 var 380 FormImport: TFormImport; 384 381 begin 385 382 FormImport := TFormImport.Create(Self); … … 394 391 395 392 procedure TFormMain.AManageAcronymExecute(Sender: TObject); 393 var 394 FormAcronyms: TFormAcronyms; 396 395 begin 397 396 FormAcronyms := TFormAcronyms.Create(Self); … … 399 398 if Assigned(ListViewAcronyms.Selected) then 400 399 FormAcronyms.FocusAcronym := ListViewAcronyms.Selected.Data; 401 FormAcronyms.Acronyms := Core. AcronymDb.Acronyms;400 FormAcronyms.Acronyms := Core.Core.AcronymDb.Acronyms; 402 401 FormAcronyms.ShowModal; 403 402 UpdateAcronymsList; … … 411 410 begin 412 411 ImportTotalItemCount := 0; 413 Core. AcronymDb.AddedCount := 0;414 Core. JobProgressView1.AddJob(SProcessImportSources, ProcessImportsJob);415 Core. JobProgressView1.Start;416 ShowMessage(Format(SAddedCount, [ImportTotalItemCount, Core. AcronymDb.AddedCount]));412 Core.Core.AcronymDb.AddedCount := 0; 413 Core.Core.JobProgressView1.AddJob(SProcessImportSources, ProcessImportsJob); 414 Core.Core.JobProgressView1.Start; 415 ShowMessage(Format(SAddedCount, [ImportTotalItemCount, Core.Core.AcronymDb.AddedCount])); 417 416 UpdateAcronymsList; 418 417 UpdateInterface; … … 423 422 I: Integer; 424 423 begin 425 for I := 0 to Core. AcronymDb.ImportSources.Count - 1 do426 with TImportSource(Core.AcronymDb.ImportSources[I])do424 for I := 0 to Core.Core.AcronymDb.ImportSources.Count - 1 do 425 with Core.Core.AcronymDb.ImportSources[I] do 427 426 if Enabled then begin 428 427 Process; 429 428 ImportTotalItemCount := ImportTotalItemCount + ItemCount; 430 Job.Progress.Max := Core. AcronymDb.ImportSources.Count;429 Job.Progress.Max := Core.Core.AcronymDb.ImportSources.Count; 431 430 Job.Progress.Value := I; 432 431 if Job.Terminate then Break; … … 435 434 436 435 procedure TFormMain.ASettingsExecute(Sender: TObject); 436 var 437 FormSettings: TFormSettings; 437 438 begin 438 439 FormSettings := TFormSettings.Create(Self); … … 441 442 if FormSettings.ShowModal = mrOk then begin 442 443 FormSettings.Save; 443 Core. SaveConfig;444 Core. ThemeManager.UseTheme(Self);444 Core.Core.SaveConfig; 445 Core.Core.ThemeManager.UseTheme(Self); 445 446 end; 446 447 finally … … 450 451 451 452 procedure TFormMain.AShowAboutExecute(Sender: TObject); 452 begin 453 AboutDialog1.Show; 453 var 454 FormAbout: TFormAbout; 455 begin 456 FormAbout := TFormAbout.Create(nil); 457 try 458 FormAbout.ApplicationInfo := Core.Core.ApplicationInfo1; 459 FormAbout.ShowModal; 460 finally 461 FormAbout.Free; 462 end; 454 463 end; 455 464 456 465 procedure TFormMain.AShowAcronymsExecute(Sender: TObject); 466 var 467 FormAcronyms: TFormAcronyms; 457 468 begin 458 469 FormAcronyms := TFormAcronyms.Create(Self); 459 470 try 460 FormAcronyms.Acronyms := Core. AcronymDb.Acronyms;471 FormAcronyms.Acronyms := Core.Core.AcronymDb.Acronyms; 461 472 FormAcronyms.ShowModal; 462 473 UpdateAcronymsList; … … 468 479 469 480 procedure TFormMain.AShowCategoriesExecute(Sender: TObject); 481 var 482 FormCategories: TFormCategories; 470 483 begin 471 484 FormCategories := TFormCategories.Create(Self); 472 485 try 473 FormCategories.Categories := Core. AcronymDb.Categories;486 FormCategories.Categories := Core.Core.AcronymDb.Categories; 474 487 FormCategories.ShowModal; 475 488 UpdateAcronymsList; … … 487 500 488 501 procedure TFormMain.AShowImportFormatsExecute(Sender: TObject); 502 var 503 FormImportFormats: TFormImportFormats; 489 504 begin 490 505 FormImportFormats := TFormImportFormats.Create(Self); 491 506 try 492 FormImportFormats.ImportFormats := Core. AcronymDb.ImportFormats;507 FormImportFormats.ImportFormats := Core.Core.AcronymDb.ImportFormats; 493 508 FormImportFormats.ShowModal; 494 509 UpdateInterface; … … 499 514 500 515 procedure TFormMain.AShowImportSourcesExecute(Sender: TObject); 516 var 517 FormImportSources: TFormImportSources; 501 518 begin 502 519 FormImportSources := TFormImportSources.Create(Self); 503 520 try 504 FormImportSources.ImportSources := Core. AcronymDb.ImportSources;521 FormImportSources.ImportSources := Core.Core.AcronymDb.ImportSources; 505 522 FormImportSources.ShowModal; 506 523 UpdateAcronymsList; … … 511 528 end; 512 529 513 procedure TFormMain.FormDestroy(Sender: TObject);514 begin515 end;516 517 530 procedure TFormMain.FormShow(Sender: TObject); 518 531 begin 519 Core. Initialize;532 Core.Core.Initialize; 520 533 521 534 if Visible then begin 522 Core.PersistentForm1.Load(Self);523 Core.ThemeManager.UseTheme(Self);524 535 ListViewFilter1.UpdateFromListView(ListViewAcronyms); 525 536 UpdateInterface; … … 529 540 ListViewFilter1.StringGrid.SetFocus; 530 541 end; 531 Core. ScaleDPI1.ScaleControl(CoolBar1,Core.ScaleDPI1.DesignDPI);542 Core.Core.ScaleDPI1.ScaleControl(CoolBar1, Core.Core.ScaleDPI1.DesignDPI); 532 543 CoolBar1.AutosizeBands; 533 544 end; … … 587 598 procedure TFormMain.ListViewSort1Filter(ListViewSort: TListViewSort); 588 599 begin 589 Core. AcronymDb.AssignToList(ListViewSort1.List, AFilterEnabledCategories.Checked);600 Core.Core.AcronymDb.AssignToList(ListViewSort1.List, AFilterEnabledCategories.Checked); 590 601 FilterList(ListViewSort1.List); 591 602 end; … … 628 639 begin 629 640 AFileClose.Execute; 630 if not Assigned(Core. AcronymDb) then begin641 if not Assigned(Core.Core.AcronymDb) then begin 631 642 try 632 643 AFileNew.Execute; 633 Core. AcronymDb.LoadFromFile(FileName);644 Core.Core.AcronymDb.LoadFromFile(FileName); 634 645 LastOpenedList1.AddItem(FileName); 635 646 finally … … 640 651 end; 641 652 642 function TFormMain.CompareStrings(Strings1, Strings2: TStrings): Boolean; 643 var 644 I: Integer; 645 begin 646 Result := Strings1.Count = Strings2.Count; 647 if not Result then Exit; 648 for I := 0 to Strings1.Count - 1 do 649 if (Strings1[I] <> Strings2[I]) or (Strings1.Objects[I] <> Strings2.Objects[I]) then begin 650 Result := False; 651 Exit; 652 end; 653 end; 654 655 procedure TFormMain.FilterList(List: TFPGObjectList<TObject>); 653 procedure TFormMain.FilterList(List: TObjectList<TObject>); 656 654 var 657 655 I: Integer; … … 686 684 begin 687 685 AFileClose.Execute; 688 if not Assigned(Core. AcronymDb) then begin686 if not Assigned(Core.Core.AcronymDb) then begin 689 687 AFileNew.Execute; 690 Core. AcronymDb.LoadFromFile(TMenuItem(Sender).Caption);688 Core.Core.AcronymDb.LoadFromFile(TMenuItem(Sender).Caption); 691 689 LastOpenedList1.AddItem(TMenuItem(Sender).Caption); 692 690 UpdateAcronymsList; … … 697 695 procedure TFormMain.UpdateAcronymsList; 698 696 begin 699 if Assigned(Core. AcronymDb) then begin697 if Assigned(Core.Core.AcronymDb) then begin 700 698 ListViewSort1.Refresh; 701 699 end else begin … … 710 708 Title: string; 711 709 begin 712 ListViewAcronyms.Enabled := Assigned(Core. AcronymDb);713 AFileClose.Enabled := Assigned(Core. AcronymDb);714 AFileSave.Enabled := Assigned(Core. AcronymDb) andCore.AcronymDb.Modified;715 AFileSaveAs.Enabled := Assigned(Core. AcronymDb);716 AImport.Enabled := Assigned(Core. AcronymDb);717 AExport.Enabled := Assigned(Core. AcronymDb);718 AProcessImports.Enabled := Assigned(Core. AcronymDb);719 AShowCategories.Enabled := Assigned(Core. AcronymDb);720 AShowAcronyms.Enabled := Assigned(Core. AcronymDb);721 AShowCategories.Enabled := Assigned(Core. AcronymDb);722 AShowImportSources.Enabled := Assigned(Core. AcronymDb);723 AShowImportFormats.Enabled := Assigned(Core. AcronymDb);710 ListViewAcronyms.Enabled := Assigned(Core.Core.AcronymDb); 711 AFileClose.Enabled := Assigned(Core.Core.AcronymDb); 712 AFileSave.Enabled := Assigned(Core.Core.AcronymDb) and Core.Core.AcronymDb.Modified; 713 AFileSaveAs.Enabled := Assigned(Core.Core.AcronymDb); 714 AImport.Enabled := Assigned(Core.Core.AcronymDb); 715 AExport.Enabled := Assigned(Core.Core.AcronymDb); 716 AProcessImports.Enabled := Assigned(Core.Core.AcronymDb); 717 AShowCategories.Enabled := Assigned(Core.Core.AcronymDb); 718 AShowAcronyms.Enabled := Assigned(Core.Core.AcronymDb); 719 AShowCategories.Enabled := Assigned(Core.Core.AcronymDb); 720 AShowImportSources.Enabled := Assigned(Core.Core.AcronymDb); 721 AShowImportFormats.Enabled := Assigned(Core.Core.AcronymDb); 724 722 CoolBar1.Visible := MenuItemToolbar.Checked; 725 723 PanelParam.Visible := MenuItemParam.Checked; 726 AHide.Enabled := FormMain.Visible;724 AHide.Enabled := Visible; 727 725 AManageAcronym.Enabled := Assigned(ListViewAcronyms.Selected); 728 726 StatusBar1.Visible := MenuItemStatusBar.Checked; 729 727 730 728 Title := ''; 731 if Assigned(Core. AcronymDb) and (ExtractFileNameWithoutExt(ExtractFileName(Core.AcronymDb.FileName)) <> '') then begin732 Title := ExtractFileNameWithoutExt(ExtractFileName(Core. AcronymDb.FileName));733 if Core. AcronymDb.Modified then Title := Title + ' (' + SModified + ')';729 if Assigned(Core.Core.AcronymDb) and (ExtractFileNameWithoutExt(ExtractFileName(Core.Core.AcronymDb.FileName)) <> '') then begin 730 Title := ExtractFileNameWithoutExt(ExtractFileName(Core.Core.AcronymDb.FileName)); 731 if Core.Core.AcronymDb.Modified then Title := Title + ' (' + SModified + ')'; 734 732 end; 735 733 if Title <> '' then Title := Title + ' - '; 736 Title := Title + Core. ApplicationInfo1.AppName;734 Title := Title + Core.Core.ApplicationInfo1.AppName; 737 735 {$IFDEF WINDOWS} 738 736 // Under Linux title would affect reg.xml path for storing registry settings … … 740 738 {$ENDIF} 741 739 Caption := Title; 742 if Assigned(Core. AcronymDb) then begin740 if Assigned(Core.Core.AcronymDb) then begin 743 741 StatusBar1.Panels[0].Text := Format(SAcronymsCount, [ 744 Core. AcronymDb.Acronyms.Count]);742 Core.Core.AcronymDb.Acronyms.Count]); 745 743 StatusBar1.Panels[1].Text := Format(SMeaningsCount, [ 746 Core. AcronymDb.GetMeaningsCount]);744 Core.Core.AcronymDb.GetMeaningsCount]); 747 745 end else begin 748 746 StatusBar1.Panels[0].Text := ''; … … 753 751 procedure TFormMain.LoadConfig; 754 752 begin 755 Core. PersistentForm1.RegistryContext :=Core.ApplicationInfo1.GetRegistryContext;756 RegistryContext := TRegistryContext.Create(Core. ApplicationInfo1.RegistryRoot,757 Core. ApplicationInfo1.RegistryKey + '\RecentFiles');753 Core.Core.PersistentForm1.RegistryContext := Core.Core.ApplicationInfo1.GetRegistryContext; 754 RegistryContext := TRegistryContext.Create(Core.Core.ApplicationInfo1.RegistryRoot, 755 Core.Core.ApplicationInfo1.RegistryKey + '\RecentFiles'); 758 756 LastOpenedList1.LoadFromRegistry(RegistryContext); 759 757 … … 761 759 // If installed in Linux system then use installation directory for po files 762 760 if Application.ExeName = '/usr/bin/' + ExtractFileNameOnly(Application.ExeName) then 763 Core. Translator.POFilesFolder := '/usr/share/' + ExtractFileNameOnly(Application.ExeName) + '/languages';761 Core.Core.Translator.POFilesFolder := '/usr/share/' + ExtractFileNameOnly(Application.ExeName) + '/languages'; 764 762 {$ENDIF} 765 763 766 764 with TRegistryEx.Create do 767 765 try 768 RootKey := RegistryRootHKEY[Core. ApplicationInfo1.RegistryRoot];769 OpenKey(Core. ApplicationInfo1.RegistryKey, True);766 RootKey := RegistryRootHKEY[Core.Core.ApplicationInfo1.RegistryRoot]; 767 OpenKey(Core.Core.ApplicationInfo1.RegistryKey, True); 770 768 AFilterSameLength.Checked := ReadBoolWithDefault('SameLength', False); 771 769 AFilterSameLetterCase.Checked := ReadBoolWithDefault('SameLetterCase', False); … … 784 782 RootKey := HKEY_CURRENT_USER; 785 783 OpenKey(RegistryRunKey, True); 786 Core. StartOnLogon := ValueExists('Acronym Decoder');784 Core.Core.StartOnLogon := ValueExists('Acronym Decoder'); 787 785 finally 788 786 Free; … … 792 790 procedure TFormMain.SaveConfig; 793 791 begin 794 RegistryContext := TRegistryContext.Create(Core. ApplicationInfo1.RegistryRoot,795 Core. ApplicationInfo1.RegistryKey + '\RecentFiles');792 RegistryContext := TRegistryContext.Create(Core.Core.ApplicationInfo1.RegistryRoot, 793 Core.Core.ApplicationInfo1.RegistryKey + '\RecentFiles'); 796 794 LastOpenedList1.SaveToRegistry(RegistryContext); 797 795 798 796 with TRegistryEx.Create do 799 797 try 800 RootKey := RegistryRootHKEY[Core. ApplicationInfo1.RegistryRoot];801 OpenKey(Core. ApplicationInfo1.RegistryKey, True);798 RootKey := RegistryRootHKEY[Core.Core.ApplicationInfo1.RegistryRoot]; 799 OpenKey(Core.Core.ApplicationInfo1.RegistryKey, True); 802 800 WriteBool('SameLength', AFilterSameLength.Checked); 803 801 WriteBool('SameLetterCase', AFilterSameLetterCase.Checked); … … 815 813 RootKey := HKEY_CURRENT_USER; 816 814 OpenKey(RegistryRunKey, True); 817 if Core. StartOnLogon then begin818 if Core. StartMinimizedToTray then WriteString('Acronym Decoder', Application.ExeName + ' ' + Application.OptionChar + 't')815 if Core.Core.StartOnLogon then begin 816 if Core.Core.StartMinimizedToTray then WriteString('Acronym Decoder', Application.ExeName + ' ' + Application.OptionChar + 't') 819 817 else WriteString('Acronym Decoder', Application.ExeName) 820 818 end else DeleteValue('Acronym Decoder'); -
trunk/Forms/FormSettings.lfm
r218 r219 1 1 object FormSettings: TFormSettings 2 2 Left = 798 3 Height = 3 713 Height = 394 4 4 Top = 367 5 5 Width = 590 6 6 Caption = 'Settings' 7 ClientHeight = 3 717 ClientHeight = 394 8 8 ClientWidth = 590 9 Constraints.MinHeight = 328 10 Constraints.MinWidth = 389 11 DesignTimePPI = 120 12 OnClose = FormClose 9 Constraints.MinHeight = 394 10 Constraints.MinWidth = 467 11 DesignTimePPI = 144 13 12 OnCreate = FormCreate 14 OnShow = FormShow15 13 Position = poScreenCenter 16 LCLVersion = ' 1.8.2.0'14 LCLVersion = '3.6.0.0' 17 15 object ComboBoxLanguage: TComboBox 18 Left = 1 5219 Height = 2820 Top = 2 421 Width = 2 0822 ItemHeight = 2016 Left = 182 17 Height = 42 18 Top = 29 19 Width = 250 20 ItemHeight = 0 23 21 Style = csDropDownList 24 22 TabOrder = 0 25 23 end 26 24 object Label1: TLabel 27 Left = 1 628 Height = 2 029 Top = 2 430 Width = 6825 Left = 19 26 Height = 26 27 Top = 29 28 Width = 88 31 29 Caption = 'Language:' 32 30 ParentColor = False 33 31 end 34 32 object ButtonOk: TButton 35 Left = 50636 Height = 2537 Top = 3 2638 Width = 7533 Left = 489 34 Height = 30 35 Top = 340 36 Width = 90 39 37 Anchors = [akRight, akBottom] 40 38 Caption = 'Ok' 41 39 ModalResult = 1 42 OnClick = ButtonOkClick43 40 TabOrder = 3 44 41 end 45 42 object ButtonCancel: TButton 46 Left = 41047 Height = 2548 Top = 3 2649 Width = 7543 Left = 374 44 Height = 30 45 Top = 340 46 Width = 90 50 47 Anchors = [akRight, akBottom] 51 48 Caption = 'Cancel' … … 54 51 end 55 52 object CheckBoxAlwaysOnTop: TCheckBox 56 Left = 1 657 Height = 2458 Top = 6459 Width = 1 1853 Left = 19 54 Height = 30 55 Top = 77 56 Width = 145 60 57 Caption = 'Always on top' 61 58 TabOrder = 1 62 59 end 63 60 object CheckBoxStartOnLogon: TCheckBox 64 Left = 1 665 Height = 2466 Top = 9667 Width = 1 5061 Left = 19 62 Height = 30 63 Top = 115 64 Width = 188 68 65 Caption = 'Start on user logon' 69 66 Color = clDefault 70 OnChange = CheckBoxStartOnLogonChange71 67 ParentColor = False 72 68 ParentFont = False 73 69 TabOrder = 4 70 OnChange = CheckBoxStartOnLogonChange 74 71 end 75 72 object CheckBoxStartMinimizedToTray: TCheckBox 76 Left = 4877 Height = 2478 Top = 1 2879 Width = 17673 Left = 58 74 Height = 30 75 Top = 154 76 Width = 218 80 77 Caption = 'Start minimized to tray' 81 78 TabOrder = 5 82 79 end 83 80 object CheckBoxAutomaticDPI: TCheckBox 84 Left = 1 685 Height = 2486 Top = 19287 Width = 1 2081 Left = 19 82 Height = 30 83 Top = 230 84 Width = 148 88 85 Caption = 'Automatic DPI' 89 OnChange = CheckBoxAutomaticDPIChange90 86 TabOrder = 6 91 87 Visible = False 88 OnChange = CheckBoxAutomaticDPIChange 92 89 end 93 90 object SpinEditDPI: TSpinEdit 94 Left = 9495 Height = 2896 Top = 2 2297 Width = 9791 Left = 113 92 Height = 43 93 Top = 266 94 Width = 116 98 95 MaxValue = 300 99 96 MinValue = 96 … … 103 100 end 104 101 object Label2: TLabel 105 Left = 46106 Height = 2 0107 Top = 2 22108 Width = 26102 Left = 55 103 Height = 26 104 Top = 266 105 Width = 35 109 106 Caption = 'DPI:' 110 107 ParentColor = False … … 112 109 end 113 110 object CheckBoxReopenLastFileOnStart: TCheckBox 114 Left = 1 6115 Height = 24116 Top = 1 60117 Width = 181111 Left = 19 112 Height = 30 113 Top = 192 114 Width = 226 118 115 Caption = 'Reopen last file on start' 119 116 TabOrder = 8 120 117 end 121 118 object Bevel1: TBevel 122 Left = 8119 Left = 10 123 120 Height = 2 124 Top = 3 09125 Width = 5 70121 Top = 320 122 Width = 566 126 123 Anchors = [akLeft, akRight, akBottom] 127 124 end 128 125 object Label3: TLabel 129 Left = 1 6130 Height = 2 0131 Top = 264132 Width = 48126 Left = 19 127 Height = 26 128 Top = 317 129 Width = 63 133 130 Caption = 'Theme:' 134 131 ParentColor = False 135 132 end 136 133 object ComboBoxTheme: TComboBox 137 Left = 1 52138 Height = 28139 Top = 264140 Width = 2 08141 ItemHeight = 20134 Left = 182 135 Height = 42 136 Top = 317 137 Width = 250 138 ItemHeight = 0 142 139 Style = csDropDownList 143 140 TabOrder = 9 -
trunk/Forms/FormSettings.pas
r218 r219 1 unit UFormSettings; 2 3 {$mode delphi} 1 unit FormSettings; 4 2 5 3 interface … … 7 5 uses 8 6 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, 9 Menus, Spin, ExtCtrls, ULanguages;7 Menus, Spin, ExtCtrls, Languages, FormEx; 10 8 11 9 type … … 13 11 { TFormSettings } 14 12 15 TFormSettings = class(TForm )13 TFormSettings = class(TFormEx) 16 14 Bevel1: TBevel; 17 15 ButtonOk: TButton; … … 28 26 Label3: TLabel; 29 27 SpinEditDPI: TSpinEdit; 30 procedure ButtonOkClick(Sender: TObject);31 28 procedure CheckBoxAutomaticDPIChange(Sender: TObject); 32 29 procedure CheckBoxStartOnLogonChange(Sender: TObject); 33 procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);34 30 procedure FormCreate(Sender: TObject); 35 procedure FormShow(Sender: TObject);36 private37 { private declarations }38 31 public 39 32 procedure Load; … … 42 35 end; 43 36 44 var45 FormSettings: TFormSettings;46 37 47 38 implementation … … 50 41 51 42 uses 52 UCore, UTheme;43 Core, Theme; 53 44 54 45 { TFormSettings } 55 56 procedure TFormSettings.FormShow(Sender: TObject);57 begin58 Core.PersistentForm1.Load(Self);59 end;60 61 procedure TFormSettings.ButtonOkClick(Sender: TObject);62 begin63 end;64 46 65 47 procedure TFormSettings.CheckBoxAutomaticDPIChange(Sender: TObject); … … 73 55 end; 74 56 75 procedure TFormSettings.FormClose(Sender: TObject; var CloseAction: TCloseAction76 );77 begin78 Core.PersistentForm1.Save(Self);79 end;80 81 57 procedure TFormSettings.FormCreate(Sender: TObject); 82 58 begin 83 Core.Translator.TranslateComponentRecursive(Self); 84 Core.ThemeManager.UseTheme(Self); 85 Core.ThemeManager.Themes.LoadToStrings(ComboBoxTheme.Items); 86 Core.Translator.LanguageListToStrings(ComboBoxLanguage.Items); 59 Core.Core.Translator.TranslateComponentRecursive(Self); 60 Core.Core.ThemeManager.Themes.LoadToStrings(ComboBoxTheme.Items); 61 Core.Core.Translator.LanguageListToStrings(ComboBoxLanguage.Items); 87 62 end; 88 63 89 64 procedure TFormSettings.Load; 90 65 begin 91 ComboBoxLanguage.ItemIndex := ComboBoxLanguage.Items.IndexOfObject(Core. Translator.Language);66 ComboBoxLanguage.ItemIndex := ComboBoxLanguage.Items.IndexOfObject(Core.Core.Translator.Language); 92 67 if ComboBoxLanguage.ItemIndex = -1 then ComboBoxLanguage.ItemIndex := 0; 93 ComboBoxTheme.ItemIndex := ComboBoxTheme.Items.IndexOfObject(Core. ThemeManager.Theme);68 ComboBoxTheme.ItemIndex := ComboBoxTheme.Items.IndexOfObject(Core.Core.ThemeManager.Theme); 94 69 if ComboBoxTheme.ItemIndex = -1 then ComboBoxTheme.ItemIndex := 0; 95 CheckBoxAlwaysOnTop.Checked := Core. AlwaysOnTop;96 CheckBoxStartOnLogon.Checked := Core. StartOnLogon;97 CheckBoxStartMinimizedToTray.Checked := Core. StartMinimizedToTray;98 CheckBoxAutomaticDPI.Checked := Core. ScaleDPI1.AutoDetect;99 SpinEditDPI.Value := Core. ScaleDPI1.DPI.X;100 CheckBoxReopenLastFileOnStart.Checked := Core. ReopenLastFileOnStart;70 CheckBoxAlwaysOnTop.Checked := Core.Core.AlwaysOnTop; 71 CheckBoxStartOnLogon.Checked := Core.Core.StartOnLogon; 72 CheckBoxStartMinimizedToTray.Checked := Core.Core.StartMinimizedToTray; 73 CheckBoxAutomaticDPI.Checked := Core.Core.ScaleDPI1.AutoDetect; 74 SpinEditDPI.Value := Core.Core.ScaleDPI1.DPI.X; 75 CheckBoxReopenLastFileOnStart.Checked := Core.Core.ReopenLastFileOnStart; 101 76 UpdateInterface; 102 77 end; … … 105 80 begin 106 81 if ComboBoxLanguage.ItemIndex <> -1 then 107 Core. Translator.Language := TLanguage(ComboBoxLanguage.Items.Objects[ComboBoxLanguage.ItemIndex]);82 Core.Core.Translator.Language := TLanguage(ComboBoxLanguage.Items.Objects[ComboBoxLanguage.ItemIndex]); 108 83 if ComboBoxTheme.ItemIndex <> -1 then 109 Core. ThemeManager.Theme := TTheme(ComboBoxTheme.Items.Objects[ComboBoxTheme.ItemIndex]);110 Core. AlwaysOnTop := CheckBoxAlwaysOnTop.Checked;111 Core. StartOnLogon := CheckBoxStartOnLogon.Checked;112 Core. StartMinimizedToTray := CheckBoxStartMinimizedToTray.Checked;113 Core. ScaleDPI1.AutoDetect := CheckBoxAutomaticDPI.Checked;114 Core. ScaleDPI1.DPI := Point(SpinEditDPI.Value, SpinEditDPI.Value);115 Core. ReopenLastFileOnStart := CheckBoxReopenLastFileOnStart.Checked;84 Core.Core.ThemeManager.Theme := TTheme(ComboBoxTheme.Items.Objects[ComboBoxTheme.ItemIndex]); 85 Core.Core.AlwaysOnTop := CheckBoxAlwaysOnTop.Checked; 86 Core.Core.StartOnLogon := CheckBoxStartOnLogon.Checked; 87 Core.Core.StartMinimizedToTray := CheckBoxStartMinimizedToTray.Checked; 88 Core.Core.ScaleDPI1.AutoDetect := CheckBoxAutomaticDPI.Checked; 89 Core.Core.ScaleDPI1.DPI := Point(SpinEditDPI.Value, SpinEditDPI.Value); 90 Core.Core.ReopenLastFileOnStart := CheckBoxReopenLastFileOnStart.Checked; 116 91 end; 117 92
Note:
See TracChangeset
for help on using the changeset viewer.