fpchess: Recreates the button to start playing

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@1844 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
sekelsenmat
2011-08-27 21:04:29 +00:00
parent 504857a383
commit 797e6dfabd
3 changed files with 32 additions and 14 deletions

View File

@ -14,7 +14,7 @@ object formChess: TformChess
Height = 433
Top = 0
Width = 360
PageIndex = 1
PageIndex = 0
Align = alClient
TabOrder = 0
TabStop = True
@ -59,12 +59,13 @@ object formChess: TformChess
Caption = 'minutes for each player'
ParentColor = False
end
object BitBtn3: TBitBtn
object btnQuit: TBitBtn
Left = 24
Height = 30
Top = 392
Width = 304
Caption = 'Quit'
OnClick = btnQuitClick
TabOrder = 0
end
object editPlayerName: TLabeledEdit
@ -130,7 +131,7 @@ object formChess: TformChess
end
object panelModules: TPanel
Left = 8
Height = 161
Height = 121
Top = 224
Width = 344
BevelOuter = bvNone
@ -156,6 +157,15 @@ object formChess: TformChess
ReadOnly = True
TabOrder = 7
end
object btnStartGame: TBitBtn
Left = 24
Height = 30
Top = 352
Width = 304
Caption = 'Start game'
OnClick = btnStartGameClick
TabOrder = 8
end
end
object pageGame: TPage
ClientWidth = 360
@ -193,8 +203,8 @@ object formChess: TformChess
end
end
object pageWebservice: TPage
ClientWidth = 720
ClientHeight = 866
ClientWidth = 360
ClientHeight = 433
object Label8: TLabel
Left = 0
Height = 32
@ -217,7 +227,7 @@ object formChess: TformChess
EditLabel.AnchorSideTop.Side = asrCenter
EditLabel.AnchorSideRight.Control = editPlayerName
EditLabel.AnchorSideBottom.Control = editPlayerName
EditLabel.Left = -6462
EditLabel.Left = -6822
EditLabel.Height = 17
EditLabel.Top = 75
EditLabel.Width = 79
@ -233,7 +243,6 @@ object formChess: TformChess
Top = 160
Width = 224
Caption = 'Start game'
OnClick = btnPlayAgainstAIClick
TabOrder = 0
end
object Label9: TLabel

View File

@ -27,7 +27,8 @@ type
{ TformChess }
TformChess = class(TForm)
BitBtn3: TBitBtn;
btnQuit: TBitBtn;
btnStartGame: TBitBtn;
btnPlayAgainstAI: TButton;
checkTimer: TCheckBox;
comboGameMode: TComboBox;
@ -52,7 +53,8 @@ type
spinPlayerTime: TSpinEdit;
timerChessTimer: TTimer;
pageWebservice: TPage;
procedure btnPlayAgainstAIClick(Sender: TObject);
procedure btnQuitClick(Sender: TObject);
procedure btnStartGameClick(Sender: TObject);
procedure comboGameModeSelect(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure timerChessTimerTimer(Sender: TObject);
@ -171,14 +173,22 @@ begin
end;
end;
procedure TformChess.btnPlayAgainstAIClick(Sender: TObject);
procedure TformChess.btnQuitClick(Sender: TObject);
begin
Close;
end;
procedure TformChess.btnStartGameClick(Sender: TObject);
var
lModule: TChessModule;
begin
InitializeGameModel();
notebookMain.PageIndex := INT_PAGE_GAME;
// if comboStartColor.ItemIndex = 0 then
// GetNextMoveFromBorlandWS();
gSelectedModuleIndex := comboGameMode.ItemIndex;
lModule := GetChessModule(gSelectedModuleIndex);
lModule.PrepareForGame();
end;
procedure TformChess.comboGameModeSelect(Sender: TObject);

View File

@ -80,8 +80,7 @@ end;
procedure TSinglePlayerChessModule.PrepareForGame;
begin
// SecondPlayerName := editSecondPlayerName.Text;
ChessModuleDebugLn('[TSinglePlayerChessModule.PrepareForGame]');
end;
function TSinglePlayerChessModule.IsMovingAllowedNow: Boolean;