Ignore:
Timestamp:
Jan 17, 2025, 9:05:54 PM (4 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.
File:
1 moved

Legend:

Unmodified
Added
Removed
  • 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);
Note: See TracChangeset for help on using the changeset viewer.