Ignore:
Timestamp:
Jun 7, 2024, 12:47:11 PM (5 months ago)
Author:
chronos
Message:
  • Modified: Remove U prefix from unit names.
  • Modified: Used TFormEx for all forms for code simplification.
  • Fixed: Fullscreen mode switching error.
File:
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/Forms/FormHistory.pas

    r85 r86  
    1 unit UFormHistory;
    2 
    3 {$mode delphi}
     1unit FormHistory;
    42
    53interface
    64
    75uses
    8   Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ExtCtrls, ComCtrls, UGame;
     6  Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ExtCtrls, ComCtrls,
     7  Game, FormEx;
    98
    109type
     
    1211  { TFormHistory }
    1312
    14   TFormHistory = class(TForm)
     13  TFormHistory = class(TFormEx)
    1514    PaintBox1: TPaintBox;
    1615    Panel1: TPanel;
    1716    Timer1: TTimer;
    1817    TrackBar1: TTrackBar;
    19     procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
    2018    procedure FormCreate(Sender: TObject);
    2119    procedure FormDestroy(Sender: TObject);
     
    3129  end;
    3230
    33 var
    34   FormHistory: TFormHistory;
    3531
    3632implementation
     
    3935
    4036uses
    41   UCore;
     37  Core;
    4238
    4339{ TFormHistory }
     
    4541procedure TFormHistory.FormShow(Sender: TObject);
    4642begin
    47   Core.PersistentForm1.Load(Self);
    48   TrackBar1.Max := Core.Game.History.Moves.Count;
    49   Game.Board.Size := Core.Game.Board.Size;
     43  TrackBar1.Max := Core.Core.Game.History.Moves.Count;
     44  Game.Board.Size := Core.Core.Game.Board.Size;
    5045  Redraw;
    5146end;
     
    5954begin
    6055  if RedrawPending then begin
    61     Core.Game.History.GetStep(Game, TrackBar1.Position);
     56    Core.Core.Game.History.GetStep(Game, TrackBar1.Position);
    6257    PaintBox1.Refresh;
    6358    RedrawPending := False;
     
    7772procedure TFormHistory.FormCreate(Sender: TObject);
    7873begin
    79   Core.Translator1.TranslateComponentRecursive(Self);
    80   Core.ThemeManager1.UseTheme(Self);
    8174  Game := TGame.Create;
    8275end;
     
    8780end;
    8881
    89 procedure TFormHistory.FormClose(Sender: TObject; var CloseAction: TCloseAction
    90   );
    91 begin
    92   Core.PersistentForm1.Save(Self);
    93 end;
    94 
    9582end.
    9683
Note: See TracChangeset for help on using the changeset viewer.