Changeset 105 for trunk/Forms


Ignore:
Timestamp:
Dec 9, 2024, 4:40:34 PM (6 weeks ago)
Author:
chronos
Message:
  • Added: Set number of randomly generated disabled tiles in new game form.
Location:
trunk/Forms
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/FormNew.lfm

    r103 r105  
    3535    Width = 497
    3636    HorzScrollBar.Page = 435
    37     VertScrollBar.Page = 118
     37    VertScrollBar.Page = 160
    3838    Anchors = [akTop, akLeft, akRight, akBottom]
    3939    ClientHeight = 245
     
    6969      Style = csDropDownList
    7070      TabOrder = 0
     71      OnChange = ComboBoxSizeChange
    7172    end
    7273    object CheckBoxUndoEnabled: TCheckBox
     
    8687      TabOrder = 2
    8788    end
     89    object Label2: TLabel
     90      Left = 16
     91      Height = 26
     92      Top = 122
     93      Width = 119
     94      Caption = 'Disabled tiles:'
     95    end
     96    object SpinEditDisabledTiles: TSpinEdit
     97      Left = 320
     98      Height = 43
     99      Top = 117
     100      Width = 115
     101      MaxValue = 10000
     102      TabOrder = 3
     103    end
    88104  end
    89105end
  • trunk/Forms/FormNew.lrj

    r103 r105  
    55{"hash":103901194,"name":"tformnew.label1.caption","sourcebytes":[66,111,97,114,100,32,115,105,122,101,58],"value":"Board size:"},
    66{"hash":260260820,"name":"tformnew.checkboxundoenabled.caption","sourcebytes":[85,110,100,111,32,101,110,97,98,108,101,100],"value":"Undo enabled"},
    7 {"hash":146862089,"name":"tformnew.checkboxrecordhistory.caption","sourcebytes":[82,101,99,111,114,100,32,109,111,118,101,115,32,104,105,115,116,111,114,121],"value":"Record moves history"}
     7{"hash":146862089,"name":"tformnew.checkboxrecordhistory.caption","sourcebytes":[82,101,99,111,114,100,32,109,111,118,101,115,32,104,105,115,116,111,114,121],"value":"Record moves history"},
     8{"hash":248990730,"name":"tformnew.label2.caption","sourcebytes":[68,105,115,97,98,108,101,100,32,116,105,108,101,115,58],"value":"Disabled tiles:"}
    89]}
  • trunk/Forms/FormNew.pas

    r103 r105  
    55uses
    66  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
    7   Game, FormEx;
     7  Spin, Game, FormEx, Math;
    88
    99type
     
    1818    ComboBoxSize: TComboBox;
    1919    Label1: TLabel;
     20    Label2: TLabel;
    2021    ScrollBox1: TScrollBox;
     22    SpinEditDisabledTiles: TSpinEdit;
     23    procedure ComboBoxSizeChange(Sender: TObject);
    2124  public
     25    procedure UpdateInterface;
    2226    procedure Load(Game: TGame);
    2327    procedure Save(Game: TGame);
     
    3034
    3135{ TFormNew }
     36
     37procedure TFormNew.ComboBoxSizeChange(Sender: TObject);
     38begin
     39  UpdateInterface;
     40end;
     41
     42procedure TFormNew.UpdateInterface;
     43begin
     44  SpinEditDisabledTiles.MaxValue := ComboBoxSize.ItemIndex + 2;
     45end;
     46
    3247procedure TFormNew.Load(Game: TGame);
    3348begin
     
    3550  CheckBoxUndoEnabled.Checked := Game.UndoEnabled;
    3651  CheckBoxRecordHistory.Checked := Game.RecordHistory;
     52  SpinEditDisabledTiles.Value := Game.DisabledTilesCount;
     53  UpdateInterface;
    3754end;
    3855
     
    4259  Game.UndoEnabled := CheckBoxUndoEnabled.Checked;
    4360  Game.RecordHistory := CheckBoxRecordHistory.Checked;
     61  Game.DisabledTilesCount := SpinEditDisabledTiles.Value;
    4462end;
    4563
Note: See TracChangeset for help on using the changeset viewer.