- Timestamp:
- Sep 26, 2019, 10:08:16 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 20 added
- 5 edited
- 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 -
trunk/Game2048.lpi
r7 r8 15 15 <Icon Value="0"/> 16 16 </General> 17 <i18n> 18 <EnableI18N Value="True"/> 19 <OutDir Value="Languages"/> 20 </i18n> 17 21 <BuildModes Count="2"> 18 22 <Item1 Name="Debug" Default="True"/> … … 25 29 <SearchPaths> 26 30 <IncludeFiles Value="$(ProjOutDir)"/> 31 <OtherUnitFiles Value="Forms"/> 27 32 <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)-$(BuildMode)"/> 28 33 </SearchPaths> … … 77 82 </Item2> 78 83 </RequiredPackages> 79 <Units Count=" 4">84 <Units Count="7"> 80 85 <Unit0> 81 86 <Filename Value="Game2048.lpr"/> … … 83 88 </Unit0> 84 89 <Unit1> 85 <Filename Value="UFormMain.pas"/> 90 <Filename Value="UGame.pas"/> 91 <IsPartOfProject Value="True"/> 92 </Unit1> 93 <Unit2> 94 <Filename Value="Forms/UFormAbout.pas"/> 95 <IsPartOfProject Value="True"/> 96 <ComponentName Value="FormAbout"/> 97 <HasResources Value="True"/> 98 <ResourceBaseClass Value="Form"/> 99 </Unit2> 100 <Unit3> 101 <Filename Value="Forms/UFormMain.pas"/> 86 102 <IsPartOfProject Value="True"/> 87 103 <ComponentName Value="FormMain"/> 88 104 <HasResources Value="True"/> 89 105 <ResourceBaseClass Value="Form"/> 90 </Unit1> 91 <Unit2> 92 <Filename Value="UGame.pas"/> 93 <IsPartOfProject Value="True"/> 94 </Unit2> 95 <Unit3> 96 <Filename Value="UFormNew.pas"/> 106 </Unit3> 107 <Unit4> 108 <Filename Value="Forms/UFormNew.pas"/> 97 109 <IsPartOfProject Value="True"/> 98 110 <ComponentName Value="FormNew"/> 99 111 <HasResources Value="True"/> 100 112 <ResourceBaseClass Value="Form"/> 101 </Unit3> 113 </Unit4> 114 <Unit5> 115 <Filename Value="Forms/UFormSettings.pas"/> 116 <IsPartOfProject Value="True"/> 117 <ComponentName Value="FormSettings"/> 118 <HasResources Value="True"/> 119 <ResourceBaseClass Value="Form"/> 120 </Unit5> 121 <Unit6> 122 <Filename Value="UCore.pas"/> 123 <IsPartOfProject Value="True"/> 124 <ComponentName Value="Core"/> 125 <HasResources Value="True"/> 126 <ResourceBaseClass Value="DataModule"/> 127 </Unit6> 102 128 </Units> 103 129 </ProjectOptions> … … 109 135 <SearchPaths> 110 136 <IncludeFiles Value="$(ProjOutDir)"/> 137 <OtherUnitFiles Value="Forms"/> 111 138 <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)-$(BuildMode)"/> 112 139 </SearchPaths> -
trunk/Game2048.lpr
r7 r8 4 4 5 5 uses 6 {$IFDEF UNIX} {$IFDEF UseCThreads}7 cthreads, 8 {$ENDIF} {$ENDIF}6 {$IFDEF UNIX} 7 cthreads, clocale, 8 {$ENDIF} 9 9 Interfaces, SysUtils,// this includes the LCL widgetset 10 Forms, U FormMain, UGame, UFormNew, Common10 Forms, UGame, Common, UFormSettings, UFormMain, UCore 11 11 { you can add units after this }; 12 12 … … 28 28 Application.Initialize; 29 29 Application.CreateForm(TFormMain, FormMain); 30 Application.CreateForm(T FormNew, FormNew);30 Application.CreateForm(TCore, Core); 31 31 Application.Run; 32 32 end. -
trunk/Packages/Common
-
Property svn:ignore
set to
lib
-
Property svn:ignore
set to
-
trunk/Packages/Common/Common.lpk
r7 r8 40 40 <License Value="GNU/GPL"/> 41 41 <Version Minor="7"/> 42 <Files Count="2 2">42 <Files Count="24"> 43 43 <Item1> 44 44 <Filename Value="StopWatch.pas"/> … … 139 139 <UnitName Value="UStringTable"/> 140 140 </Item22> 141 <Item23> 142 <Filename Value="ULanguages.pas"/> 143 <UnitName Value="ULanguages"/> 144 </Item23> 145 <Item24> 146 <Filename Value="UTranslator.pas"/> 147 <HasRegisterProc Value="True"/> 148 <UnitName Value="UTranslator"/> 149 </Item24> 141 150 </Files> 142 151 <i18n> -
trunk/Packages/Common/Common.pas
r7 r8 12 12 UMemory, UResetableThread, UPool, ULastOpenedList, URegistry, 13 13 UJobProgressView, UXMLUtils, UApplicationInfo, USyncCounter, UListViewSort, 14 UPersistentForm, UFindFile, UScaleDPI, UTheme, UStringTable, 15 LazarusPackageIntf;14 UPersistentForm, UFindFile, UScaleDPI, UTheme, UStringTable, ULanguages, 15 UTranslator, LazarusPackageIntf; 16 16 17 17 implementation … … 29 29 RegisterUnit('UScaleDPI', @UScaleDPI.Register); 30 30 RegisterUnit('UTheme', @UTheme.Register); 31 RegisterUnit('UTranslator', @UTranslator.Register); 31 32 end; 32 33
Note:
See TracChangeset
for help on using the changeset viewer.