Changeset 219 for trunk/Forms


Ignore:
Timestamp:
Jan 17, 2025, 9:05:54 PM (5 days ago)
Author:
chronos
Message:
  • Modified: Updated Common package.
  • Modified: Remove U prefix from unit names.
  • Modified: Use Gneeric.Collections instead of fgl.
  • Modified: Do not use global form variables.
Location:
trunk/Forms
Files:
42 moved

Legend:

Unmodified
Added
Removed
  • trunk/Forms/FormAcronym.lfm

    r218 r219  
    11object FormAcronym: TFormAcronym
    22  Left = 845
    3   Height = 744
    4   Top = 528
    5   Width = 858
     3  Height = 893
     4  Top = 480
     5  Width = 1030
    66  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
    1210  OnShow = FormShow
    1311  Position = poScreenCenter
    14   LCLVersion = '2.0.2.0'
     12  LCLVersion = '3.6.0.0'
    1513  object Label1: TLabel
    16     Left = 10
    17     Height = 20
    18     Top = 20
    19     Width = 43
     14    Left = 12
     15    Height = 26
     16    Top = 24
     17    Width = 56
    2018    Caption = 'Name:'
    2119    ParentColor = False
     
    2321  end
    2422  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]
    3128    ParentFont = False
    3229    TabOrder = 0
     30    OnKeyPress = EditMeaningKeyPress
    3331  end
    3432  object Label2: TLabel
    35     Left = 10
    36     Height = 20
    37     Top = 61
    38     Width = 61
     33    Left = 12
     34    Height = 26
     35    Top = 73
     36    Width = 79
    3937    Caption = 'Meaning:'
    4038    ParentColor = False
     
    4240  end
    4341  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]
    5047    ParentFont = False
    5148    TabOrder = 1
     49    OnKeyPress = EditMeaningKeyPress
    5250  end
    5351  object ButtonOk: TButton
    54     Left = 733
    55     Height = 31
    56     Top = 694
    57     Width = 94
     52    Left = 880
     53    Height = 37
     54    Top = 833
     55    Width = 113
    5856    Anchors = [akRight, akBottom]
    5957    Caption = 'Ok'
    6058    ModalResult = 1
    61     OnKeyPress = EditMeaningKeyPress
    6259    ParentFont = False
    6360    TabOrder = 7
     61    OnKeyPress = EditMeaningKeyPress
    6462  end
    6563  object ButtonCancel: TButton
    66     Left = 613
    67     Height = 31
    68     Top = 694
    69     Width = 94
     64    Left = 736
     65    Height = 37
     66    Top = 833
     67    Width = 113
    7068    Anchors = [akRight, akBottom]
    7169    Caption = 'Cancel'
    7270    ModalResult = 2
    73     OnKeyPress = EditMeaningKeyPress
    7471    ParentFont = False
    7572    TabOrder = 6
     73    OnKeyPress = EditMeaningKeyPress
    7674  end
    7775  object Label3: TLabel
    78     Left = 10
    79     Height = 20
    80     Top = 110
    81     Width = 79
     76    Left = 12
     77    Height = 26
     78    Top = 132
     79    Width = 102
    8280    Caption = 'Description:'
    8381    ParentColor = False
     
    8583  end
    8684  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]
    9390    ParentFont = False
    9491    ScrollBars = ssAutoBoth
    9592    TabOrder = 2
     93    OnKeyPress = EditMeaningKeyPress
    9694  end
    9795  object Label4: TLabel
    98     Left = 15
    99     Height = 20
    100     Top = 260
    101     Width = 74
     96    Left = 18
     97    Height = 26
     98    Top = 312
     99    Width = 95
    102100    Caption = 'Categories:'
    103101    ParentColor = False
     
    105103  end
    106104  object ListBoxCategories: TListBox
    107     Left = 191
    108     Height = 176
    109     Top = 260
    110     Width = 651
     105    Left = 229
     106    Height = 211
     107    Top = 312
     108    Width = 782
    111109    Anchors = [akTop, akLeft, akRight]
    112110    ItemHeight = 0
    113111    MultiSelect = True
    114     OnKeyPress = EditMeaningKeyPress
    115     OnSelectionChange = ListBoxCategoriesSelectionChange
    116112    ParentFont = False
    117113    PopupMenu = PopupMenuCategory
    118114    ScrollWidth = 518
    119115    TabOrder = 3
     116    TopIndex = -1
     117    OnKeyPress = EditMeaningKeyPress
     118    OnSelectionChange = ListBoxCategoriesSelectionChange
    120119  end
    121120  object Button1: TButton
    122     Left = 191
    123     Height = 31
    124     Top = 450
    125     Width = 109
     121    Left = 229
     122    Height = 37
     123    Top = 540
     124    Width = 131
    126125    Action = ACategoryAdd
    127     OnKeyPress = EditMeaningKeyPress
    128126    ParentFont = False
    129127    TabOrder = 4
     128    OnKeyPress = EditMeaningKeyPress
    130129  end
    131130  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
    135144    Width = 130
    136     Action = ACategoryRemove
    137     OnKeyPress = EditMeaningKeyPress
    138     ParentFont = False
    139     TabOrder = 5
    140   end
    141   object Label5: TLabel
    142     Left = 10
    143     Height = 20
    144     Top = 490
    145     Width = 101
    146145    Caption = 'Imported from:'
    147146    ParentColor = False
     
    149148  end
    150149  object ListBoxImportSources: TListBox
    151     Left = 191
    152     Height = 140
    153     Top = 490
    154     Width = 652
     150    Left = 229
     151    Height = 168
     152    Top = 588
     153    Width = 783
    155154    Anchors = [akTop, akLeft, akRight]
    156155    ItemHeight = 0
    157156    MultiSelect = True
    158     OnKeyPress = EditMeaningKeyPress
    159     OnSelectionChange = ListBoxCategoriesSelectionChange
    160157    ParentFont = False
    161158    ScrollWidth = 519
    162159    TabOrder = 8
     160    TopIndex = -1
     161    OnKeyPress = EditMeaningKeyPress
     162    OnSelectionChange = ListBoxCategoriesSelectionChange
    163163  end
    164164  object ActionList1: TActionList
    165     left = 451
    166     top = 300
     165    Left = 541
     166    Top = 360
    167167    object ACategoryRemove: TAction
    168168      Caption = 'Remove'
     
    177177  end
    178178  object PopupMenuCategory: TPopupMenu
    179     left = 240
    180     top = 305
     179    Left = 288
     180    Top = 366
    181181    object MenuItem2: TMenuItem
    182182      Action = ACategoryAdd
  • trunk/Forms/FormAcronym.pas

    r218 r219  
    1 unit UFormAcronym;
    2 
    3 {$mode delphi}
     1unit FormAcronym;
    42
    53interface
     
    75uses
    86  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, Menus,
    9   StdCtrls, ActnList, UAcronym;
     7  StdCtrls, ActnList, Acronym, FormEx;
    108
    119type
     
    1311  { TFormAcronym }
    1412
    15   TFormAcronym = class(TForm)
     13  TFormAcronym = class(TFormEx)
    1614    ACategoryRemove: TAction;
    1715    ACategoryAdd: TAction;
     
    3735    procedure ACategoryRemoveExecute(Sender: TObject);
    3836    procedure EditMeaningKeyPress(Sender: TObject; var Key: char);
    39     procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
    40     procedure FormCreate(Sender: TObject);
    4137    procedure FormShow(Sender: TObject);
    4238    procedure ListBoxCategoriesSelectionChange(Sender: TObject; User: boolean);
     
    4844  end;
    4945
    50 var
    51   FormAcronym: TFormAcronym;
    5246
    5347implementation
     
    5650
    5751uses
    58   UCore, UFormCategorySelect;
     52  FormCategorySelect;
    5953
    6054{ TFormAcronym }
    61 
    62 procedure TFormAcronym.FormClose(Sender: TObject; var CloseAction: TCloseAction
    63   );
    64 begin
    65   Core.PersistentForm1.Save(Self);
    66 end;
    67 
    68 procedure TFormAcronym.FormCreate(Sender: TObject);
    69 begin
    70   Core.Translator.TranslateComponentRecursive(Self);
    71   Core.ThemeManager.UseTheme(Self);
    72 end;
    7355
    7456procedure TFormAcronym.ACategoryAddExecute(Sender: TObject);
    7557var
    7658  I: Integer;
     59  FormCategorySelect: TFormCategorySelect;
    7760begin
    7861  FormCategorySelect := TFormCategorySelect.Create(Self);
     
    11194procedure TFormAcronym.FormShow(Sender: TObject);
    11295begin
    113   Core.PersistentForm1.Load(Self);
    11496  UpdateInterface;
    11597end;
  • trunk/Forms/FormAcronyms.lfm

    r218 r219  
    11object FormAcronyms: TFormAcronyms
    2   Left = 426
    3   Height = 558
    4   Top = 251
    5   Width = 740
     2  Left = 755
     3  Height = 670
     4  Top = 284
     5  Width = 888
    66  Caption = 'Acronyms'
    7   ClientHeight = 558
    8   ClientWidth = 740
    9   DesignTimePPI = 120
    10   OnClose = FormClose
     7  ClientHeight = 670
     8  ClientWidth = 888
     9  DesignTimePPI = 144
    1110  OnCreate = FormCreate
    1211  OnShow = FormShow
    1312  Position = poScreenCenter
    14   LCLVersion = '2.0.2.0'
     13  LCLVersion = '3.6.0.0'
    1514  object ListViewAcronyms: TListView
    16     Left = 4
    17     Height = 466
    18     Top = 34
    19     Width = 732
     15    Left = 5
     16    Height = 563
     17    Top = 41
     18    Width = 878
    2019    Align = alClient
    21     BorderSpacing.Left = 4
    22     BorderSpacing.Right = 4
    23     BorderSpacing.Bottom = 4
     20    BorderSpacing.Left = 5
     21    BorderSpacing.Right = 5
     22    BorderSpacing.Bottom = 5
    2423    Columns = <   
    2524      item
    2625        Caption = 'Name'
    27         Width = 100
     26        Width = 120
    2827      end   
    2928      item
    3029        Caption = 'Description'
    31         Width = 300
     30        Width = 360
    3231      end   
    3332      item
    3433        Caption = 'Categories'
    35         Width = 312
     34        Width = 383
    3635      end>
    3736    MultiSelect = True
     
    4948  end
    5049  object ListViewFilter1: TListViewFilter
    51     Left = 4
    52     Height = 30
    53     Top = 4
    54     Width = 732
     50    Left = 5
     51    Height = 36
     52    Top = 5
     53    Width = 878
    5554    OnChange = ListViewFilter1Change
    5655    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
    7459  end
    7560  object ToolBar1: TToolBar
     61    AnchorSideBottom.Control = StatusBar1
    7662    Left = 0
    77     Height = 26
    78     Top = 504
    79     Width = 740
     63    Height = 33
     64    Top = 609
     65    Width = 888
    8066    Align = alBottom
    8167    Caption = 'ToolBar1'
     
    8369    ParentShowHint = False
    8470    ShowHint = True
    85     TabOrder = 3
     71    TabOrder = 2
    8672    object ToolButton1: TToolButton
    8773      Left = 1
     
    9076    end
    9177    object ToolButton2: TToolButton
    92       Left = 30
     78      Left = 36
    9379      Top = 2
    9480      Action = AModify
    9581    end
    9682    object ToolButton3: TToolButton
    97       Left = 59
     83      Left = 71
    9884      Top = 2
    9985      Action = ARemove
    10086    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
    101101  end
    102102  object ListViewSort1: TListViewSort
     
    107107    Column = 0
    108108    Order = soUp
    109     left = 248
    110     top = 168
     109    Left = 298
     110    Top = 202
    111111  end
    112112  object ActionList1: TActionList
    113113    Images = Core.ImageList1
    114     left = 248
    115     top = 232
     114    Left = 298
     115    Top = 278
    116116    object AAdd: TAction
    117117      Caption = 'Add'
     
    140140  object PopupMenuAcronym: TPopupMenu
    141141    Images = Core.ImageList1
    142     left = 248
    143     top = 296
     142    Left = 298
     143    Top = 355
    144144    object MenuItem4: TMenuItem
    145145      Action = AAdd
  • trunk/Forms/FormAcronyms.pas

    r218 r219  
    1 unit UFormAcronyms;
    2 
    3 {$mode delphi}
     1unit FormAcronyms;
    42
    53interface
     
    75uses
    86  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;
    109
    1110type
     
    1312  { TFormAcronyms }
    1413
    15   TFormAcronyms = class(TForm)
     14  TFormAcronyms = class(TFormEx)
    1615    AAdd: TAction;
    1716    ASelectAll: TAction;
     
    3635    procedure ARemoveExecute(Sender: TObject);
    3736    procedure ASelectAllExecute(Sender: TObject);
    38     procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
    3937    procedure FormCreate(Sender: TObject);
    4038    procedure FormShow(Sender: TObject);
     
    5250    FAcronyms: TAcronyms;
    5351    MeaningCount: Integer;
    54     procedure FilterList(List: TFPGObjectList<TObject>);
     52    function AcronymComparer(constref Item1, Item2: TAcronym): Integer;
     53    procedure FilterList(List: TObjectList<TObject>);
    5554    procedure SetAcronyms(AValue: TAcronyms);
    5655    procedure UpdateAcronymsList;
     
    6160  end;
    6261
    63 var
    64   FormAcronyms: TFormAcronyms;
    6562
    6663implementation
     
    6966
    7067uses
    71   UCore, UFormMain, UFormAcronym;
     68  Core, FormAcronym;
    7269
    7370resourcestring
     
    117114  I: Integer;
    118115begin
    119   Core.PersistentForm1.Load(Self);
    120116  ListViewFilter1.UpdateFromListView(ListViewAcronyms);
    121117  UpdateAcronymsList;
    122   Core.ScaleDPI1.ScaleControl(ToolBar1, Core.ScaleDPI1.DesignDPI);
     118  Core.Core.ScaleDPI1.ScaleControl(ToolBar1, Core.Core.ScaleDPI1.DesignDPI);
    123119
    124120  // Focus line with acronym
     
    140136  Meaning: TAcronymMeaning;
    141137  I: Integer;
     138  FormAcronym: TFormAcronym;
    142139begin
    143140  TempEntry := TAcronymEntry.Create;
     
    175172  Meaning: TAcronymMeaning;
    176173  I: Integer;
     174  FormAcronym: TFormAcronym;
    177175begin
    178176  if Assigned(ListViewAcronyms.Selected) then
     
    194192        (TempEntry.Meaning <> Name) or
    195193        (TempEntry.Description <> Description) or
    196         not FormMain.CompareStrings(TempEntry.Categories, TempCategories) then begin
     194        not Core.Core.CompareStrings(TempEntry.Categories, TempCategories) then begin
    197195          // TODO: Update item inplace if possible
    198196          Acronyms.Db.RemoveMeaning(TAcronymMeaning(ListViewAcronyms.Selected.Data));
     
    246244end;
    247245
    248 procedure TFormAcronyms.FormClose(Sender: TObject; var CloseAction: TCloseAction
    249   );
    250 begin
    251   Core.PersistentForm1.Save(Self);
    252 end;
    253 
    254246procedure TFormAcronyms.FormCreate(Sender: TObject);
    255247var
     
    258250  FocusAcronym := nil;
    259251  MeaningCount := 0;
    260   Core.Translator.TranslateComponentRecursive(Self);
    261   Core.ThemeManager.UseTheme(Self);
    262252  for I := 0 to ToolBar1.ButtonCount - 1 do
    263253    ToolBar1.Buttons[I].Hint := ToolBar1.Buttons[I].Caption;
     
    288278end;
    289279
     280function TFormAcronyms.AcronymComparer(constref Item1, Item2: TAcronym): Integer;
     281begin
     282  Result := CompareStr(TAcronym(Item1).Name, TAcronym(Item2).Name);
     283end;
     284
    290285procedure TFormAcronyms.ListViewSort1Filter(ListViewSort: TListViewSort);
    291286begin
    292   Acronyms.Db.Acronyms.Sort(AcronymComparer);
     287  Acronyms.Db.Acronyms.Sort(TComparer<TAcronym>.Construct(AcronymComparer));
    293288  Acronyms.Db.AssignToList(ListViewSort1.List);
    294289  MeaningCount := ListViewSort1.List.Count;
     
    296291end;
    297292
    298 procedure TFormAcronyms.FilterList(List: TFPGObjectList<TObject>);
     293procedure TFormAcronyms.FilterList(List: TObjectList<TObject>);
    299294var
    300295  I: Integer;
  • trunk/Forms/FormCategories.lfm

    r218 r219  
    11object FormCategories: TFormCategories
    22  Left = 516
    3   Height = 429
     3  Height = 515
    44  Top = 439
    5   Width = 784
     5  Width = 941
    66  Caption = 'Acronym categories'
    7   ClientHeight = 429
    8   ClientWidth = 784
    9   DesignTimePPI = 120
    10   OnClose = FormClose
     7  ClientHeight = 515
     8  ClientWidth = 941
     9  DesignTimePPI = 144
    1110  OnCreate = FormCreate
    1211  OnShow = FormShow
    1312  Position = poScreenCenter
    14   LCLVersion = '2.0.2.0'
     13  LCLVersion = '3.6.0.0'
    1514  object ListViewCategories: TListView
    16     Left = 4
    17     Height = 395
    18     Top = 4
    19     Width = 776
     15    Left = 5
     16    Height = 472
     17    Top = 5
     18    Width = 931
    2019    Align = alClient
    21     BorderSpacing.Around = 4
     20    BorderSpacing.Around = 5
    2221    Checkboxes = True
    2322    Columns = <   
    2423      item
    2524        Caption = 'Name'
    26         Width = 300
     25        Width = 360
    2726      end   
    2827      item
    2928        Caption = 'Used count'
    30         Width = 456
     29        Width = 556
    3130      end>
    3231    MultiSelect = True
     
    4544  object ToolBar1: TToolBar
    4645    Left = 0
    47     Height = 26
    48     Top = 403
    49     Width = 784
     46    Height = 33
     47    Top = 482
     48    Width = 941
    5049    Align = alBottom
    5150    Images = Core.ImageList1
     
    5958    end
    6059    object ToolButton2: TToolButton
    61       Left = 30
     60      Left = 36
    6261      Top = 2
    6362      Action = AModify
    6463    end
    6564    object ToolButton3: TToolButton
    66       Left = 59
     65      Left = 71
    6766      Top = 2
    6867      Action = ARemove
     
    7170  object ActionList1: TActionList
    7271    Images = Core.ImageList1
    73     left = 380
    74     top = 196
     72    Left = 456
     73    Top = 235
    7574    object AAdd: TAction
    7675      Caption = 'Add'
     
    107106  object PopupMenuCategory: TPopupMenu
    108107    Images = Core.ImageList1
    109     left = 119
    110     top = 192
     108    Left = 143
     109    Top = 230
    111110    object MenuItem1: TMenuItem
    112111      Action = AAdd
     
    137136    Column = 0
    138137    Order = soNone
    139     left = 536
    140     top = 184
     138    Left = 643
     139    Top = 221
    141140  end
    142141end
  • trunk/Forms/FormCategories.pas

    r218 r219  
    1 unit UFormCategories;
    2 
    3 {$mode delphi}
     1unit FormCategories;
    42
    53interface
     
    75uses
    86  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls,
    9   ActnList, Menus, UAcronym, UListViewSort;
     7  ActnList, Menus, Acronym, ListViewSort, FormEx;
    108
    119type
     
    1311  { TFormCategories }
    1412
    15   TFormCategories = class(TForm)
     13  TFormCategories = class(TFormEx)
    1614    AAdd: TAction;
    1715    AEnable: TAction;
     
    4139    procedure ARemoveExecute(Sender: TObject);
    4240    procedure ASelectAllExecute(Sender: TObject);
    43     procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
    4441    procedure FormCreate(Sender: TObject);
    4542    procedure FormShow(Sender: TObject);
     
    5350    function ListViewSort1CompareItem(Item1, Item2: TObject): Integer;
    5451    procedure ListViewSort1Filter(ListViewSort: TListViewSort);
    55   private
    56     { private declarations }
    5752  public
    5853    Categories: TAcronymCategories;
     
    6156  end;
    6257
    63 var
    64   FormCategories: TFormCategories;
    6558
    6659implementation
     
    6962
    7063uses
    71   UCore;
     64  Core;
    7265
    7366resourcestring
     
    8275procedure TFormCategories.FormShow(Sender: TObject);
    8376begin
    84   Core.PersistentForm1.Load(Self);
    8577  UpdateList;
    86   Core.ScaleDPI1.ScaleControl(ToolBar1, Core.ScaleDPI1.DesignDPI);
     78  Core.Core.ScaleDPI1.ScaleControl(ToolBar1, Core.Core.ScaleDPI1.DesignDPI);
    8779end;
    8880
     
    9284  if Assigned(Item) and (Change = ctState) then begin
    9385    TAcronymCategory(Item.Data).Enabled := Item.Checked;
    94     Core.AcronymDb.Modified := True;
     86    Core.Core.AcronymDb.Modified := True;
    9587  end;
    9688end;
     
    10294  S := InputBox(SCategory, SCategoryQuery, '');
    10395  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;
    108100      UpdateList;
    109101    end else ShowMessage(Format(SCategoryAlreadyExists, [S]));
     
    118110  if ListViewCategories.Items[I].Selected then begin
    119111    TAcronymCategory(ListViewCategories.Items[I].Data).Enabled := False;
    120     Core.AcronymDb.Modified := True;
     112    Core.Core.AcronymDb.Modified := True;
    121113  end;
    122114  UpdateList;
     
    130122  if ListViewCategories.Items[I].Selected then begin
    131123    TAcronymCategory(ListViewCategories.Items[I].Data).Enabled := True;
    132     Core.AcronymDb.Modified := True;
     124    Core.Core.AcronymDb.Modified := True;
    133125  end;
    134126  UpdateList;
     
    142134    S := InputBox(SCategory, SCategoryQuery, ListViewCategories.Selected.Caption);
    143135    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;
    145137        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;
    148140        UpdateList;
    149141      end else ShowMessage(Format(SCategoryAlreadyExists, [S]));
     
    177169end;
    178170
    179 procedure TFormCategories.FormClose(Sender: TObject;
    180   var CloseAction: TCloseAction);
    181 begin
    182   Core.PersistentForm1.Save(Self);
    183 end;
    184 
    185171procedure TFormCategories.FormCreate(Sender: TObject);
    186172var
    187173  I: Integer;
    188174begin
    189   Core.Translator.TranslateComponentRecursive(Self);
    190   Core.ThemeManager.UseTheme(Self);
    191175  for I := 0 to ToolBar1.ButtonCount - 1 do
    192176    ToolBar1.Buttons[I].Hint := ToolBar1.Buttons[I].Caption;
     
    237221procedure TFormCategories.ListViewSort1Filter(ListViewSort: TListViewSort);
    238222begin
    239   Core.AcronymDb.Categories.AssignToList(ListViewSort1.List);
     223  Core.Core.AcronymDb.Categories.AssignToList(ListViewSort1.List);
    240224end;
    241225
     
    243227begin
    244228  ListViewSort1.Refresh;
    245   ListViewCategories.Items.Count := Core.AcronymDb.Categories.Count;
     229  ListViewCategories.Items.Count := Core.Core.AcronymDb.Categories.Count;
    246230  ListViewCategories.Refresh;
    247231  UpdateInterface;
  • trunk/Forms/FormCategorySelect.lfm

    r218 r219  
    11object FormCategorySelect: TFormCategorySelect
    22  Left = 500
    3   Height = 584
     3  Height = 701
    44  Top = 253
    5   Width = 791
     5  Width = 949
    66  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
    1210  Position = poScreenCenter
    13   LCLVersion = '2.0.2.0'
     11  LCLVersion = '3.6.0.0'
    1412  object ListBox1: TListBox
    15     Left = 16
    16     Height = 518
    17     Top = 8
    18     Width = 761
     13    Left = 19
     14    Height = 621
     15    Top = 10
     16    Width = 913
    1917    Anchors = [akTop, akLeft, akRight, akBottom]
    2018    ItemHeight = 0
    2119    MultiSelect = True
     20    ScrollWidth = 762
     21    TabOrder = 0
     22    TopIndex = -1
    2223    OnDblClick = ListBox1DblClick
    2324    OnKeyPress = ListBox1KeyPress
    24     ScrollWidth = 762
    25     TabOrder = 0
    2625  end
    2726  object ButtonOk: TButton
    28     Left = 701
    29     Height = 25
    30     Top = 541
    31     Width = 75
     27    Left = 841
     28    Height = 30
     29    Top = 649
     30    Width = 90
    3231    Anchors = [akRight, akBottom]
    3332    Caption = 'Select'
     
    3635  end
    3736  object ButtonCancel: TButton
    38     Left = 605
    39     Height = 25
    40     Top = 542
    41     Width = 75
     37    Left = 726
     38    Height = 30
     39    Top = 651
     40    Width = 90
    4241    Anchors = [akRight, akBottom]
    4342    Caption = 'Cancel'
  • trunk/Forms/FormCategorySelect.pas

    r218 r219  
    1 unit UFormCategorySelect;
    2 
    3 {$mode delphi}
     1unit FormCategorySelect;
    42
    53interface
     
    75uses
    86  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
    9   UAcronym;
     7  Acronym, FormEx;
    108
    119type
     
    1311  { TFormCategorySelect }
    1412
    15   TFormCategorySelect = class(TForm)
     13  TFormCategorySelect = class(TFormeX)
    1614    ButtonOk: TButton;
    1715    ButtonCancel: TButton;
    1816    ListBox1: TListBox;
    19     procedure FormCreate(Sender: TObject);
    20     procedure FormShow(Sender: TObject);
    2117    procedure ListBox1DblClick(Sender: TObject);
    2218    procedure ListBox1KeyPress(Sender: TObject; var Key: char);
    23   private
    24     { private declarations }
    2519  public
    2620    procedure Load(RemoveItems: TStrings);
    2721  end;
    28 
    29 var
    30   FormCategorySelect: TFormCategorySelect;
    3122
    3223resourcestring
     
    3526  SRemoveCategoryQuery = 'Do you really want to remove selected categories?';
    3627
     28
    3729implementation
    3830
     
    4032
    4133uses
    42   UCore;
     34  Core;
    4335
    4436{ TFormCategorySelect }
    45 
    46 procedure TFormCategorySelect.FormShow(Sender: TObject);
    47 begin
    48 end;
    49 
    50 procedure TFormCategorySelect.FormCreate(Sender: TObject);
    51 begin
    52   Core.Translator.TranslateComponentRecursive(Self);
    53   Core.ThemeManager.UseTheme(Self);
    54 end;
    5537
    5638procedure TFormCategorySelect.ListBox1DblClick(Sender: TObject);
     
    6951  I: Integer;
    7052begin
    71   with Core.AcronymDb do begin
     53  with Core.Core.AcronymDb do begin
    7254    ListBox1.Sorted := False;
    7355    while ListBox1.Items.Count < Categories.Count do
     
    7658      ListBox1.Items.Delete(ListBox1.Items.Count - 1);
    7759    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;
    7961      ListBox1.Items.Objects[I] := Categories[I];
    8062      ListBox1.Selected[I] := False;
  • trunk/Forms/FormCheck.lfm

    r218 r219  
    11object FormCheck: TFormCheck
    22  Left = 483
    3   Height = 635
     3  Height = 762
    44  Top = 257
    5   Width = 891
     5  Width = 1069
    66  Caption = 'Check document'
    7   ClientHeight = 635
    8   ClientWidth = 891
    9   DesignTimePPI = 120
    10   OnClose = FormClose
     7  ClientHeight = 762
     8  ClientWidth = 1069
     9  DesignTimePPI = 144
    1110  OnCreate = FormCreate
    1211  OnDestroy = FormDestroy
    1312  OnShow = FormShow
    14   LCLVersion = '2.0.2.0'
     13  LCLVersion = '3.6.0.0'
    1514  object Panel1: TPanel
    1615    Left = 0
    17     Height = 635
     16    Height = 762
    1817    Top = 0
    19     Width = 224
     18    Width = 269
    2019    Align = alLeft
    2120    BevelOuter = bvNone
    22     ClientHeight = 635
    23     ClientWidth = 224
     21    ClientHeight = 762
     22    ClientWidth = 269
    2423    TabOrder = 0
    2524    object ButtonCheck: TButton
    26       Left = 11
    27       Height = 31
    28       Top = 13
    29       Width = 94
     25      Left = 13
     26      Height = 37
     27      Top = 16
     28      Width = 113
    3029      Caption = 'Check'
     30      TabOrder = 0
    3131      OnClick = ButtonCheckClick
    32       TabOrder = 0
    3332    end
    3433    object GroupBox1: TGroupBox
    35       Left = 11
    36       Height = 217
    37       Top = 199
    38       Width = 206
     34      Left = 13
     35      Height = 260
     36      Top = 239
     37      Width = 248
    3938      Anchors = [akTop, akLeft, akRight]
    4039      Caption = 'Summary section'
    41       ClientHeight = 192
    42       ClientWidth = 202
     40      ClientHeight = 233
     41      ClientWidth = 246
    4342      TabOrder = 1
    4443      object ButtonAcronymsSummary: TButton
    45         Left = 6
    46         Height = 31
    47         Top = 8
    48         Width = 150
     44        Left = 7
     45        Height = 37
     46        Top = 10
     47        Width = 180
    4948        Caption = 'Acronyms'
     49        TabOrder = 0
    5050        OnClick = ButtonAcronymsSummaryClick
    51         TabOrder = 0
    5251      end
    5352      object LabelAcronymCountSummary: TLabel
    54         Left = 6
    55         Height = 20
    56         Top = 48
    57         Width = 103
     53        Left = 7
     54        Height = 26
     55        Top = 58
     56        Width = 134
    5857        Caption = 'Acronym count:'
    5958        ParentColor = False
    6059      end
    6160      object Label1: TLabel
    62         Left = 8
    63         Height = 20
    64         Top = 72
    65         Width = 75
     61        Left = 10
     62        Height = 26
     63        Top = 86
     64        Width = 98
    6665        Caption = 'Start string:'
    6766        ParentColor = False
    6867      end
    6968      object EditSummaryStart: TEdit
    70         Left = 8
    71         Height = 28
    72         Top = 96
    73         Width = 184
     69        Left = 10
     70        Height = 43
     71        Top = 115
     72        Width = 224
    7473        Anchors = [akTop, akLeft, akRight]
    7574        TabOrder = 1
    7675      end
    7776      object Label2: TLabel
    78         Left = 8
    79         Height = 20
    80         Top = 128
    81         Width = 69
     77        Left = 10
     78        Height = 26
     79        Top = 154
     80        Width = 91
    8281        Caption = 'End string:'
    8382        ParentColor = False
    8483      end
    8584      object EditSummaryEnd: TEdit
    86         Left = 8
    87         Height = 28
    88         Top = 152
    89         Width = 184
     85        Left = 10
     86        Height = 43
     87        Top = 182
     88        Width = 224
    9089        Anchors = [akTop, akLeft, akRight]
    9190        TabOrder = 2
     
    9392    end
    9493    object GroupBox2: TGroupBox
    95       Left = 11
    96       Height = 99
    97       Top = 96
    98       Width = 207
     94      Left = 13
     95      Height = 119
     96      Top = 115
     97      Width = 249
    9998      Anchors = [akTop, akLeft, akRight]
    10099      Caption = 'Content'
    101       ClientHeight = 74
    102       ClientWidth = 203
     100      ClientHeight = 92
     101      ClientWidth = 247
    103102      TabOrder = 2
    104103      object ButtonAcronymsContent: TButton
    105         Left = 8
    106         Height = 31
     104        Left = 10
     105        Height = 37
    107106        Top = 0
    108         Width = 150
     107        Width = 180
    109108        Caption = 'Acronyms'
     109        TabOrder = 0
    110110        OnClick = ButtonAcronymsContentClick
    111         TabOrder = 0
    112111      end
    113112      object LabelAcronymCountContent: TLabel
    114         Left = 8
    115         Height = 20
    116         Top = 40
    117         Width = 103
     113        Left = 10
     114        Height = 26
     115        Top = 48
     116        Width = 134
    118117        Caption = 'Acronym count:'
    119118        ParentColor = False
     
    121120    end
    122121    object ButtonLoadFromFile: TButton
    123       Left = 11
    124       Height = 31
    125       Top = 48
    126       Width = 134
     122      Left = 13
     123      Height = 37
     124      Top = 58
     125      Width = 161
    127126      Caption = 'Load from file'
     127      TabOrder = 3
    128128      OnClick = ButtonLoadFromFileClick
    129       TabOrder = 3
    130129    end
    131130    object CheckBoxCaseSensitive: TCheckBox
    132       Left = 11
    133       Height = 24
    134       Top = 424
    135       Width = 197
     131      Left = 13
     132      Height = 30
     133      Top = 509
     134      Width = 251
    136135      Caption = 'Case sensitive comparison'
    137136      TabOrder = 4
     
    139138  end
    140139  object Splitter1: TSplitter
    141     Left = 224
    142     Height = 635
     140    Left = 269
     141    Height = 762
    143142    Top = 0
    144     Width = 6
     143    Width = 7
    145144  end
    146145  object Panel2: TPanel
    147     Left = 230
    148     Height = 635
     146    Left = 276
     147    Height = 762
    149148    Top = 0
    150     Width = 661
     149    Width = 793
    151150    Align = alClient
    152151    BevelOuter = bvNone
    153     ClientHeight = 635
    154     ClientWidth = 661
     152    ClientHeight = 762
     153    ClientWidth = 793
    155154    TabOrder = 2
    156155    object PageControl1: TPageControl
    157       Left = 8
    158       Height = 619
    159       Top = 8
    160       Width = 645
     156      Left = 10
     157      Height = 742
     158      Top = 10
     159      Width = 773
    161160      ActivePage = TabSheetReport
    162161      Align = alClient
    163       BorderSpacing.Around = 8
     162      BorderSpacing.Around = 10
    164163      TabIndex = 1
    165164      TabOrder = 0
    166165      object TabSheetSource: TTabSheet
    167166        Caption = 'Source'
    168         ClientHeight = 586
    169         ClientWidth = 637
     167        ClientHeight = 702
     168        ClientWidth = 763
    170169        object MemoDocument: TMemo
    171           Left = 8
    172           Height = 570
    173           Top = 8
    174           Width = 620
     170          Left = 10
     171          Height = 682
     172          Top = 10
     173          Width = 742
    175174          Anchors = [akTop, akLeft, akRight, akBottom]
    176175          ScrollBars = ssAutoBoth
     
    181180      object TabSheetReport: TTabSheet
    182181        Caption = 'Report'
    183         ClientHeight = 586
    184         ClientWidth = 637
     182        ClientHeight = 702
     183        ClientWidth = 763
    185184        object ListViewReport: TListView
    186           Left = 7
    187           Height = 564
    188           Top = 13
    189           Width = 625
     185          Left = 8
     186          Height = 675
     187          Top = 16
     188          Width = 749
    190189          Anchors = [akTop, akLeft, akRight, akBottom]
    191190          Columns = <         
    192191            item
    193192              Caption = 'Position'
    194               Width = 80
     193              Width = 96
    195194            end         
    196195            item
    197196              Caption = 'Type'
    198               Width = 100
     197              Width = 120
    199198            end         
    200199            item
    201200              Caption = 'Message'
    202               Width = 800
     201              Width = 960
    203202            end>
    204203          OwnerData = True
     
    216215    DefaultExt = '.txt'
    217216    Filter = 'Text files (.txt)|*.txt|Any file|*.*'
    218     left = 544
    219     top = 288
     217    Left = 653
     218    Top = 346
    220219  end
    221220  object PopupMenuReport: TPopupMenu
    222     left = 376
    223     top = 202
     221    Left = 451
     222    Top = 242
    224223    object MenuItemGoTo: TMenuItem
    225224      Action = AGoToLocation
     
    231230  end
    232231  object ActionList1: TActionList
    233     left = 546
    234     top = 203
     232    Left = 655
     233    Top = 244
    235234    object ASaveToCsv: TAction
    236235      Caption = 'Save to CSV...'
     
    243242  end
    244243  object SaveDialog1: TSaveDialog
    245     left = 378
    246     top = 288
     244    Left = 454
     245    Top = 346
    247246  end
    248247end
  • trunk/Forms/FormCheck.pas

    r218 r219  
    1 unit UFormCheck;
    2 
    3 {$mode delphi}
     1unit FormCheck;
    42
    53interface
     
    75uses
    86  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;
    119
    1210type
     
    2119  { TReportItems }
    2220
    23   TReportItems = class(TFPGObjectList<TReportItem>)
     21  TReportItems = class(TObjectList<TReportItem>)
    2422    function AddNew(Message: string; Position: TPoint;
    2523      Kind: TReportType = rtNone): TReportItem;
     
    6563    procedure ButtonCheckClick(Sender: TObject);
    6664    procedure ButtonLoadFromFileClick(Sender: TObject);
    67     procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
    6865    procedure FormCreate(Sender: TObject);
    6966    procedure FormDestroy(Sender: TObject);
     
    9895  end;
    9996
    100 var
    101   FormCheck: TFormCheck;
    102 
    10397const
    10498  ReportTypeString: array[TReportType] of string = ('', 'Note', 'Warning', 'Error');
     
    110104
    111105uses
    112   UFormAcronyms, UCore;
     106  FormAcronyms, Core;
    113107
    114108resourcestring
     
    198192end;
    199193
    200 procedure TFormCheck.FormClose(Sender: TObject; var CloseAction: TCloseAction);
    201 begin
    202   Core.PersistentForm1.Save(Self);
    203 end;
    204 
    205194procedure TFormCheck.FormCreate(Sender: TObject);
    206195begin
    207196  AcronymDbSummary := TAcronymDb.Create;
    208197  AcronymDbContent := TAcronymDb.Create;
    209   Core.Translator.TranslateComponentRecursive(Self);
    210   Core.ThemeManager.UseTheme(Self);
    211198  ReportItems := TReportItems.Create;
    212199end;
     
    214201procedure TFormCheck.FormDestroy(Sender: TObject);
    215202begin
    216   ReportItems.Free;
    217   AcronymDbSummary.Free;
    218   AcronymDbContent.Free;
     203  FreeAndNil(ReportItems);
     204  FreeAndNil(AcronymDbSummary);
     205  FreeAndNil(AcronymDbContent);
    219206end;
    220207
     
    222209begin
    223210  PageControl1.TabIndex := 0;
    224   Core.PersistentForm1.Load(Self);
    225211  if FileExists(LastDocumentFileName) then
    226212    MemoDocument.Lines.LoadFromFile(LastDocumentFileName);
     
    724710  with TRegistryEx.Create do
    725711  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);
    728714    EditSummaryStart.Text := ReadStringWithDefault('SummaryStart', 'ACRONYMS AND ABBREVIATIONS');
    729715    EditSummaryEnd.Text := ReadStringWithDefault('SummaryEnd', 'Appendix');
     
    739725  with TRegistryEx.Create do
    740726  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);
    743729    WriteString('SummaryStart', EditSummaryStart.Text);
    744730    WriteString('SummaryEnd', EditSummaryEnd.Text);
  • trunk/Forms/FormExport.lfm

    r218 r219  
    11object FormExport: TFormExport
    22  Left = 281
    3   Height = 654
     3  Height = 785
    44  Top = 221
    5   Width = 850
     5  Width = 1020
    66  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
    1310  Position = poScreenCenter
    14   LCLVersion = '2.0.2.0'
     11  LCLVersion = '3.6.0.0'
    1512  object ButtonProcess: TButton
    16     Left = 18
    17     Height = 33
    18     Top = 9
    19     Width = 139
     13    Left = 22
     14    Height = 40
     15    Top = 11
     16    Width = 167
    2017    Caption = 'Process'
     18    TabOrder = 0
    2119    OnClick = ButtonProcessClick
    22     TabOrder = 0
    2320  end
    2421  object ComboBoxDataFormat: TComboBox
    25     Left = 341
    26     Height = 28
    27     Top = 5
    28     Width = 182
    29     ItemHeight = 20
     22    Left = 409
     23    Height = 38
     24    Top = 6
     25    Width = 218
     26    ItemHeight = 0
    3027    ItemIndex = 0
    3128    Items.Strings = (
     
    3936  end
    4037  object ButtonSaveToFile: TButton
    41     Left = 653
    42     Height = 33
    43     Top = 9
    44     Width = 181
     38    Left = 784
     39    Height = 40
     40    Top = 11
     41    Width = 217
    4542    Anchors = [akTop, akRight]
    4643    Caption = 'Save to file'
     44    TabOrder = 2
    4745    OnClick = ButtonSaveToFileClick
    48     TabOrder = 2
    4946  end
    5047  object Memo1: TMemo
    51     Left = 8
    52     Height = 597
    53     Top = 51
    54     Width = 830
     48    Left = 10
     49    Height = 717
     50    Top = 61
     51    Width = 996
    5552    Anchors = [akTop, akLeft, akRight, akBottom]
    5653    ScrollBars = ssAutoBoth
     
    5855  end
    5956  object SaveDialog1: TSaveDialog
    60     left = 395
    61     top = 124
     57    Left = 474
     58    Top = 149
    6259  end
    6360end
  • trunk/Forms/FormExport.pas

    r218 r219  
    1 unit UFormExport;
    2 
    3 {$mode delphi}
     1unit FormExport;
    42
    53interface
     
    75uses
    86  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
    9   UJobProgressView;
     7  JobProgressView;
    108
    119type
     
    2119    procedure ButtonProcessClick(Sender: TObject);
    2220    procedure ButtonSaveToFileClick(Sender: TObject);
    23     procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
    24     procedure FormCreate(Sender: TObject);
    25     procedure FormShow(Sender: TObject);
    2621  private
    2722    ItemCount: Integer;
     
    3025    procedure JobExportMediaWiki(Job: TJob);
    3126    procedure JobExportMediaWikiTable(Job: TJob);
    32   public
    33     { public declarations }
    3427  end;
    3528
    36 var
    37   FormExport: TFormExport;
    3829
    3930implementation
     
    4233
    4334uses
    44   UCore, UAcronym;
     35  Core, Acronym;
    4536
    4637resourcestring
     
    6051end;
    6152
    62 procedure TFormExport.FormClose(Sender: TObject; var CloseAction: TCloseAction);
    63 begin
    64   Core.PersistentForm1.Save(Self);
    65 end;
    66 
    67 procedure TFormExport.FormCreate(Sender: TObject);
    68 begin
    69   Core.Translator.TranslateComponentRecursive(Self);
    70   Core.ThemeManager.UseTheme(Self);
    71 end;
    72 
    73 procedure TFormExport.FormShow(Sender: TObject);
    74 begin
    75   Core.PersistentForm1.Load(Self);
    76 end;
    77 
    7853procedure TFormExport.JobExportCSV(Job: TJob);
    7954var
     
    8156  J: Integer;
    8257begin
    83   Job.Progress.Max := Core.AcronymDb.Acronyms.Count;
     58  Job.Progress.Max := Core.Core.AcronymDb.Acronyms.Count;
    8459  ItemCount := 0;
    8560  Content := '';
    86   for I := 0 to Core.AcronymDb.Acronyms.Count - 1 do
    87   with TAcronym(Core.AcronymDb.Acronyms[I]) do begin
     61  for I := 0 to Core.Core.AcronymDb.Acronyms.Count - 1 do
     62  with Core.Core.AcronymDb.Acronyms[I] do begin
    8863    for J := 0 to Meanings.Count - 1 do
    89     with TAcronymMeaning(Meanings[J]) do begin
     64    with Meanings[J] do begin
    9065      Content := Content + '"' + Acronym.Name + '","' + Name + '","' + Description + '","' + Categories.GetString + '"' + LineEnding;
    9166      Inc(ItemCount);
     
    10176  J: Integer;
    10277begin
    103   Job.Progress.Max := Core.AcronymDb.Acronyms.Count;
     78  Job.Progress.Max := Core.Core.AcronymDb.Acronyms.Count;
    10479  ItemCount := 0;
    10580  Content := '';
    106   for I := 0 to Core.AcronymDb.Acronyms.Count - 1 do
    107   with TAcronym(Core.AcronymDb.Acronyms[I]) do begin
     81  for I := 0 to Core.Core.AcronymDb.Acronyms.Count - 1 do
     82  with Core.Core.AcronymDb.Acronyms[I] do begin
    10883    Content := Content + '; ' + Name + LineEnding;
    10984    for J := 0 to Meanings.Count - 1 do
    110     with TAcronymMeaning(Meanings[J]) do begin
     85    with Meanings[J] do begin
    11186      Content := Content + ': ' + Name + LineEnding;
    11287      Inc(ItemCount);
     
    12297  J: Integer;
    12398begin
    124   Job.Progress.Max := Core.AcronymDb.Acronyms.Count;
     99  Job.Progress.Max := Core.Core.AcronymDb.Acronyms.Count;
    125100  ItemCount := 0;
    126101  Content := '{| class="wikitable sortable"' + LineEnding +
    127102    '! Name !! Meaning !! Description !! Categories' + LineEnding;
    128   for I := 0 to Core.AcronymDb.Acronyms.Count - 1 do
    129   with TAcronym(Core.AcronymDb.Acronyms[I]) do begin
     103  for I := 0 to Core.Core.AcronymDb.Acronyms.Count - 1 do
     104  with Core.Core.AcronymDb.Acronyms[I] do begin
    130105    for J := 0 to Meanings.Count - 1 do
    131     with TAcronymMeaning(Meanings[J]) do begin
     106    with Meanings[J] do begin
    132107      Content := Content + '|-' + LineEnding +
    133108        '| ' + Acronym.Name + LineEnding + '| ' + Name + LineEnding +
     
    144119begin
    145120  if ComboBoxDataFormat.ItemIndex = 0 then
    146     Core.JobProgressView1.AddJob(SExporting, JobExportCSV);
     121    Core.Core.JobProgressView1.AddJob(SExporting, JobExportCSV);
    147122  if ComboBoxDataFormat.ItemIndex = 1 then
    148     Core.JobProgressView1.AddJob(SExporting, JobExportMediaWiki);
     123    Core.Core.JobProgressView1.AddJob(SExporting, JobExportMediaWiki);
    149124  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;
    152127  Memo1.Lines.Text := Content;
    153128  ShowMessage(Format(SExportedAcronyms, [ItemCount]));
  • trunk/Forms/FormImport.lfm

    r218 r219  
    88  ClientWidth = 782
    99  DesignTimePPI = 144
    10   OnClose = FormClose
    11   OnCreate = FormCreate
    12   OnShow = FormShow
    1310  Position = poScreenCenter
    14   LCLVersion = '2.0.12.0'
     11  LCLVersion = '3.6.0.0'
    1512  object ButtonProcess: TButton
    1613    Left = 19
     
    1916    Width = 128
    2017    Caption = 'Process'
    21     OnClick = ButtonProcessClick
    2218    ParentFont = False
    2319    TabOrder = 0
     20    OnClick = ButtonProcessClick
    2421  end
    2522  object Memo1: TMemo
     
    5148  object Label1: TLabel
    5249    Left = 184
    53     Height = 24
     50    Height = 26
    5451    Top = 11
    5552    Width = 106
     
    6562    Anchors = [akTop, akRight]
    6663    Caption = 'Load from file'
    67     OnClick = ButtonLoadFromFileClick
    6864    ParentFont = False
    6965    TabOrder = 2
     66    OnClick = ButtonLoadFromFileClick
    7067  end
    7168  object OpenDialog1: TOpenDialog
  • trunk/Forms/FormImport.pas

    r218 r219  
    1 unit UFormImport;
    2 
    3 {$mode delphi}{$H+}
     1unit FormImport;
    42
    53interface
     
    75uses
    86  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
    9   UAcronym;
     7  Acronym, FormEx;
    108
    119type
     
    1311  { TFormImport }
    1412
    15   TFormImport = class(TForm)
     13  TFormImport = class(TFormEx)
    1614    ButtonLoadFromFile: TButton;
    1715    ButtonProcess: TButton;
     
    2220    procedure ButtonProcessClick(Sender: TObject);
    2321    procedure ButtonLoadFromFileClick(Sender: TObject);
    24     procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
    25     procedure FormCreate(Sender: TObject);
    26     procedure FormShow(Sender: TObject);
    2722  private
    2823    procedure ImportMediaWiki;
    2924    procedure ImportCSV;
    30   public
    31     { public declarations }
    3225  end;
    3326
    34 var
    35   FormImport: TFormImport;
    3627
    3728implementation
     
    4031
    4132uses
    42   UCore;
     33  Core;
    4334
    4435resourcestring
    4536  SImportedNewAcronyms = 'Imported %d new acronyms.';
    46 
    4737
    4838{ TFormImport }
     
    6050  if OpenDialog1.Execute then
    6151    Memo1.Lines.LoadFromFile(OpenDialog1.FileName);
    62 end;
    63 
    64 procedure TFormImport.FormClose(Sender: TObject; var CloseAction: TCloseAction);
    65 begin
    66   Core.PersistentForm1.Save(Self);
    67 end;
    68 
    69 procedure TFormImport.FormCreate(Sender: TObject);
    70 begin
    71   Core.Translator.TranslateComponentRecursive(Self);
    72   Core.ThemeManager.UseTheme(Self);
    73 end;
    74 
    75 procedure TFormImport.FormShow(Sender: TObject);
    76 begin
    77   Core.PersistentForm1.Load(Self);
    7852end;
    7953
     
    10175      AcronymMeaning := Trim(Copy(Line, 2, Length(Line)));
    10276      if (AcronymName <> '') and (AcronymMeaning <> '') then begin
    103         Acronym := Core.AcronymDb.Acronyms.SearchByName(AcronymName);
     77        Acronym := Core.Core.AcronymDb.Acronyms.SearchByName(AcronymName);
    10478        if not Assigned(Acronym) then begin
    10579          Acronym := TAcronym.Create;
    10680          Acronym.Name := AcronymName;
    107           Core.AcronymDb.Acronyms.Add(Acronym);
     81          Core.Core.AcronymDb.Acronyms.Add(Acronym);
    10882        end;
    10983        Meaning := Acronym.Meanings.SearchByName(AcronymMeaning);
     
    11892    end;
    11993  end;
    120   if AddedCount > 0 then Core.AcronymDb.Modified := True;
     94  if AddedCount > 0 then Core.Core.AcronymDb.Modified := True;
    12195  ShowMessage(Format(SImportedNewAcronyms, [AddedCount]));
    12296end;
     
    147121      else AcronymDescription := '';
    148122    if (AcronymName <> '') and (AcronymDescription <> '') then begin
    149       Acronym := Core.AcronymDb.Acronyms.SearchByName(AcronymName);
     123      Acronym := Core.Core.AcronymDb.Acronyms.SearchByName(AcronymName);
    150124      if not Assigned(Acronym) then begin
    151125        Acronym := TAcronym.Create;
    152126        Acronym.Name := AcronymName;
    153         Core.AcronymDb.Acronyms.Add(Acronym);
     127        Core.Core.AcronymDb.Acronyms.Add(Acronym);
    154128      end;
    155129      Meaning := Acronym.Meanings.SearchByName(AcronymDescription);
     
    165139  end;
    166140  Columns.Free;
    167   if AddedCount > 0 then Core.AcronymDb.Modified := True;
     141  if AddedCount > 0 then Core.Core.AcronymDb.Modified := True;
    168142  ShowMessage(Format(SImportedNewAcronyms, [AddedCount]));
    169143end;
  • trunk/Forms/FormImportFormat.lfm

    r218 r219  
    11object FormImportFormat: TFormImportFormat
    22  Left = 462
    3   Height = 439
     3  Height = 527
    44  Top = 322
    5   Width = 629
     5  Width = 755
    66  Caption = 'Import format'
    7   ClientHeight = 439
    8   ClientWidth = 629
    9   DesignTimePPI = 120
    10   OnClose = FormClose
     7  ClientHeight = 527
     8  ClientWidth = 755
     9  DesignTimePPI = 144
    1110  OnCreate = FormCreate
    1211  OnShow = FormShow
    1312  Position = poScreenCenter
    14   LCLVersion = '2.0.2.0'
     13  LCLVersion = '3.6.0.0'
    1514  object ButtonOk: TButton
    16     Left = 525
    17     Height = 25
    18     Top = 390
    19     Width = 75
     15    Left = 630
     16    Height = 30
     17    Top = 468
     18    Width = 90
    2019    Anchors = [akRight, akBottom]
    2120    Caption = 'Ok'
     
    2423  end
    2524  object ButtonCancel: TButton
    26     Left = 429
    27     Height = 25
    28     Top = 390
    29     Width = 75
     25    Left = 515
     26    Height = 30
     27    Top = 468
     28    Width = 90
    3029    Anchors = [akRight, akBottom]
    3130    Caption = 'Cancel'
     
    3433  end
    3534  object Label1: TLabel
    36     Left = 20
    37     Height = 20
    38     Top = 53
    39     Width = 43
     35    Left = 24
     36    Height = 26
     37    Top = 64
     38    Width = 56
    4039    Caption = 'Name:'
    4140    ParentColor = False
    4241  end
    4342  object EditName: TEdit
    44     Left = 179
    45     Height = 28
    46     Top = 48
    47     Width = 426
     43    Left = 215
     44    Height = 43
     45    Top = 58
     46    Width = 511
    4847    Anchors = [akTop, akLeft, akRight]
    4948    TabOrder = 1
    5049  end
    5150  object Label8: TLabel
    52     Left = 20
    53     Height = 20
    54     Top = 90
    55     Width = 72
     51    Left = 24
     52    Height = 26
     53    Top = 108
     54    Width = 95
    5655    Caption = 'Block start:'
    5756    ParentColor = False
    5857  end
    5958  object EditBlockStart: TEdit
    60     Left = 179
    61     Height = 28
    62     Top = 85
    63     Width = 426
     59    Left = 215
     60    Height = 43
     61    Top = 102
     62    Width = 511
    6463    Anchors = [akTop, akLeft, akRight]
    6564    TabOrder = 2
    6665  end
    6766  object Label9: TLabel
    68     Left = 20
    69     Height = 20
    70     Top = 130
    71     Width = 68
     67    Left = 24
     68    Height = 26
     69    Top = 156
     70    Width = 89
    7271    Caption = 'Block end:'
    7372    ParentColor = False
    7473  end
    7574  object EditBlockEnd: TEdit
    76     Left = 179
    77     Height = 28
    78     Top = 125
    79     Width = 426
     75    Left = 215
     76    Height = 43
     77    Top = 150
     78    Width = 511
    8079    Anchors = [akTop, akLeft, akRight]
    8180    TabOrder = 3
    8281  end
    8382  object ListViewItemRules: TListView
    84     Left = 20
    85     Height = 198
    86     Top = 181
    87     Width = 585
     83    Left = 24
     84    Height = 238
     85    Top = 217
     86    Width = 702
    8887    Anchors = [akTop, akLeft, akRight, akBottom]
    8988    Columns = <   
    9089      item
    9190        Caption = 'Start string'
    92         Width = 100
     91        Width = 120
    9392      end   
    9493      item
    9594        Caption = 'End string'
    96         Width = 100
     95        Width = 120
    9796      end   
    9897      item
    9998        Caption = 'Action'
    100         Width = 100
     99        Width = 120
    101100      end   
    102101      item
    103102        Caption = 'Variable'
    104         Width = 100
     103        Width = 120
    105104      end   
    106105      item
    107106        Caption = 'Repetition'
    108         Width = 165
     107        Width = 207
    109108      end>
    110109    OwnerData = True
     
    118117  end
    119118  object Label2: TLabel
    120     Left = 20
    121     Height = 20
    122     Top = 157
    123     Width = 68
     119    Left = 24
     120    Height = 26
     121    Top = 188
     122    Width = 91
    124123    Caption = 'Item rules:'
    125124    ParentColor = False
    126125  end
    127126  object Label3: TLabel
    128     Left = 20
    129     Height = 20
    130     Top = 13
    131     Width = 35
     127    Left = 24
     128    Height = 26
     129    Top = 16
     130    Width = 45
    132131    Caption = 'Type:'
    133132    ParentColor = False
    134133  end
    135134  object ComboBoxType: TComboBox
    136     Left = 179
    137     Height = 28
    138     Top = 13
    139     Width = 197
    140     ItemHeight = 20
     135    Left = 215
     136    Height = 38
     137    Top = 16
     138    Width = 236
     139    ItemHeight = 0
    141140    Items.Strings = (
    142141      'Text parse HTTP'
     
    148147  end
    149148  object PopupMenu1: TPopupMenu
    150     left = 181
    151     top = 277
     149    Left = 217
     150    Top = 332
    152151    object MenuItem1: TMenuItem
    153152      Action = AAdd
     
    275274  end
    276275  object ActionList1: TActionList
    277     left = 383
    278     top = 282
     276    Left = 460
     277    Top = 338
    279278    object AAdd: TAction
    280279      Caption = 'Add'
  • trunk/Forms/FormImportFormat.pas

    r218 r219  
    1 unit UFormImportFormat;
    2 
    3 {$mode delphi}
     1unit FormImportFormat;
    42
    53interface
     
    75uses
    86  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
    9   ComCtrls, Menus, ActnList, UAcronym;
     7  ComCtrls, Menus, ActnList, Acronym;
    108
    119type
     
    4341    procedure AMoveUpExecute(Sender: TObject);
    4442    procedure ARemoveExecute(Sender: TObject);
    45     procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
    4643    procedure FormCreate(Sender: TObject);
    4744    procedure FormShow(Sender: TObject);
    4845    procedure ListViewItemRulesData(Sender: TObject; Item: TListItem);
    49   private
    50     { private declarations }
    5146  public
    5247    ImportFormat: TImportFormat;
     
    6459
    6560uses
    66   UCore, UFormImportPattern;
     61  Core, FormImportPattern;
    6762
    6863{$R *.lfm}
     
    8075var
    8176  NewImportPattern: TImportPattern;
     77  FormImportPattern: TFormImportPattern;
    8278begin
    8379  FormImportPattern := TFormImportPattern.Create(Self);
     
    10096var
    10197  NewImportPattern: TImportPattern;
     98  FormImportPattern: TFormImportPattern;
    10299begin
    103100  FormImportPattern := TFormImportPattern.Create(Self);
     
    152149end;
    153150
    154 procedure TFormImportFormat.FormClose(Sender: TObject;
    155   var CloseAction: TCloseAction);
    156 begin
    157   Core.PersistentForm1.Save(Self);
    158 end;
    159 
    160151procedure TFormImportFormat.FormCreate(Sender: TObject);
    161152begin
    162   Core.Translator.TranslateComponentRecursive(Self);
    163   Core.ThemeManager.UseTheme(Self);
    164153  YesNoString[False] := SNo;
    165154  YesNoString[True] := SYes;
     
    168157procedure TFormImportFormat.FormShow(Sender: TObject);
    169158begin
    170   Core.PersistentForm1.Load(Self);
    171159  ReloadList;
    172160end;
  • trunk/Forms/FormImportFormats.lfm

    r218 r219  
    11object FormImportFormats: TFormImportFormats
    22  Left = 473
    3   Height = 518
     3  Height = 622
    44  Top = 327
    5   Width = 739
     5  Width = 887
    66  Caption = 'Import formats'
    7   ClientHeight = 518
    8   ClientWidth = 739
    9   DesignTimePPI = 120
    10   OnClose = FormClose
     7  ClientHeight = 622
     8  ClientWidth = 887
     9  DesignTimePPI = 144
    1110  OnCreate = FormCreate
    1211  OnShow = FormShow
    1312  Position = poScreenCenter
    14   LCLVersion = '2.0.2.0'
     13  LCLVersion = '3.6.0.0'
    1514  object ListView1: TListView
    16     Left = 5
    17     Height = 476
    18     Top = 5
    19     Width = 729
     15    Left = 6
     16    Height = 577
     17    Top = 6
     18    Width = 875
    2019    Align = alClient
    21     BorderSpacing.Around = 5
     20    BorderSpacing.Around = 6
    2221    Columns = <   
    2322      item
    2423        Caption = 'Name'
    25         Width = 704
     24        Width = 860
    2625      end>
    2726    MultiSelect = True
     
    4039  object ToolBar1: TToolBar
    4140    Left = 0
    42     Top = 486
    43     Width = 739
     41    Height = 33
     42    Top = 589
     43    Width = 887
    4444    Align = alBottom
    45     Images = Core.ImageList1
    4645    ParentFont = False
    4746    ParentShowHint = False
     
    5453    end
    5554    object ToolButton2: TToolButton
    56       Left = 30
     55      Left = 36
    5756      Top = 2
    5857      Action = AModify
    5958    end
    6059    object ToolButton3: TToolButton
    61       Left = 59
     60      Left = 71
    6261      Top = 2
    6362      Action = ARemove
     
    6564  end
    6665  object ActionList1: TActionList
    67     Images = Core.ImageList1
    68     left = 510
    69     top = 280
     66    Left = 612
     67    Top = 336
    7068    object AAdd: TAction
    7169      Caption = 'Add'
     
    8886  end
    8987  object PopupMenuImportSource: TPopupMenu
    90     Images = Core.ImageList1
    91     left = 184
    92     top = 275
     88    Left = 221
     89    Top = 330
    9390    object MenuItem1: TMenuItem
    9491      Action = AAdd
  • trunk/Forms/FormImportFormats.pas

    r218 r219  
    1 unit UFormImportFormats;
    2 
    3 {$mode delphi}
     1unit FormImportFormats;
    42
    53interface
     
    75uses
    86  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls,
    9   ActnList, Menus, UAcronym;
     7  ActnList, Menus, Acronym, FormEx;
    108
    119type
     
    1311  { TFormImportFormats }
    1412
    15   TFormImportFormats = class(TForm)
     13  TFormImportFormats = class(TFormEx)
    1614    AAdd: TAction;
    1715    ActionList1: TActionList;
     
    3028    procedure AModifyExecute(Sender: TObject);
    3129    procedure ARemoveExecute(Sender: TObject);
    32     procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
    3330    procedure FormCreate(Sender: TObject);
    3431    procedure FormShow(Sender: TObject);
     
    3835    procedure ListView1SelectItem(Sender: TObject; Item: TListItem;
    3936      Selected: Boolean);
    40   private
    41     { private declarations }
    4237  public
    4338    ImportFormats: TImportFormats;
     
    4641  end;
    4742
    48 var
    49   FormImportFormats: TFormImportFormats;
    5043
    5144implementation
     
    5447
    5548uses
    56   UCore, UFormImportFormat;
     49  Core, FormImportFormat;
    5750
    5851resourcestring
     
    10497procedure TFormImportFormats.FormShow(Sender: TObject);
    10598begin
    106   Core.PersistentForm1.Load(Self);
    10799  UpdateList;
    108   Core.ScaleDPI1.ScaleControl(ToolBar1, Core.ScaleDPI1.DesignDPI);
     100  Core.Core.ScaleDPI1.ScaleControl(ToolBar1, Core.Core.ScaleDPI1.DesignDPI);
    109101end;
    110102
     
    112104var
    113105  NewImportFormat: TImportFormat;
     106  FormImportFormat: TFormImportFormat;
    114107begin
    115108  NewImportFormat := TImportFormat.Create;
     
    123116        ImportFormats.Add(NewImportFormat);
    124117        NewImportFormat := nil;
    125         Core.AcronymDb.Modified := True;
     118        Core.Core.AcronymDb.Modified := True;
    126119        UpdateList;
    127120      end else ShowMessage(Format(SImportFormatAlreadyExists, [NewImportFormat.Name]));
     
    136129var
    137130  NewImportFormat: TImportFormat;
     131  FormImportFormat: TFormImportFormat;
    138132begin
    139133  if Assigned(ListView1.Selected) then begin
     
    148142          if not Assigned(ImportFormats.SearchByName(NewImportFormat.Name)) then begin;
    149143            TImportFormat(ListView1.Selected.Data).Assign(NewImportFormat);
    150             Core.AcronymDb.Modified := True;
     144            Core.Core.AcronymDb.Modified := True;
    151145            UpdateList;
    152146          end else ShowMessage(Format(SImportFormatAlreadyExists, [NewImportFormat.Name]));
    153147        end else begin
    154148          TImportFormat(ListView1.Selected.Data).Assign(NewImportFormat);
    155           Core.AcronymDb.Modified := True;
     149          Core.Core.AcronymDb.Modified := True;
    156150          UpdateList;
    157151        end;
     
    179173end;
    180174
    181 procedure TFormImportFormats.FormClose(Sender: TObject;
    182   var CloseAction: TCloseAction);
    183 begin
    184   Core.PersistentForm1.Save(Self);
    185 end;
    186 
    187175procedure TFormImportFormats.FormCreate(Sender: TObject);
    188176var
    189177  I: Integer;
    190178begin
    191   Core.Translator.TranslateComponentRecursive(Self);
    192   Core.ThemeManager.UseTheme(Self);
    193179  for I := 0 to ToolBar1.ButtonCount - 1 do
    194180    ToolBar1.Buttons[I].Hint := ToolBar1.Buttons[I].Caption;
  • trunk/Forms/FormImportPattern.lfm

    r218 r219  
    11object FormImportPattern: TFormImportPattern
    22  Left = 459
    3   Height = 431
     3  Height = 517
    44  Top = 235
    5   Width = 662
     5  Width = 794
    66  Caption = 'Import pattern'
    7   ClientHeight = 431
    8   ClientWidth = 662
    9   DesignTimePPI = 120
     7  ClientHeight = 517
     8  ClientWidth = 794
     9  DesignTimePPI = 144
    1010  OnCreate = FormCreate
    1111  OnShow = FormShow
    1212  Position = poScreenCenter
    13   LCLVersion = '2.0.2.0'
     13  LCLVersion = '3.6.0.0'
    1414  object Label8: TLabel
    15     Left = 24
    16     Height = 20
    17     Top = 13
    18     Width = 75
     15    Left = 29
     16    Height = 26
     17    Top = 16
     18    Width = 98
    1919    Caption = 'Start string:'
    2020    ParentColor = False
    2121  end
    2222  object Label9: TLabel
    23     Left = 24
    24     Height = 20
    25     Top = 53
    26     Width = 69
     23    Left = 29
     24    Height = 26
     25    Top = 64
     26    Width = 91
    2727    Caption = 'End string:'
    2828    ParentColor = False
    2929  end
    3030  object EditBlockEnd: TEdit
    31     Left = 183
    32     Height = 28
    33     Top = 48
    34     Width = 461
     31    Left = 220
     32    Height = 43
     33    Top = 58
     34    Width = 552
    3535    Anchors = [akTop, akLeft, akRight]
    3636    TabOrder = 1
    3737  end
    3838  object EditBlockStart: TEdit
    39     Left = 183
    40     Height = 28
    41     Top = 8
    42     Width = 461
     39    Left = 220
     40    Height = 43
     41    Top = 10
     42    Width = 552
    4343    Anchors = [akTop, akLeft, akRight]
    4444    TabOrder = 0
    4545  end
    4646  object ButtonCancel: TButton
    47     Left = 464
    48     Height = 25
    49     Top = 384
    50     Width = 75
     47    Left = 556
     48    Height = 30
     49    Top = 461
     50    Width = 90
    5151    Anchors = [akRight, akBottom]
    5252    Caption = 'Cancel'
     
    5555  end
    5656  object ButtonOk: TButton
    57     Left = 560
    58     Height = 25
    59     Top = 384
    60     Width = 75
     57    Left = 672
     58    Height = 30
     59    Top = 461
     60    Width = 90
    6161    Anchors = [akRight, akBottom]
    6262    Caption = 'Ok'
     
    6565  end
    6666  object Label10: TLabel
    67     Left = 24
    68     Height = 20
    69     Top = 88
    70     Width = 46
     67    Left = 29
     68    Height = 26
     69    Top = 106
     70    Width = 59
    7171    Caption = 'Action:'
    7272    ParentColor = False
    7373  end
    7474  object Label11: TLabel
    75     Left = 24
    76     Height = 20
    77     Top = 120
    78     Width = 58
     75    Left = 29
     76    Height = 26
     77    Top = 144
     78    Width = 73
    7979    Caption = 'Variable:'
    8080    ParentColor = False
    8181  end
    8282  object ComboBoxAction: TComboBox
    83     Left = 183
    84     Height = 28
    85     Top = 87
    86     Width = 461
     83    Left = 220
     84    Height = 42
     85    Top = 104
     86    Width = 552
    8787    Anchors = [akTop, akLeft, akRight]
    88     ItemHeight = 20
     88    ItemHeight = 0
    8989    Style = csDropDownList
    9090    TabOrder = 2
    9191  end
    9292  object ComboBoxVariable: TComboBox
    93     Left = 183
    94     Height = 28
    95     Top = 120
    96     Width = 461
     93    Left = 220
     94    Height = 38
     95    Top = 144
     96    Width = 552
    9797    Anchors = [akTop, akLeft, akRight]
    98     ItemHeight = 20
     98    ItemHeight = 0
    9999    Items.Strings = (
    100100      ''
     
    104104  end
    105105  object CheckBoxRepetition: TCheckBox
    106     Left = 24
    107     Height = 24
    108     Top = 160
    109     Width = 93
     106    Left = 29
     107    Height = 30
     108    Top = 192
     109    Width = 112
    110110    Caption = 'Repetition'
    111111    TabOrder = 4
  • trunk/Forms/FormImportPattern.pas

    r218 r219  
    1 unit UFormImportPattern;
    2 
    3 {$mode delphi}
     1unit FormImportPattern;
    42
    53interface
     
    75uses
    86  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
    9   UAcronym;
     7  Acronym;
    108
    119type
     
    3432  end;
    3533
    36 var
    37   FormImportPattern: TFormImportPattern;
    3834
    3935implementation
     
    4238
    4339uses
    44   UCore;
     40  Core;
    4541
    4642{ TFormImportPattern }
     
    5349procedure TFormImportPattern.FormCreate(Sender: TObject);
    5450begin
    55   Core.Translator.TranslateComponentRecursive(Self);
    56   Core.ThemeManager.UseTheme(Self);
    5751  InitControls;
    5852end;
  • trunk/Forms/FormImportSource.lfm

    r218 r219  
    11object FormImportSource: TFormImportSource
    22  Left = 493
    3   Height = 459
     3  Height = 551
    44  Top = 315
    5   Width = 620
     5  Width = 744
    66  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
    1210  OnShow = FormShow
    1311  Position = poScreenCenter
    14   LCLVersion = '2.0.2.0'
     12  LCLVersion = '3.6.0.0'
    1513  object EditName: TEdit
    16     Left = 135
    17     Height = 28
    18     Top = 10
    19     Width = 471
     14    Left = 162
     15    Height = 43
     16    Top = 12
     17    Width = 565
    2018    Anchors = [akTop, akLeft, akRight]
    2119    TabOrder = 0
    2220  end
    2321  object Label1: TLabel
    24     Left = 10
    25     Height = 20
    26     Top = 9
    27     Width = 43
     22    Left = 12
     23    Height = 26
     24    Top = 11
     25    Width = 56
    2826    Caption = 'Name:'
    2927    ParentColor = False
    3028  end
    3129  object Label2: TLabel
    32     Left = 10
    33     Height = 20
    34     Top = 49
    35     Width = 78
     30    Left = 12
     31    Height = 26
     32    Top = 59
     33    Width = 101
    3634    Caption = 'Source URL:'
    3735    ParentColor = False
    3836  end
    3937  object EditURL: TEdit
    40     Left = 136
    41     Height = 28
    42     Top = 49
    43     Width = 350
     38    Left = 163
     39    Height = 43
     40    Top = 59
     41    Width = 420
    4442    Anchors = [akTop, akLeft, akRight]
    4543    TabOrder = 1
    4644  end
    4745  object ButtonOk: TButton
    48     Left = 531
    49     Height = 25
    50     Top = 421
    51     Width = 75
     46    Left = 637
     47    Height = 30
     48    Top = 505
     49    Width = 90
    5250    Anchors = [akRight, akBottom]
    5351    Caption = 'Ok'
     
    5654  end
    5755  object ButtonCancel: TButton
    58     Left = 429
    59     Height = 25
    60     Top = 421
    61     Width = 75
     56    Left = 515
     57    Height = 30
     58    Top = 505
     59    Width = 90
    6260    Anchors = [akRight, akBottom]
    6361    Caption = 'Cancel'
     
    6664  end
    6765  object Label3: TLabel
    68     Left = 10
    69     Height = 20
    70     Top = 96
    71     Width = 84
     66    Left = 12
     67    Height = 26
     68    Top = 115
     69    Width = 106
    7270    Caption = 'Data format:'
    7371    ParentColor = False
    7472  end
    7573  object ComboBox1: TComboBox
    76     Left = 135
    77     Height = 28
    78     Top = 91
    79     Width = 350
    80     Anchors = [akTop, akLeft, akRight]
    81     ItemHeight = 20
     74    Left = 162
     75    Height = 42
     76    Top = 109
     77    Width = 420
     78    Anchors = [akTop, akLeft, akRight]
     79    ItemHeight = 0
    8280    Style = csDropDownList
    8381    TabOrder = 2
    8482  end
    8583  object ButtonShowFormat: TButton
    86     Left = 493
    87     Height = 25
    88     Top = 91
    89     Width = 112
     84    Left = 592
     85    Height = 30
     86    Top = 109
     87    Width = 134
    9088    Anchors = [akTop, akRight]
    9189    Caption = 'Configure'
     90    TabOrder = 3
    9291    OnClick = ButtonShowFormatClick
    93     TabOrder = 3
    9492  end
    9593  object CheckBoxEnabled: TCheckBox
    96     Left = 10
    97     Height = 24
    98     Top = 128
    99     Width = 78
     94    Left = 12
     95    Height = 30
     96    Top = 154
     97    Width = 94
    10098    Caption = 'Enabled'
    10199    TabOrder = 4
    102100  end
    103101  object Label4: TLabel
    104     Left = 10
    105     Height = 20
    106     Top = 160
    107     Width = 74
     102    Left = 12
     103    Height = 26
     104    Top = 192
     105    Width = 95
    108106    Caption = 'Categories:'
    109107    ParentColor = False
    110108  end
    111109  object ListBox1: TListBox
    112     Left = 135
    113     Height = 141
    114     Top = 160
    115     Width = 471
     110    Left = 162
     111    Height = 169
     112    Top = 192
     113    Width = 565
    116114    Anchors = [akTop, akLeft, akRight]
    117115    ItemHeight = 0
     
    120118    ScrollWidth = 469
    121119    TabOrder = 5
     120    TopIndex = -1
    122121  end
    123122  object Button1: TButton
    124     Left = 135
    125     Height = 25
    126     Top = 312
    127     Width = 75
     123    Left = 162
     124    Height = 30
     125    Top = 374
     126    Width = 90
    128127    Action = ACategoryAdd
    129128    TabOrder = 6
    130129  end
    131130  object Button2: TButton
    132     Left = 231
    133     Height = 25
    134     Top = 312
    135     Width = 75
     131    Left = 277
     132    Height = 30
     133    Top = 374
     134    Width = 90
    136135    Action = ACategoryRemove
    137136    TabOrder = 7
    138137  end
    139138  object Bevel1: TBevel
    140     Left = 10
     139    Left = 12
    141140    Height = 2
    142     Top = 408
    143     Width = 597
     141    Top = 490
     142    Width = 716
    144143    Anchors = [akLeft, akRight, akBottom]
    145144  end
    146145  object Label5: TLabel
    147     Left = 10
    148     Height = 20
    149     Top = 352
    150     Width = 73
     146    Left = 12
     147    Height = 26
     148    Top = 422
     149    Width = 97
    151150    Caption = 'User name:'
    152151    ParentColor = False
    153152  end
    154153  object Label6: TLabel
    155     Left = 305
    156     Height = 20
    157     Top = 351
    158     Width = 65
     154    Left = 366
     155    Height = 26
     156    Top = 421
     157    Width = 87
    159158    Caption = 'Password:'
    160159    ParentColor = False
    161160  end
    162161  object EditUserName: TEdit
    163     Left = 136
    164     Height = 28
    165     Top = 351
    166     Width = 153
     162    Left = 163
     163    Height = 43
     164    Top = 421
     165    Width = 184
    167166    TabOrder = 8
    168167  end
    169168  object EditPassword: TEdit
    170     Left = 436
    171     Height = 28
    172     Top = 351
    173     Width = 153
     169    Left = 523
     170    Height = 43
     171    Top = 421
     172    Width = 184
    174173    EchoMode = emPassword
    175174    PasswordChar = '*'
     
    177176  end
    178177  object ButtonOpenURL: TButton
    179     Left = 493
    180     Height = 25
    181     Top = 52
    182     Width = 112
     178    Left = 592
     179    Height = 30
     180    Top = 62
     181    Width = 134
    183182    Anchors = [akTop, akRight]
    184183    Caption = 'Open URL'
     184    TabOrder = 12
    185185    OnClick = ButtonOpenURLClick
    186     TabOrder = 12
    187186  end
    188187  object ActionList1: TActionList
    189     left = 384
    190     top = 208
     188    Left = 461
     189    Top = 250
    191190    object ACategoryRemove: TAction
    192191      Caption = 'Remove'
     
    201200  end
    202201  object PopupMenuCategory: TPopupMenu
    203     left = 208
    204     top = 208
     202    Left = 250
     203    Top = 250
    205204    object MenuItem2: TMenuItem
    206205      Action = ACategoryAdd
  • trunk/Forms/FormImportSource.pas

    r218 r219  
    1 unit UFormImportSource;
    2 
    3 {$mode delphi}
     1unit FormImportSource;
    42
    53interface
     
    75uses
    86  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
    9   ActnList, Menus, ExtCtrls, UAcronym, LCLIntf;
     7  ActnList, Menus, ExtCtrls, Acronym, LCLIntf;
    108
    119type
     
    4442    procedure ButtonOpenURLClick(Sender: TObject);
    4543    procedure ButtonShowFormatClick(Sender: TObject);
    46     procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
    47     procedure FormCreate(Sender: TObject);
    4844    procedure FormShow(Sender: TObject);
    49   private
    50     { private declarations }
    5145  public
    5246    procedure UpdateInterface;
     
    5549  end;
    5650
    57 var
    58   FormImportSource: TFormImportSource;
    5951
    6052implementation
     
    6355
    6456uses
    65   UCore, UFormImportFormat, UFormCategorySelect;
     57  Core, FormImportFormat, FormCategorySelect;
    6658
    6759{ TFormImportSource }
     
    7062var
    7163  NewImportFormat: TImportFormat;
     64  FormImportFormat: TFormImportFormat;
    7265begin
    7366  if ComboBox1.ItemIndex <> -1 then begin
     
    8073        FormImportFormat.Save(NewImportFormat);
    8174        TImportFormat(ComboBox1.Items.Objects[ComboBox1.ItemIndex]).Assign(NewImportFormat);
    82         Core.AcronymDb.Modified := True;
     75        Core.Core.AcronymDb.Modified := True;
    8376        ComboBox1.Items.Strings[ComboBox1.ItemIndex] := NewImportFormat.Name;
    8477      end;
     
    9083end;
    9184
    92 procedure TFormImportSource.FormClose(Sender: TObject;
    93   var CloseAction: TCloseAction);
    94 begin
    95   Core.PersistentForm1.Save(Self);
    96 end;
    97 
    98 procedure TFormImportSource.FormCreate(Sender: TObject);
    99 begin
    100   Core.Translator.TranslateComponentRecursive(Self);
    101   Core.ThemeManager.UseTheme(Self);
    102 end;
    103 
    10485procedure TFormImportSource.FormShow(Sender: TObject);
    10586begin
    106   Core.PersistentForm1.Load(Self);
    10787  UpdateInterface;
    10888end;
     
    11696var
    11797  I: Integer;
     98  FormCategorySelect: TFormCategorySelect;
    11899begin
    119100  FormCategorySelect := TFormCategorySelect.Create(Self);
     
    155136  EditName.Text := ImportSource.Name;
    156137  EditURL.Text := ImportSource.URL;
    157   while ComboBox1.Items.Count > Core.AcronymDb.ImportFormats.Count do
     138  while ComboBox1.Items.Count > Core.Core.AcronymDb.ImportFormats.Count do
    158139    ComboBox1.Items.Delete(ComboBox1.Items.Count - 1);
    159   while ComboBox1.Items.Count < Core.AcronymDb.ImportFormats.Count do
     140  while ComboBox1.Items.Count < Core.Core.AcronymDb.ImportFormats.Count do
    160141    ComboBox1.Items.Add('');
    161   for I := 0 to Core.AcronymDb.ImportFormats.Count - 1 do begin
    162     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];
    164145  end;
    165146  ComboBox1.ItemIndex := ComboBox1.Items.IndexOfObject(ImportSource.Format);
  • trunk/Forms/FormImportSources.lfm

    r218 r219  
    11object FormImportSources: TFormImportSources
    22  Left = 475
    3   Height = 414
     3  Height = 497
    44  Top = 329
    5   Width = 812
     5  Width = 974
    66  Caption = 'Import sources'
    7   ClientHeight = 414
    8   ClientWidth = 812
    9   DesignTimePPI = 120
    10   OnClose = FormClose
     7  ClientHeight = 497
     8  ClientWidth = 974
     9  DesignTimePPI = 144
    1110  OnCreate = FormCreate
    1211  OnShow = FormShow
    1312  Position = poScreenCenter
    14   LCLVersion = '2.0.2.0'
     13  LCLVersion = '3.6.0.0'
    1514  object ToolBar1: TToolBar
    1615    Left = 0
    17     Height = 26
    18     Top = 388
    19     Width = 812
     16    Height = 33
     17    Top = 464
     18    Width = 974
    2019    Align = alBottom
    2120    Caption = 'ToolBar1'
     
    3029    end
    3130    object ToolButton2: TToolButton
    32       Left = 30
     31      Left = 36
    3332      Top = 2
    3433      Action = AModify
    3534    end
    3635    object ToolButton3: TToolButton
    37       Left = 59
     36      Left = 71
    3837      Top = 2
    3938      Action = ARemove
    4039    end
    4140    object ToolButton4: TToolButton
    42       Left = 88
     41      Left = 106
    4342      Top = 2
    4443      Action = AProcess
     
    4645  end
    4746  object ListView1: TListView
    48     Left = 4
    49     Height = 351
    50     Top = 33
    51     Width = 804
     47    Left = 5
     48    Height = 419
     49    Top = 40
     50    Width = 964
    5251    Align = alClient
    53     BorderSpacing.Left = 4
    54     BorderSpacing.Right = 4
    55     BorderSpacing.Bottom = 4
     52    BorderSpacing.Left = 5
     53    BorderSpacing.Right = 5
     54    BorderSpacing.Bottom = 5
    5655    Checkboxes = True
    5756    Columns = <   
    5857      item
    5958        Caption = 'Name'
    60         Width = 150
     59        Width = 180
    6160      end   
    6261      item
    6362        Caption = 'URL'
    64         Width = 250
     63        Width = 300
    6564      end   
    6665      item
    6766        Caption = 'Categories'
    68         Width = 200
     67        Width = 240
    6968      end   
    7069      item
    7170        Caption = 'Count'
    72         Width = 70
     71        Width = 84
    7372      end   
    7473      item
    7574        Caption = 'Date'
    76         Width = 114
     75        Width = 145
    7776      end>
    7877    MultiSelect = True
     
    9190  end
    9291  object ListViewFilter1: TListViewFilter
    93     Left = 4
    94     Height = 29
    95     Top = 4
    96     Width = 804
     92    Left = 5
     93    Height = 35
     94    Top = 5
     95    Width = 964
    9796    OnChange = ListViewFilter1Change
    9897    Align = alTop
    99     BorderSpacing.Left = 4
    100     BorderSpacing.Top = 4
    101     BorderSpacing.Right = 4
     98    BorderSpacing.Left = 5
     99    BorderSpacing.Top = 5
     100    BorderSpacing.Right = 5
    102101  end
    103102  object ActionList1: TActionList
    104103    Images = Core.ImageList1
    105     left = 408
    106     top = 224
     104    Left = 490
     105    Top = 269
    107106    object AAdd: TAction
    108107      Caption = 'Add'
     
    139138  object PopupMenuImportSource: TPopupMenu
    140139    Images = Core.ImageList1
    141     left = 147
    142     top = 220
     140    Left = 176
     141    Top = 264
    143142    object MenuItem1: TMenuItem
    144143      Action = AAdd
     
    167166    ShowDelay = 0
    168167    AutoClose = False
    169     left = 299
    170     top = 119
     168    Left = 359
     169    Top = 143
    171170  end
    172171  object ListViewSort1: TListViewSort
     
    177176    Column = 0
    178177    Order = soNone
    179     left = 547
    180     top = 172
     178    Left = 656
     179    Top = 206
    181180  end
    182181end
  • trunk/Forms/FormImportSources.pas

    r218 r219  
    1 unit UFormImportSources;
    2 
    3 {$mode delphi}
     1unit FormImportSources;
    42
    53interface
     
    75uses
    86  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;
    109
    1110type
     
    4443    procedure AProcessExecute(Sender: TObject);
    4544    procedure ARemoveExecute(Sender: TObject);
    46     procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
    4745    procedure FormCreate(Sender: TObject);
    4846    procedure FormShow(Sender: TObject);
    4947    procedure ListView1Change(Sender: TObject; Item: TListItem;
    5048      Change: TItemChange);
    51     procedure ListView1Click(Sender: TObject);
    5249    procedure ListView1Data(Sender: TObject; Item: TListItem);
    5350    procedure ListView1DblClick(Sender: TObject);
     
    6259  private
    6360    procedure ProcessImportJob(Job: TJob);
    64     procedure FilterList(List: TFPGObjectList<TObject>);
     61    procedure FilterList(List: TObjectList<TObject>);
    6562  public
    6663    ImportSources: TImportSources;
     
    6966  end;
    7067
    71 var
    72   FormImportSources: TFormImportSources;
    7368
    7469implementation
     
    7772
    7873uses
    79   UCore, UFormMain, UFormImportSource;
     74  Core, FormMain, FormImportSource;
    8075
    8176resourcestring
     
    172167procedure TFormImportSources.FormShow(Sender: TObject);
    173168begin
    174   Core.PersistentForm1.Load(Self);
    175169  UpdateList;
    176   Core.ScaleDPI1.ScaleControl(ToolBar1, Core.ScaleDPI1.DesignDPI);
     170  Core.Core.ScaleDPI1.ScaleControl(ToolBar1, Core.Core.ScaleDPI1.DesignDPI);
    177171end;
    178172
     
    182176  if Assigned(Item) and (Change = ctState) then begin
    183177    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;
    191180end;
    192181
     
    194183var
    195184  NewImportSource: TImportSource;
     185  FormImportSource: TFormImportSource;
    196186  I: Integer;
    197187begin
     
    212202
    213203        NewImportSource := nil;
    214         Core.AcronymDb.Modified := True;
     204        Core.Core.AcronymDb.Modified := True;
    215205        UpdateList;
    216206      end else ShowMessage(Format(SImportSourceAlreadyExists, [NewImportSource.Name]));
     
    229219  if ListView1.Items[I].Selected then begin
    230220    TImportSource(ListView1.Items[I].Data).Enabled := False;
    231     Core.AcronymDb.Modified := True;
     221    Core.Core.AcronymDb.Modified := True;
    232222  end;
    233223  UpdateList;
     
    241231  if ListView1.Items[I].Selected then begin
    242232    TImportSource(ListView1.Items[I].Data).Enabled := True;
    243     Core.AcronymDb.Modified := True;
     233    Core.Core.AcronymDb.Modified := True;
    244234  end;
    245235  UpdateList;
     
    249239var
    250240  NewImportSource: TImportSource;
     241  FormImportSource: TFormImportSource;
    251242begin
    252243  if Assigned(ListView1.Selected) then begin
     
    261252          if not Assigned(ImportSources.SearchByName(NewImportSource.Name)) then begin;
    262253            TImportSource(ListView1.Selected.Data).Assign(NewImportSource);
    263             Core.AcronymDb.Modified := True;
     254            Core.Core.AcronymDb.Modified := True;
    264255          end else ShowMessage(Format(SImportSourceAlreadyExists, [NewImportSource.Name]));
    265256        end else begin
    266257          TImportSource(ListView1.Selected.Data).Assign(NewImportSource);
    267           Core.AcronymDb.Modified := True;
     258          Core.Core.AcronymDb.Modified := True;
    268259        end;
    269260
     
    283274begin
    284275  if Assigned(ListView1.Selected) then begin
    285     Core.AcronymDb.AddedCount := 0;
     276    Core.Core.AcronymDb.AddedCount := 0;
    286277    JobProgressView1.AddJob(SProcessSelectedSource, ProcessImportJob);
    287278    JobProgressView1.Start;
    288279    ShowMessage(Format(SAddedCount, [TImportSource(ListView1.Selected.Data).ItemCount,
    289       Core.AcronymDb.AddedCount]));
     280      Core.Core.AcronymDb.AddedCount]));
    290281  end;
    291282end;
     
    296287end;
    297288
    298 procedure TFormImportSources.FilterList(List: TFPGObjectList<TObject>);
     289procedure TFormImportSources.FilterList(List: TObjectList<TObject>);
    299290var
    300291  I: Integer;
     
    344335end;
    345336
    346 procedure TFormImportSources.FormClose(Sender: TObject;
    347   var CloseAction: TCloseAction);
    348 begin
    349   Core.PersistentForm1.Save(Self);
    350 end;
    351 
    352337procedure TFormImportSources.FormCreate(Sender: TObject);
    353338var
    354339  I: Integer;
    355340begin
    356   Core.Translator.TranslateComponentRecursive(Self);
    357   Core.ThemeManager.UseTheme(Self);
    358341  for I := 0 to ToolBar1.ButtonCount - 1 do
    359342    ToolBar1.Buttons[I].Hint := ToolBar1.Buttons[I].Caption;
  • trunk/Forms/FormMain.lfm

    r218 r219  
    11object FormMain: TFormMain
    22  Left = 417
    3   Height = 747
     3  Height = 713
    44  Top = 453
    55  Width = 1106
     
    1212  OnCloseQuery = FormCloseQuery
    1313  OnCreate = FormCreate
    14   OnDestroy = FormDestroy
    1514  OnHide = FormHide
    1615  OnResize = FormResize
    1716  OnShow = FormShow
    18   LCLVersion = '2.0.12.0'
     17  LCLVersion = '3.6.0.0'
    1918  object PanelMain: TPanel
    2019    Left = 0
    21     Height = 605
     20    Height = 604
    2221    Top = 81
    2322    Width = 1106
    2423    Align = alClient
    2524    BevelOuter = bvNone
    26     ClientHeight = 605
     25    ClientHeight = 604
    2726    ClientWidth = 1106
    2827    ParentFont = False
     
    3837    object ListViewAcronyms: TListView
    3938      Left = 5
    40       Height = 549
     39      Height = 548
    4140      Top = 50
    4241      Width = 1095
     
    317316  object StatusBar1: TStatusBar
    318317    Left = 0
    319     Height = 27
    320     Top = 686
     318    Height = 28
     319    Top = 685
    321320    Width = 1106
    322321    Panels = <   
     
    605604    end
    606605  end
    607   object AboutDialog1: TAboutDialog
    608     Translator = Core.Translator
    609     ThemeManager = Core.ThemeManager
    610     ApplicationInfo = Core.ApplicationInfo1
    611     Left = 392
    612     Top = 448
    613   end
    614606end
  • trunk/Forms/FormMain.pas

    r218 r219  
    1 unit UFormMain;
    2 
    3 {$mode delphi}{$H+}
     1unit FormMain;
    42
    53interface
     
    75uses
    86  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;
    1210
    1311type
     
    1513  { TFormMain }
    1614
    17   TFormMain = class(TForm)
    18     AboutDialog1: TAboutDialog;
     15  TFormMain = class(TFormEx)
    1916    AFilterShowItemsWithoutFilter: TAction;
    2017    ADocumentCheck: TAction;
     
    138135    procedure FormCloseQuery(Sender: TObject; var CanClose: boolean);
    139136    procedure FormCreate(Sender: TObject);
    140     procedure FormDestroy(Sender: TObject);
    141137    procedure LastOpenedList1Change(Sender: TObject);
    142138    procedure ListViewAcronymsData(Sender: TObject; Item: TListItem);
     
    158154    function FilterCell(Text1, Text2: string): Boolean;
    159155    procedure ProcessImportsJob(Job: TJob);
    160     procedure FilterList(List: TFPGObjectList<TObject>);
     156    procedure FilterList(List: TObjectList<TObject>);
    161157    procedure OpenRecentClick(Sender: TObject);
    162158    procedure SetToolbarHints;
     
    167163    procedure UpdateInterface;
    168164    procedure ProjectOpen(FileName: string);
    169     function CompareStrings(Strings1, Strings2: TStrings): Boolean;
    170   end;
    171 
    172 var
    173   FormMain: TFormMain;
     165  end;
    174166
    175167resourcestring
     
    186178
    187179uses
    188   UFormImport, UFormSettings, UFormCategories, UFormAcronyms, UFormExport,
    189   UFormImportSources, UFormImportFormats, UCore, UFormCheck;
     180  FormImport, FormSettings, FormCategories, FormAcronyms, FormExport,
     181  FormImportSources, FormImportFormats, Core, FormCheck;
    190182
    191183resourcestring
     
    232224procedure TFormMain.FormHide(Sender: TObject);
    233225begin
    234   if Core.InitializeFinished then Core.PersistentForm1.Save(Self);
     226  if Core.Core.InitializeFinished then Core.Core.PersistentForm1.Save(Self);
    235227  UpdateInterface;
    236228end;
     
    243235procedure TFormMain.FormClose(Sender: TObject; var CloseAction: TCloseAction);
    244236begin
    245   Core.PersistentForm1.Save(Self);
    246   Core.SaveConfig;
     237  Core.Core.SaveConfig;
    247238end;
    248239
     
    260251
    261252procedure TFormMain.ADocumentCheckExecute(Sender: TObject);
     253var
     254  FormCheck: TFormCheck;
    262255begin
    263256  FormCheck := TFormCheck.Create(Self);
     
    272265
    273266procedure TFormMain.AExportExecute(Sender: TObject);
     267var
     268  FormExport: TFormExport;
    274269begin
    275270  FormExport := TFormExport.Create(Self);
     
    287282begin
    288283  DoClose := False;
    289   if Assigned(Core.AcronymDb) then begin
    290     if Core.AcronymDb.Modified then begin
     284  if Assigned(Core.Core.AcronymDb) then begin
     285    if Core.Core.AcronymDb.Modified then begin
    291286       ModalResult := MessageDlg(SAppExit, SAppExitQuery,
    292287       mtConfirmation, [mbYes, mbNo, mbCancel], 0);
     
    301296  end;
    302297  if DoClose then begin
    303     FreeAndNil(Core.AcronymDb);
     298    FreeAndNil(Core.Core.AcronymDb);
    304299    UpdateAcronymsList;
    305300    UpdateInterface;
     
    311306begin
    312307  AFileClose.Execute;
    313   if not Assigned(Core.AcronymDb)  then begin
    314     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);
    318313    UpdateAcronymsList;
    319314    UpdateInterface;
     
    324319begin
    325320  OpenDialog1.DefaultExt := ProjectExt;
    326   if Assigned(Core.AcronymDb) then begin
    327     OpenDialog1.InitialDir := ExtractFileDir(Core.AcronymDb.FileName);
     321  if Assigned(Core.Core.AcronymDb) then begin
     322    OpenDialog1.InitialDir := ExtractFileDir(Core.Core.AcronymDb.FileName);
    328323    OpenDialog1.Filter := SFileFilter;
    329     OpenDialog1.FileName := ExtractFileName(Core.AcronymDb.FileName);
     324    OpenDialog1.FileName := ExtractFileName(Core.Core.AcronymDb.FileName);
    330325  end;
    331326  if OpenDialog1.Execute then begin
     
    337332begin
    338333  SaveDialog1.DefaultExt := ProjectExt;
    339   SaveDialog1.InitialDir := ExtractFileDir(Core.AcronymDb.FileName);
     334  SaveDialog1.InitialDir := ExtractFileDir(Core.Core.AcronymDb.FileName);
    340335  SaveDialog1.Filter := SFileFilter;
    341   SaveDialog1.FileName := ExtractFileName(Core.AcronymDb.FileName);
     336  SaveDialog1.FileName := ExtractFileName(Core.Core.AcronymDb.FileName);
    342337  if SaveDialog1.Execute then begin
    343     Core.AcronymDb.SaveToFile(SaveDialog1.FileName);
     338    Core.Core.AcronymDb.SaveToFile(SaveDialog1.FileName);
    344339    LastOpenedList1.AddItem(SaveDialog1.FileName);
    345340    UpdateInterface;
     
    349344procedure TFormMain.AFileSaveExecute(Sender: TObject);
    350345begin
    351   if FileExists(Core.AcronymDb.FileName) then begin
    352     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);
    354349    UpdateInterface;
    355350  end else AFileSaveAs.Execute;
     
    382377
    383378procedure TFormMain.AImportExecute(Sender: TObject);
     379var
     380  FormImport: TFormImport;
    384381begin
    385382  FormImport := TFormImport.Create(Self);
     
    394391
    395392procedure TFormMain.AManageAcronymExecute(Sender: TObject);
     393var
     394  FormAcronyms: TFormAcronyms;
    396395begin
    397396  FormAcronyms := TFormAcronyms.Create(Self);
     
    399398    if Assigned(ListViewAcronyms.Selected) then
    400399      FormAcronyms.FocusAcronym := ListViewAcronyms.Selected.Data;
    401     FormAcronyms.Acronyms := Core.AcronymDb.Acronyms;
     400    FormAcronyms.Acronyms := Core.Core.AcronymDb.Acronyms;
    402401    FormAcronyms.ShowModal;
    403402    UpdateAcronymsList;
     
    411410begin
    412411  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]));
    417416  UpdateAcronymsList;
    418417  UpdateInterface;
     
    423422  I: Integer;
    424423begin
    425   for I := 0 to Core.AcronymDb.ImportSources.Count - 1 do
    426   with TImportSource(Core.AcronymDb.ImportSources[I]) do
     424  for I := 0 to Core.Core.AcronymDb.ImportSources.Count - 1 do
     425  with Core.Core.AcronymDb.ImportSources[I] do
    427426  if Enabled then begin
    428427    Process;
    429428    ImportTotalItemCount := ImportTotalItemCount + ItemCount;
    430     Job.Progress.Max := Core.AcronymDb.ImportSources.Count;
     429    Job.Progress.Max := Core.Core.AcronymDb.ImportSources.Count;
    431430    Job.Progress.Value := I;
    432431    if Job.Terminate then Break;
     
    435434
    436435procedure TFormMain.ASettingsExecute(Sender: TObject);
     436var
     437  FormSettings: TFormSettings;
    437438begin
    438439  FormSettings := TFormSettings.Create(Self);
     
    441442    if FormSettings.ShowModal = mrOk then begin
    442443      FormSettings.Save;
    443       Core.SaveConfig;
    444       Core.ThemeManager.UseTheme(Self);
     444      Core.Core.SaveConfig;
     445      Core.Core.ThemeManager.UseTheme(Self);
    445446    end;
    446447  finally
     
    450451
    451452procedure TFormMain.AShowAboutExecute(Sender: TObject);
    452 begin
    453   AboutDialog1.Show;
     453var
     454  FormAbout: TFormAbout;
     455begin
     456  FormAbout := TFormAbout.Create(nil);
     457  try
     458    FormAbout.ApplicationInfo := Core.Core.ApplicationInfo1;
     459    FormAbout.ShowModal;
     460  finally
     461    FormAbout.Free;
     462  end;
    454463end;
    455464
    456465procedure TFormMain.AShowAcronymsExecute(Sender: TObject);
     466var
     467  FormAcronyms: TFormAcronyms;
    457468begin
    458469  FormAcronyms := TFormAcronyms.Create(Self);
    459470  try
    460     FormAcronyms.Acronyms := Core.AcronymDb.Acronyms;
     471    FormAcronyms.Acronyms := Core.Core.AcronymDb.Acronyms;
    461472    FormAcronyms.ShowModal;
    462473    UpdateAcronymsList;
     
    468479
    469480procedure TFormMain.AShowCategoriesExecute(Sender: TObject);
     481var
     482  FormCategories: TFormCategories;
    470483begin
    471484  FormCategories := TFormCategories.Create(Self);
    472485  try
    473     FormCategories.Categories := Core.AcronymDb.Categories;
     486    FormCategories.Categories := Core.Core.AcronymDb.Categories;
    474487    FormCategories.ShowModal;
    475488    UpdateAcronymsList;
     
    487500
    488501procedure TFormMain.AShowImportFormatsExecute(Sender: TObject);
     502var
     503  FormImportFormats: TFormImportFormats;
    489504begin
    490505  FormImportFormats := TFormImportFormats.Create(Self);
    491506  try
    492     FormImportFormats.ImportFormats := Core.AcronymDb.ImportFormats;
     507    FormImportFormats.ImportFormats := Core.Core.AcronymDb.ImportFormats;
    493508    FormImportFormats.ShowModal;
    494509    UpdateInterface;
     
    499514
    500515procedure TFormMain.AShowImportSourcesExecute(Sender: TObject);
     516var
     517  FormImportSources: TFormImportSources;
    501518begin
    502519  FormImportSources := TFormImportSources.Create(Self);
    503520  try
    504     FormImportSources.ImportSources := Core.AcronymDb.ImportSources;
     521    FormImportSources.ImportSources := Core.Core.AcronymDb.ImportSources;
    505522    FormImportSources.ShowModal;
    506523    UpdateAcronymsList;
     
    511528end;
    512529
    513 procedure TFormMain.FormDestroy(Sender: TObject);
    514 begin
    515 end;
    516 
    517530procedure TFormMain.FormShow(Sender: TObject);
    518531begin
    519   Core.Initialize;
     532  Core.Core.Initialize;
    520533
    521534  if Visible then begin
    522     Core.PersistentForm1.Load(Self);
    523     Core.ThemeManager.UseTheme(Self);
    524535    ListViewFilter1.UpdateFromListView(ListViewAcronyms);
    525536    UpdateInterface;
     
    529540    ListViewFilter1.StringGrid.SetFocus;
    530541  end;
    531   Core.ScaleDPI1.ScaleControl(CoolBar1, Core.ScaleDPI1.DesignDPI);
     542  Core.Core.ScaleDPI1.ScaleControl(CoolBar1, Core.Core.ScaleDPI1.DesignDPI);
    532543  CoolBar1.AutosizeBands;
    533544end;
     
    587598procedure TFormMain.ListViewSort1Filter(ListViewSort: TListViewSort);
    588599begin
    589   Core.AcronymDb.AssignToList(ListViewSort1.List, AFilterEnabledCategories.Checked);
     600  Core.Core.AcronymDb.AssignToList(ListViewSort1.List, AFilterEnabledCategories.Checked);
    590601  FilterList(ListViewSort1.List);
    591602end;
     
    628639begin
    629640  AFileClose.Execute;
    630   if not Assigned(Core.AcronymDb) then begin
     641  if not Assigned(Core.Core.AcronymDb) then begin
    631642    try
    632643      AFileNew.Execute;
    633       Core.AcronymDb.LoadFromFile(FileName);
     644      Core.Core.AcronymDb.LoadFromFile(FileName);
    634645      LastOpenedList1.AddItem(FileName);
    635646    finally
     
    640651end;
    641652
    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>);
     653procedure TFormMain.FilterList(List: TObjectList<TObject>);
    656654var
    657655  I: Integer;
     
    686684begin
    687685  AFileClose.Execute;
    688   if not Assigned(Core.AcronymDb) then begin
     686  if not Assigned(Core.Core.AcronymDb) then begin
    689687    AFileNew.Execute;
    690     Core.AcronymDb.LoadFromFile(TMenuItem(Sender).Caption);
     688    Core.Core.AcronymDb.LoadFromFile(TMenuItem(Sender).Caption);
    691689    LastOpenedList1.AddItem(TMenuItem(Sender).Caption);
    692690    UpdateAcronymsList;
     
    697695procedure TFormMain.UpdateAcronymsList;
    698696begin
    699   if Assigned(Core.AcronymDb) then begin
     697  if Assigned(Core.Core.AcronymDb) then begin
    700698    ListViewSort1.Refresh;
    701699  end else begin
     
    710708  Title: string;
    711709begin
    712   ListViewAcronyms.Enabled := Assigned(Core.AcronymDb);
    713   AFileClose.Enabled := Assigned(Core.AcronymDb);
    714   AFileSave.Enabled := Assigned(Core.AcronymDb) and Core.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);
    724722  CoolBar1.Visible := MenuItemToolbar.Checked;
    725723  PanelParam.Visible := MenuItemParam.Checked;
    726   AHide.Enabled := FormMain.Visible;
     724  AHide.Enabled := Visible;
    727725  AManageAcronym.Enabled := Assigned(ListViewAcronyms.Selected);
    728726  StatusBar1.Visible := MenuItemStatusBar.Checked;
    729727
    730728  Title := '';
    731   if Assigned(Core.AcronymDb) and (ExtractFileNameWithoutExt(ExtractFileName(Core.AcronymDb.FileName)) <> '') then begin
    732     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 + ')';
    734732  end;
    735733  if Title <> '' then Title := Title + ' - ';
    736   Title := Title + Core.ApplicationInfo1.AppName;
     734  Title := Title + Core.Core.ApplicationInfo1.AppName;
    737735  {$IFDEF WINDOWS}
    738736  // Under Linux title would affect reg.xml path for storing registry settings
     
    740738  {$ENDIF}
    741739  Caption := Title;
    742   if Assigned(Core.AcronymDb) then begin
     740  if Assigned(Core.Core.AcronymDb) then begin
    743741    StatusBar1.Panels[0].Text := Format(SAcronymsCount, [
    744       Core.AcronymDb.Acronyms.Count]);
     742      Core.Core.AcronymDb.Acronyms.Count]);
    745743    StatusBar1.Panels[1].Text := Format(SMeaningsCount, [
    746       Core.AcronymDb.GetMeaningsCount]);
     744      Core.Core.AcronymDb.GetMeaningsCount]);
    747745  end else begin
    748746    StatusBar1.Panels[0].Text := '';
     
    753751procedure TFormMain.LoadConfig;
    754752begin
    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');
    758756  LastOpenedList1.LoadFromRegistry(RegistryContext);
    759757
     
    761759  // If installed in Linux system then use installation directory for po files
    762760  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';
    764762  {$ENDIF}
    765763
    766764  with TRegistryEx.Create do
    767765  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);
    770768    AFilterSameLength.Checked := ReadBoolWithDefault('SameLength', False);
    771769    AFilterSameLetterCase.Checked := ReadBoolWithDefault('SameLetterCase', False);
     
    784782    RootKey := HKEY_CURRENT_USER;
    785783    OpenKey(RegistryRunKey, True);
    786     Core.StartOnLogon := ValueExists('Acronym Decoder');
     784    Core.Core.StartOnLogon := ValueExists('Acronym Decoder');
    787785  finally
    788786    Free;
     
    792790procedure TFormMain.SaveConfig;
    793791begin
    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');
    796794  LastOpenedList1.SaveToRegistry(RegistryContext);
    797795
    798796  with TRegistryEx.Create do
    799797  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);
    802800    WriteBool('SameLength', AFilterSameLength.Checked);
    803801    WriteBool('SameLetterCase', AFilterSameLetterCase.Checked);
     
    815813    RootKey := HKEY_CURRENT_USER;
    816814    OpenKey(RegistryRunKey, True);
    817     if Core.StartOnLogon then begin
    818       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')
    819817        else WriteString('Acronym Decoder', Application.ExeName)
    820818    end else DeleteValue('Acronym Decoder');
  • trunk/Forms/FormSettings.lfm

    r218 r219  
    11object FormSettings: TFormSettings
    22  Left = 798
    3   Height = 371
     3  Height = 394
    44  Top = 367
    55  Width = 590
    66  Caption = 'Settings'
    7   ClientHeight = 371
     7  ClientHeight = 394
    88  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
    1312  OnCreate = FormCreate
    14   OnShow = FormShow
    1513  Position = poScreenCenter
    16   LCLVersion = '1.8.2.0'
     14  LCLVersion = '3.6.0.0'
    1715  object ComboBoxLanguage: TComboBox
    18     Left = 152
    19     Height = 28
    20     Top = 24
    21     Width = 208
    22     ItemHeight = 20
     16    Left = 182
     17    Height = 42
     18    Top = 29
     19    Width = 250
     20    ItemHeight = 0
    2321    Style = csDropDownList
    2422    TabOrder = 0
    2523  end
    2624  object Label1: TLabel
    27     Left = 16
    28     Height = 20
    29     Top = 24
    30     Width = 68
     25    Left = 19
     26    Height = 26
     27    Top = 29
     28    Width = 88
    3129    Caption = 'Language:'
    3230    ParentColor = False
    3331  end
    3432  object ButtonOk: TButton
    35     Left = 506
    36     Height = 25
    37     Top = 326
    38     Width = 75
     33    Left = 489
     34    Height = 30
     35    Top = 340
     36    Width = 90
    3937    Anchors = [akRight, akBottom]
    4038    Caption = 'Ok'
    4139    ModalResult = 1
    42     OnClick = ButtonOkClick
    4340    TabOrder = 3
    4441  end
    4542  object ButtonCancel: TButton
    46     Left = 410
    47     Height = 25
    48     Top = 326
    49     Width = 75
     43    Left = 374
     44    Height = 30
     45    Top = 340
     46    Width = 90
    5047    Anchors = [akRight, akBottom]
    5148    Caption = 'Cancel'
     
    5451  end
    5552  object CheckBoxAlwaysOnTop: TCheckBox
    56     Left = 16
    57     Height = 24
    58     Top = 64
    59     Width = 118
     53    Left = 19
     54    Height = 30
     55    Top = 77
     56    Width = 145
    6057    Caption = 'Always on top'
    6158    TabOrder = 1
    6259  end
    6360  object CheckBoxStartOnLogon: TCheckBox
    64     Left = 16
    65     Height = 24
    66     Top = 96
    67     Width = 150
     61    Left = 19
     62    Height = 30
     63    Top = 115
     64    Width = 188
    6865    Caption = 'Start on user logon'
    6966    Color = clDefault
    70     OnChange = CheckBoxStartOnLogonChange
    7167    ParentColor = False
    7268    ParentFont = False
    7369    TabOrder = 4
     70    OnChange = CheckBoxStartOnLogonChange
    7471  end
    7572  object CheckBoxStartMinimizedToTray: TCheckBox
    76     Left = 48
    77     Height = 24
    78     Top = 128
    79     Width = 176
     73    Left = 58
     74    Height = 30
     75    Top = 154
     76    Width = 218
    8077    Caption = 'Start minimized to tray'
    8178    TabOrder = 5
    8279  end
    8380  object CheckBoxAutomaticDPI: TCheckBox
    84     Left = 16
    85     Height = 24
    86     Top = 192
    87     Width = 120
     81    Left = 19
     82    Height = 30
     83    Top = 230
     84    Width = 148
    8885    Caption = 'Automatic DPI'
    89     OnChange = CheckBoxAutomaticDPIChange
    9086    TabOrder = 6
    9187    Visible = False
     88    OnChange = CheckBoxAutomaticDPIChange
    9289  end
    9390  object SpinEditDPI: TSpinEdit
    94     Left = 94
    95     Height = 28
    96     Top = 222
    97     Width = 97
     91    Left = 113
     92    Height = 43
     93    Top = 266
     94    Width = 116
    9895    MaxValue = 300
    9996    MinValue = 96
     
    103100  end
    104101  object Label2: TLabel
    105     Left = 46
    106     Height = 20
    107     Top = 222
    108     Width = 26
     102    Left = 55
     103    Height = 26
     104    Top = 266
     105    Width = 35
    109106    Caption = 'DPI:'
    110107    ParentColor = False
     
    112109  end
    113110  object CheckBoxReopenLastFileOnStart: TCheckBox
    114     Left = 16
    115     Height = 24
    116     Top = 160
    117     Width = 181
     111    Left = 19
     112    Height = 30
     113    Top = 192
     114    Width = 226
    118115    Caption = 'Reopen last file on start'
    119116    TabOrder = 8
    120117  end
    121118  object Bevel1: TBevel
    122     Left = 8
     119    Left = 10
    123120    Height = 2
    124     Top = 309
    125     Width = 570
     121    Top = 320
     122    Width = 566
    126123    Anchors = [akLeft, akRight, akBottom]
    127124  end
    128125  object Label3: TLabel
    129     Left = 16
    130     Height = 20
    131     Top = 264
    132     Width = 48
     126    Left = 19
     127    Height = 26
     128    Top = 317
     129    Width = 63
    133130    Caption = 'Theme:'
    134131    ParentColor = False
    135132  end
    136133  object ComboBoxTheme: TComboBox
    137     Left = 152
    138     Height = 28
    139     Top = 264
    140     Width = 208
    141     ItemHeight = 20
     134    Left = 182
     135    Height = 42
     136    Top = 317
     137    Width = 250
     138    ItemHeight = 0
    142139    Style = csDropDownList
    143140    TabOrder = 9
  • trunk/Forms/FormSettings.pas

    r218 r219  
    1 unit UFormSettings;
    2 
    3 {$mode delphi}
     1unit FormSettings;
    42
    53interface
     
    75uses
    86  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
    9   Menus, Spin, ExtCtrls, ULanguages;
     7  Menus, Spin, ExtCtrls, Languages, FormEx;
    108
    119type
     
    1311  { TFormSettings }
    1412
    15   TFormSettings = class(TForm)
     13  TFormSettings = class(TFormEx)
    1614    Bevel1: TBevel;
    1715    ButtonOk: TButton;
     
    2826    Label3: TLabel;
    2927    SpinEditDPI: TSpinEdit;
    30     procedure ButtonOkClick(Sender: TObject);
    3128    procedure CheckBoxAutomaticDPIChange(Sender: TObject);
    3229    procedure CheckBoxStartOnLogonChange(Sender: TObject);
    33     procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
    3430    procedure FormCreate(Sender: TObject);
    35     procedure FormShow(Sender: TObject);
    36   private
    37     { private declarations }
    3831  public
    3932    procedure Load;
     
    4235  end;
    4336
    44 var
    45   FormSettings: TFormSettings;
    4637
    4738implementation
     
    5041
    5142uses
    52   UCore, UTheme;
     43  Core, Theme;
    5344
    5445{ TFormSettings }
    55 
    56 procedure TFormSettings.FormShow(Sender: TObject);
    57 begin
    58   Core.PersistentForm1.Load(Self);
    59 end;
    60 
    61 procedure TFormSettings.ButtonOkClick(Sender: TObject);
    62 begin
    63 end;
    6446
    6547procedure TFormSettings.CheckBoxAutomaticDPIChange(Sender: TObject);
     
    7355end;
    7456
    75 procedure TFormSettings.FormClose(Sender: TObject; var CloseAction: TCloseAction
    76   );
    77 begin
    78   Core.PersistentForm1.Save(Self);
    79 end;
    80 
    8157procedure TFormSettings.FormCreate(Sender: TObject);
    8258begin
    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);
    8762end;
    8863
    8964procedure TFormSettings.Load;
    9065begin
    91   ComboBoxLanguage.ItemIndex := ComboBoxLanguage.Items.IndexOfObject(Core.Translator.Language);
     66  ComboBoxLanguage.ItemIndex := ComboBoxLanguage.Items.IndexOfObject(Core.Core.Translator.Language);
    9267  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);
    9469  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;
    10176  UpdateInterface;
    10277end;
     
    10580begin
    10681  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]);
    10883  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;
    11691end;
    11792
Note: See TracChangeset for help on using the changeset viewer.