Changeset 143 for trunk/Forms


Ignore:
Timestamp:
May 29, 2023, 7:30:31 PM (18 months ago)
Author:
chronos
Message:

Removed U prefix from all units.

Location:
trunk/Forms
Files:
12 moved

Legend:

Unmodified
Added
Removed
  • trunk/Forms/FormImages.pas

    r142 r143  
    1 unit UFormImages;
     1unit FormImages;
    22
    33interface
     
    2525  end;
    2626
    27 var
    28   FormImages: TFormImages;
    29 
    3027
    3128implementation
  • trunk/Forms/FormMain.pas

    r142 r143  
    1 unit UFormMain;
     1unit FormMain;
    22
    33interface
     
    55uses
    66  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, Menus,
    7   ExtCtrls, UEngine, LCLType, Types, UTranslator, UApplicationInfo,
    8   URegistry, UPersistentForm;
     7  ExtCtrls, Engine, LCLType, Types, Translator, ApplicationInfo,
     8  RegistryEx, PersistentForm, FormImages;
    99
    1010type
     
    4949  end;
    5050
    51 var
    52   FormMain: TFormMain;
    53 
    5451
    5552implementation
     
    5855
    5956uses
    60   UFormImages, UPixelPointer, UCore, UFormTest, UTestCases;
     57  PixelPointer, Core, FormTest, TestCases;
    6158
    6259{ TFormMain }
    6360
    6461procedure TFormMain.FormCreate(Sender: TObject);
     62{$IFDEF UNIX}
    6563const
    6664  UnixLanguagesDir = '/usr/share/TransLines/languages';
     65  {$ENDIF}
    6766begin
    6867  {$IFDEF UNIX}
     
    7473  Engine := TEngine.Create(nil);
    7574  Engine.RegistryContext := ApplicationInfo1.GetRegistryContext;
    76   Engine.Translator := Core.Translator1;
     75  Engine.Translator := Core.Core.Translator1;
    7776  Engine.OnFullScreenChange := FullScreenChangeExecute;
    7877  Engine.OnExit := ExitExecute;
     
    9594  if not Initialized then begin
    9695    Initialized := True;
    97     Core.PersistentForm1.RegistryContext := ApplicationInfo1.GetRegistryContext;
    98     Core.PersistentForm1.Load(Self, False, True);
    99     Engine.FullScreen := Core.PersistentForm1.FormFullScreen;
     96    Core.Core.PersistentForm1.RegistryContext := ApplicationInfo1.GetRegistryContext;
     97    Core.Core.PersistentForm1.Load(Self, False, True);
     98    Engine.FullScreen := Core.Core.PersistentForm1.FormFullScreen;
    10099    Engine.InitMenus;
    101100    Engine.OnDarkModeChange := DarkModeChangeExecute;
     
    109108procedure TFormMain.FormClose(Sender: TObject; var CloseAction: TCloseAction);
    110109begin
    111   Core.PersistentForm1.Save(Self);
     110  Core.Core.PersistentForm1.Save(Self);
     111  Application.Terminate;
    112112end;
    113113
     
    127127  KeyF12 = 123;
    128128{$ENDIF}
     129var
     130  FormTest: TFormTest;
    129131begin
    130132  if Key = KeyF11 then begin
     
    199201procedure TFormMain.FullScreenChangeExecute(Sender: TObject; Active: Boolean);
    200202begin
    201   Core.PersistentForm1.SetFullScreen(Active);
     203  Core.Core.PersistentForm1.SetFullScreen(Active);
    202204end;
    203205
     
    222224    if ValueExists('LanguageCode') then begin
    223225      LangCode := ReadStringWithDefault('LanguageCode', '');
    224       Core.Translator1.Language := Core.Translator1.Languages.SearchByCode(LangCode);
    225     end else Core.Translator1.Language := Core.Translator1.Languages.SearchByCode('');
     226      Core.Core.Translator1.Language := Core.Core.Translator1.Languages.SearchByCode(LangCode);
     227    end else Core.Core.Translator1.Language := Core.Core.Translator1.Languages.SearchByCode('');
    226228    Engine.LoadFromRegistry;
    227229  finally
     
    236238    CurrentContext := ApplicationInfo1.GetRegistryContext;
    237239
    238     if Assigned(Core.Translator1.Language) and (Core.Translator1.Language.Code <> '') then
    239       WriteString('LanguageCode', Core.Translator1.Language.Code)
     240    if Assigned(Core.Core.Translator1.Language) and (Core.Core.Translator1.Language.Code <> '') then
     241      WriteString('LanguageCode', Core.Core.Translator1.Language.Code)
    240242      else DeleteValue('LanguageCode');
    241243    Engine.SaveToRegistry;
     
    246248
    247249procedure TFormMain.LoadGraphicAssets;
    248 begin
     250var
     251  FormImages: TFormImages;
     252begin
     253  FormImages := TFormImages.Create(nil);
     254
    249255  CopyImage(Engine.ImagePassenger.Bitmap, FormImages.ImagePassenger.Picture.Bitmap);
    250256  CopyImage(Engine.ImagePassenger.BitmapDisabled, FormImages.ImagePassenger.Picture.Bitmap, True);
     
    295301  Engine.ImageNewTrain.Bitmap.Assign(Engine.ImageLocomotive.Bitmap);
    296302  Engine.ImageNewTrain.BitmapDisabled.Assign(Engine.ImageLocomotive.BitmapDisabled);
     303
     304  FreeAndNil(FormImages);
    297305end;
    298306
  • trunk/Forms/FormTest.pas

    r142 r143  
    1 unit UFormTest;
     1unit FormTest;
    22
    33interface
     
    55uses
    66  Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ComCtrls, StdCtrls,
    7   ActnList, Menus, UTestCase;
     7  ActnList, Menus, TestCase;
    88
    99type
     
    3939  end;
    4040
    41 var
    42   FormTest: TFormTest;
    43 
    4441
    4542implementation
     
    4845
    4946uses
    50   UCore, UFormTestCase;
     47  Core, FormTestCase;
    5148
    5249{ TFormTest }
     
    112109procedure TFormTest.FormClose(Sender: TObject; var CloseAction: TCloseAction);
    113110begin
    114   Core.PersistentForm1.Save(Self);
     111  Core.Core.PersistentForm1.Save(Self);
    115112end;
    116113
     
    148145procedure TFormTest.FormCreate(Sender: TObject);
    149146begin
    150   Core.Translator1.TranslateComponentRecursive(Self);
    151   Core.ThemeManager1.UseTheme(Self);
     147  Core.Core.Translator1.TranslateComponentRecursive(Self);
     148  Core.Core.ThemeManager1.UseTheme(Self);
    152149end;
    153150
    154151procedure TFormTest.FormShow(Sender: TObject);
    155152begin
    156   Core.PersistentForm1.Load(Self);
     153  Core.Core.PersistentForm1.Load(Self);
    157154  ReloadList;
    158155  UpdateInterface;
  • trunk/Forms/FormTestCase.pas

    r142 r143  
    1 unit UFormTestCase;
     1unit FormTestCase;
    22
    33interface
     
    1616    procedure FormShow(Sender: TObject);
    1717  private
    18 
    1918  public
    20 
    2119  end;
    22 
    23 var
    24   FormTestCase: TFormTestCase;
    2520
    2621
     
    3025
    3126uses
    32   UCore;
     27  Core;
    3328
    3429{ TFormTestCase }
     
    3732  );
    3833begin
    39   Core.PersistentForm1.Save(Self);
     34  Core.Core.PersistentForm1.Save(Self);
    4035end;
    4136
    4237procedure TFormTestCase.FormCreate(Sender: TObject);
    4338begin
    44   Core.Translator1.TranslateComponentRecursive(Self);
    45   Core.ThemeManager1.UseTheme(Self);
     39  Core.Core.Translator1.TranslateComponentRecursive(Self);
     40  Core.Core.ThemeManager1.UseTheme(Self);
    4641end;
    4742
    4843procedure TFormTestCase.FormShow(Sender: TObject);
    4944begin
    50   Core.PersistentForm1.Load(Self);
     45  Core.Core.PersistentForm1.Load(Self);
    5146end;
    5247
Note: See TracChangeset for help on using the changeset viewer.