Changeset 69 for trunk/Forms
- Timestamp:
- Nov 28, 2020, 12:35:06 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormMain.pas
r68 r69 73 73 procedure TFormMain.FormActivate(Sender: TObject); 74 74 begin 75 end; 76 77 procedure TFormMain.FormClose(Sender: TObject; var CloseAction: TCloseAction); 78 begin 79 PersistentForm1.Save(Self); 80 end; 81 82 procedure TFormMain.FormDestroy(Sender: TObject); 83 begin 84 SaveConfig; 85 Engine.Free; 86 end; 87 88 procedure TFormMain.FormKeyPress(Sender: TObject; var Key: char); 89 begin 90 if Key = #32 then begin 91 if Engine.State = gsRunning then Engine.State := gsPaused 92 else if Engine.State = gsPaused then Engine.State := gsRunning; 93 end; 94 end; 95 96 procedure TFormMain.FormKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState 97 ); 98 const 99 KeyF11 = 122; 100 begin 101 if Key = KeyF11 then begin 102 FullScreen := not FullScreen; 103 PersistentForm1.SetFullScreen(FormMain.FullScreen); 104 end else 105 Engine.KeyUp(Key); 106 end; 107 108 procedure TFormMain.FormShow(Sender: TObject); 109 begin 75 110 if not Initialized then begin 76 111 Initialized := True; … … 78 113 PersistentForm1.Load(Self, False, True); 79 114 FullScreen := PersistentForm1.FormFullScreen; 80 Randomize;81 115 Engine.InitMenus; 82 116 Engine.ImagePassenger.Picture.Assign(FormImages.ImagePassenger.Picture); … … 86 120 Engine.MainMenu; 87 121 end; 88 end;89 90 procedure TFormMain.FormClose(Sender: TObject; var CloseAction: TCloseAction);91 begin92 PersistentForm1.Save(Self);93 end;94 95 procedure TFormMain.FormDestroy(Sender: TObject);96 begin97 SaveConfig;98 Engine.Free;99 end;100 101 procedure TFormMain.FormKeyPress(Sender: TObject; var Key: char);102 begin103 if Key = #32 then begin104 if Engine.State = gsRunning then Engine.State := gsPaused105 else if Engine.State = gsPaused then Engine.State := gsRunning;106 end;107 end;108 109 procedure TFormMain.FormKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState110 );111 const112 KeyF11 = 122;113 begin114 if Key = KeyF11 then begin115 FullScreen := not FullScreen;116 PersistentForm1.SetFullScreen(FormMain.FullScreen);117 end else118 Engine.KeyUp(Key);119 end;120 121 procedure TFormMain.FormShow(Sender: TObject);122 begin123 122 end; 124 123
Note:
See TracChangeset
for help on using the changeset viewer.