Changeset 8 for trunk/Forms
- Timestamp:
- Sep 26, 2019, 10:08:16 PM (5 years ago)
- Location:
- trunk/Forms
- Files:
-
- 9 added
- 4 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormMain.lfm
r7 r8 19 19 object MenuItemGame: TMenuItem 20 20 Caption = 'Game' 21 object MenuItem 1: TMenuItem21 object MenuItemNew: TMenuItem 22 22 Action = AGameNew 23 23 end 24 object MenuItem 2: TMenuItem24 object MenuItemExit: TMenuItem 25 25 Action = AExit 26 end 27 end 28 object MenuItemHelp: TMenuItem 29 Caption = 'Help' 30 object MenuItemAbout: TMenuItem 31 Action = AAbout 26 32 end 27 33 end … … 29 35 object ActionList1: TActionList 30 36 left = 144 31 top = 15 537 top = 152 32 38 object AGameNew: TAction 33 39 Caption = 'New...' … … 38 44 OnExecute = AExitExecute 39 45 end 40 end 41 object PersistentForm1: TPersistentForm 42 MinVisiblePart = 50 43 EntireVisible = False 44 left = 161 45 top = 258 46 end 47 object ApplicationInfo1: TApplicationInfo 48 Identification = 1 49 VersionMajor = 1 50 VersionMinor = 0 51 VersionBugFix = 0 52 HomePage = 'https://app.zdechov.net/2048' 53 AuthorsName = 'Chronos' 54 EmailContact = 'robie@centrum.cz' 55 AppName = '2048' 56 Description = 'Classic 2048 game.' 57 ReleaseDate = 43733 58 RegistryKey = '\Software\Chronosoft\2048' 59 RegistryRoot = rrKeyCurrentUser 60 License = 'CC0' 61 left = 320 62 top = 258 46 object AAbout: TAction 47 Caption = 'About' 48 OnExecute = AAboutExecute 49 end 63 50 end 64 51 end -
trunk/Forms/UFormMain.pas
r7 r8 14 14 15 15 TFormMain = class(TForm) 16 AAbout: TAction; 16 17 AExit: TAction; 17 18 AGameNew: TAction; 18 19 ActionList1: TActionList; 19 ApplicationInfo1: TApplicationInfo;20 20 MainMenu1: TMainMenu; 21 MenuItem1: TMenuItem; 22 MenuItem2: TMenuItem; 21 MenuItemNew: TMenuItem; 22 MenuItemExit: TMenuItem; 23 MenuItemHelp: TMenuItem; 24 MenuItemAbout: TMenuItem; 23 25 MenuItemGame: TMenuItem; 24 PersistentForm1: TPersistentForm;26 procedure AAboutExecute(Sender: TObject); 25 27 procedure AExitExecute(Sender: TObject); 26 28 procedure AGameNewExecute(Sender: TObject); … … 32 34 procedure FormShow(Sender: TObject); 33 35 private 34 35 36 public 36 37 Game: TGame; … … 46 47 47 48 uses 48 U FormNew;49 UCore, UFormNew, UFormAbout; 49 50 50 51 { TFormMain } … … 75 76 procedure TFormMain.AGameNewExecute(Sender: TObject); 76 77 begin 77 FormNew.Load(Game); 78 if FormNew.ShowModal = mrOk then begin 79 FormNew.Save(Game); 80 Game.New; 78 FormNew := TFormNew.Create(nil); 79 try 80 FormNew.Load(Game); 81 if FormNew.ShowModal = mrOk then begin 82 FormNew.Save(Game); 83 Game.New; 84 end; 85 finally 86 FreeAndNil(FormNew); 81 87 end; 82 88 end; … … 84 90 procedure TFormMain.FormClose(Sender: TObject; var CloseAction: TCloseAction); 85 91 begin 86 PersistentForm1.Save(Self);92 Core.PersistentForm1.Save(Self); 87 93 end; 88 94 … … 90 96 begin 91 97 Close; 98 end; 99 100 procedure TFormMain.AAboutExecute(Sender: TObject); 101 begin 102 FormAbout := TFormAbout.Create(nil); 103 try 104 FormAbout.ApplicationInfo := Core.ApplicationInfo1; 105 FormAbout.ShowModal; 106 finally 107 FreeAndNil(FormAbout); 108 end; 92 109 end; 93 110 … … 107 124 procedure TFormMain.FormShow(Sender: TObject); 108 125 begin 109 PersistentForm1.RegistryContext :=ApplicationInfo1.GetRegistryContext;110 PersistentForm1.Load(Self);126 Core.PersistentForm1.RegistryContext := Core.ApplicationInfo1.GetRegistryContext; 127 Core.PersistentForm1.Load(Self); 111 128 Game.New; 112 129 { -
trunk/Forms/UFormNew.lfm
r7 r8 1 1 object FormNew: TFormNew 2 2 Left = 759 3 Height = 3604 Top = 6745 Width = 48 03 Height = 212 4 Top = 822 5 Width = 487 6 6 Caption = 'New game' 7 ClientHeight = 3608 ClientWidth = 48 07 ClientHeight = 212 8 ClientWidth = 487 9 9 DesignTimePPI = 144 10 LCLVersion = ' 1.8.4.0'10 LCLVersion = '2.0.2.0' 11 11 object Label1: TLabel 12 12 Left = 16 … … 19 19 object ComboBoxSize: TComboBox 20 20 Left = 173 21 Height = 4021 Height = 38 22 22 Top = 11 23 23 Width = 262 … … 37 37 end 38 38 object ButtonCancel: TButton 39 Left = 1 1239 Left = 120 40 40 Height = 38 41 Top = 27241 Top = 158 42 42 Width = 113 43 Anchors = [akLeft, akBottom] 43 44 Caption = 'Cancel' 44 45 ModalResult = 2 … … 48 49 Left = 280 49 50 Height = 38 50 Top = 27251 Top = 158 51 52 Width = 113 53 Anchors = [akLeft, akBottom] 52 54 Caption = 'OK' 53 55 ModalResult = 1
Note:
See TracChangeset
for help on using the changeset viewer.