Changeset 7


Ignore:
Timestamp:
Sep 26, 2019, 9:36:37 PM (5 years ago)
Author:
chronos
Message:
  • Added: Remember window dimensions after application restart.
Location:
trunk
Files:
45 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Game2048.lpi

    r6 r7  
    5454        </CompilerOptions>
    5555      </Item2>
     56      <SharedMatrixOptions Count="2">
     57        <Item1 ID="940799555322" Targets="Common" Modes="Debug" Value="-g -gl -gh -CirotR -O1"/>
     58        <Item2 ID="173967671653" Targets="Common" Modes="Debug" Value="-CX -XX -O3"/>
     59      </SharedMatrixOptions>
    5660    </BuildModes>
    5761    <PublishOptions>
     
    6468      </Modes>
    6569    </RunParams>
    66     <RequiredPackages Count="1">
     70    <RequiredPackages Count="2">
    6771      <Item1>
     72        <PackageName Value="Common"/>
     73        <DefaultFilename Value="Packages/Common/Common.lpk" Prefer="True"/>
     74      </Item1>
     75      <Item2>
    6876        <PackageName Value="LCL"/>
    69       </Item1>
     77      </Item2>
    7078    </RequiredPackages>
    7179    <Units Count="4">
  • trunk/Game2048.lpr

    r6 r7  
    88  {$ENDIF}{$ENDIF}
    99  Interfaces, SysUtils,// this includes the LCL widgetset
    10   Forms, UFormMain, UGame, UFormNew
     10  Forms, UFormMain, UGame, UFormNew, Common
    1111  { you can add units after this };
    1212
  • trunk/UFormMain.lfm

    r5 r7  
    77  DesignTimePPI = 144
    88  Menu = MainMenu1
     9  OnClose = FormClose
    910  OnCreate = FormCreate
    1011  OnDestroy = FormDestroy
     
    3839    end
    3940  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
     63  end
    4064end
  • trunk/UFormMain.pas

    r6 r7  
    77uses
    88  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, Menus,
    9   ActnList, ExtCtrls, StdCtrls, UGame;
     9  ActnList, ExtCtrls, StdCtrls, UGame, UPersistentForm, UApplicationInfo;
    1010
    1111type
     
    1717    AGameNew: TAction;
    1818    ActionList1: TActionList;
     19    ApplicationInfo1: TApplicationInfo;
    1920    MainMenu1: TMainMenu;
    2021    MenuItem1: TMenuItem;
    2122    MenuItem2: TMenuItem;
    2223    MenuItemGame: TMenuItem;
     24    PersistentForm1: TPersistentForm;
    2325    procedure AExitExecute(Sender: TObject);
    2426    procedure AGameNewExecute(Sender: TObject);
     27    procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
    2528    procedure FormCreate(Sender: TObject);
    2629    procedure FormDestroy(Sender: TObject);
     
    7982end;
    8083
     84procedure TFormMain.FormClose(Sender: TObject; var CloseAction: TCloseAction);
     85begin
     86  PersistentForm1.Save(Self);
     87end;
     88
    8189procedure TFormMain.AExitExecute(Sender: TObject);
    8290begin
     
    99107procedure TFormMain.FormShow(Sender: TObject);
    100108begin
     109  PersistentForm1.RegistryContext := ApplicationInfo1.GetRegistryContext;
     110  PersistentForm1.Load(Self);
    101111  Game.New;
    102112  {
Note: See TracChangeset for help on using the changeset viewer.