Changeset 107 for trunk/Forms/FormMain.pas
- Timestamp:
- Jul 19, 2024, 11:24:06 PM (4 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/FormMain.pas
r103 r107 4 4 5 5 uses 6 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, LCLType, 6 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, LCLType, FormEx, 7 7 Dialogs, ExtCtrls, ComCtrls, Menus, ActnList, Engine, Platform, Math, 8 8 DateUtils, GraphType, PersistentForm, ApplicationInfo, Translator, … … 13 13 { TFormMain } 14 14 15 TFormMain = class(TForm )15 TFormMain = class(TFormEx) 16 16 AAbout: TAction; 17 17 AShowRawImageDesc: TAction; … … 41 41 procedure AShowMapExecute(Sender: TObject); 42 42 procedure AShowRawImageDescExecute(Sender: TObject); 43 procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);44 43 procedure FormCreate(Sender: TObject); 45 44 procedure FormDestroy(Sender: TObject); … … 53 52 StartTime: TDateTime; 54 53 Drawing: Boolean; 55 FullScreenEnabled: Boolean;56 54 procedure LoadConfig; 57 55 procedure SaveConfig; 58 56 procedure UpdateInterface; 59 57 public 60 PersistentForm: TPersistentForm;61 58 Engine: TEngine; 62 59 FormNewGame: TFormNewGame; … … 145 142 begin 146 143 {$IFDEF LCLQT5} 147 MenuItem1.Visible := not FullScreen Enabled;148 MenuItem4.Visible := not FullScreen Enabled;149 MenuItem7.Visible := not FullScreen Enabled;144 MenuItem1.Visible := not FullScreen; 145 MenuItem4.Visible := not FullScreen; 146 MenuItem7.Visible := not FullScreen; 150 147 {$ELSE} 151 if FullScreen Enabledthen Menu := nil148 if FullScreen then Menu := nil 152 149 else Menu := MainMenu1; 153 150 {$ENDIF} 154 151 {$IFDEF DEBUG} 155 StatusBar1.Visible := not FullScreen Enabled;152 StatusBar1.Visible := not FullScreen; 156 153 AShowMap.Visible := True; 157 154 ANewGame.Visible := True; … … 178 175 179 176 Image1.ControlStyle := Image1.ControlStyle + [csOpaque]; 180 FullScreenEnabled := True; 181 182 PersistentForm := TPersistentForm.Create(nil); 183 PersistentForm.RegistryContext := TRegistryContext.Create(Core.Core.ApplicationInfo.RegistryRoot, 184 Core.Core.ApplicationInfo.RegistryKey); 177 FullScreen := True; 185 178 186 179 Application.OnDeactivate := FormDeactivate; … … 214 207 procedure TFormMain.AFullScreenExecute(Sender: TObject); 215 208 begin 216 FullScreenEnabled := not FullScreenEnabled; 217 PersistentForm.SetFullScreen(FullScreenEnabled); 209 FullScreen := not FullScreen; 210 TFormEx.PersistentForm.Load(Self); 211 TFormEx.PersistentForm.SetFullScreen(FullScreen); 218 212 UpdateInterface; 219 213 end; … … 244 238 end; 245 239 246 procedure TFormMain.FormClose(Sender: TObject; var CloseAction: TCloseAction);247 begin248 PersistentForm.Save(Self);249 end;250 251 240 procedure TFormMain.AExitExecute(Sender: TObject); 252 241 begin … … 282 271 procedure TFormMain.FormShow(Sender: TObject); 283 272 begin 284 PersistentForm.RegistryContext := Core.Core.ApplicationInfo.GetRegistryContext;285 PersistentForm.Load(Self, False, True);286 FullScreenEnabled := PersistentForm.FormFullScreen;287 //PersistentForm.SetFullScreen(FullScreenEnabled);288 273 UpdateInterface; 289 274 end;
Note:
See TracChangeset
for help on using the changeset viewer.