Changeset 143 for trunk/Forms
- Timestamp:
- May 29, 2023, 7:30:31 PM (18 months ago)
- Location:
- trunk/Forms
- Files:
-
- 12 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/FormImages.pas
r142 r143 1 unit UFormImages;1 unit FormImages; 2 2 3 3 interface … … 25 25 end; 26 26 27 var28 FormImages: TFormImages;29 30 27 31 28 implementation -
trunk/Forms/FormMain.pas
r142 r143 1 unit UFormMain;1 unit FormMain; 2 2 3 3 interface … … 5 5 uses 6 6 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; 9 9 10 10 type … … 49 49 end; 50 50 51 var52 FormMain: TFormMain;53 54 51 55 52 implementation … … 58 55 59 56 uses 60 UFormImages, UPixelPointer, UCore, UFormTest, UTestCases;57 PixelPointer, Core, FormTest, TestCases; 61 58 62 59 { TFormMain } 63 60 64 61 procedure TFormMain.FormCreate(Sender: TObject); 62 {$IFDEF UNIX} 65 63 const 66 64 UnixLanguagesDir = '/usr/share/TransLines/languages'; 65 {$ENDIF} 67 66 begin 68 67 {$IFDEF UNIX} … … 74 73 Engine := TEngine.Create(nil); 75 74 Engine.RegistryContext := ApplicationInfo1.GetRegistryContext; 76 Engine.Translator := Core. Translator1;75 Engine.Translator := Core.Core.Translator1; 77 76 Engine.OnFullScreenChange := FullScreenChangeExecute; 78 77 Engine.OnExit := ExitExecute; … … 95 94 if not Initialized then begin 96 95 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; 100 99 Engine.InitMenus; 101 100 Engine.OnDarkModeChange := DarkModeChangeExecute; … … 109 108 procedure TFormMain.FormClose(Sender: TObject; var CloseAction: TCloseAction); 110 109 begin 111 Core.PersistentForm1.Save(Self); 110 Core.Core.PersistentForm1.Save(Self); 111 Application.Terminate; 112 112 end; 113 113 … … 127 127 KeyF12 = 123; 128 128 {$ENDIF} 129 var 130 FormTest: TFormTest; 129 131 begin 130 132 if Key = KeyF11 then begin … … 199 201 procedure TFormMain.FullScreenChangeExecute(Sender: TObject; Active: Boolean); 200 202 begin 201 Core. PersistentForm1.SetFullScreen(Active);203 Core.Core.PersistentForm1.SetFullScreen(Active); 202 204 end; 203 205 … … 222 224 if ValueExists('LanguageCode') then begin 223 225 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(''); 226 228 Engine.LoadFromRegistry; 227 229 finally … … 236 238 CurrentContext := ApplicationInfo1.GetRegistryContext; 237 239 238 if Assigned(Core. Translator1.Language) and (Core.Translator1.Language.Code <> '') then239 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) 240 242 else DeleteValue('LanguageCode'); 241 243 Engine.SaveToRegistry; … … 246 248 247 249 procedure TFormMain.LoadGraphicAssets; 248 begin 250 var 251 FormImages: TFormImages; 252 begin 253 FormImages := TFormImages.Create(nil); 254 249 255 CopyImage(Engine.ImagePassenger.Bitmap, FormImages.ImagePassenger.Picture.Bitmap); 250 256 CopyImage(Engine.ImagePassenger.BitmapDisabled, FormImages.ImagePassenger.Picture.Bitmap, True); … … 295 301 Engine.ImageNewTrain.Bitmap.Assign(Engine.ImageLocomotive.Bitmap); 296 302 Engine.ImageNewTrain.BitmapDisabled.Assign(Engine.ImageLocomotive.BitmapDisabled); 303 304 FreeAndNil(FormImages); 297 305 end; 298 306 -
trunk/Forms/FormTest.pas
r142 r143 1 unit UFormTest;1 unit FormTest; 2 2 3 3 interface … … 5 5 uses 6 6 Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ComCtrls, StdCtrls, 7 ActnList, Menus, UTestCase;7 ActnList, Menus, TestCase; 8 8 9 9 type … … 39 39 end; 40 40 41 var42 FormTest: TFormTest;43 44 41 45 42 implementation … … 48 45 49 46 uses 50 UCore, UFormTestCase;47 Core, FormTestCase; 51 48 52 49 { TFormTest } … … 112 109 procedure TFormTest.FormClose(Sender: TObject; var CloseAction: TCloseAction); 113 110 begin 114 Core. PersistentForm1.Save(Self);111 Core.Core.PersistentForm1.Save(Self); 115 112 end; 116 113 … … 148 145 procedure TFormTest.FormCreate(Sender: TObject); 149 146 begin 150 Core. Translator1.TranslateComponentRecursive(Self);151 Core. ThemeManager1.UseTheme(Self);147 Core.Core.Translator1.TranslateComponentRecursive(Self); 148 Core.Core.ThemeManager1.UseTheme(Self); 152 149 end; 153 150 154 151 procedure TFormTest.FormShow(Sender: TObject); 155 152 begin 156 Core. PersistentForm1.Load(Self);153 Core.Core.PersistentForm1.Load(Self); 157 154 ReloadList; 158 155 UpdateInterface; -
trunk/Forms/FormTestCase.pas
r142 r143 1 unit UFormTestCase;1 unit FormTestCase; 2 2 3 3 interface … … 16 16 procedure FormShow(Sender: TObject); 17 17 private 18 19 18 public 20 21 19 end; 22 23 var24 FormTestCase: TFormTestCase;25 20 26 21 … … 30 25 31 26 uses 32 UCore;27 Core; 33 28 34 29 { TFormTestCase } … … 37 32 ); 38 33 begin 39 Core. PersistentForm1.Save(Self);34 Core.Core.PersistentForm1.Save(Self); 40 35 end; 41 36 42 37 procedure TFormTestCase.FormCreate(Sender: TObject); 43 38 begin 44 Core. Translator1.TranslateComponentRecursive(Self);45 Core. ThemeManager1.UseTheme(Self);39 Core.Core.Translator1.TranslateComponentRecursive(Self); 40 Core.Core.ThemeManager1.UseTheme(Self); 46 41 end; 47 42 48 43 procedure TFormTestCase.FormShow(Sender: TObject); 49 44 begin 50 Core. PersistentForm1.Load(Self);45 Core.Core.PersistentForm1.Load(Self); 51 46 end; 52 47
Note:
See TracChangeset
for help on using the changeset viewer.