diff --git a/applications/fpchess/fpchess.ico b/applications/fpchess/fpchess.ico new file mode 100644 index 000000000..0341321b5 Binary files /dev/null and b/applications/fpchess/fpchess.ico differ diff --git a/applications/fpchess/fpchess.lpi b/applications/fpchess/fpchess.lpi new file mode 100644 index 000000000..03e66fa3b --- /dev/null +++ b/applications/fpchess/fpchess.lpi @@ -0,0 +1,415 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/applications/fpchess/fpchess.lpr b/applications/fpchess/fpchess.lpr new file mode 100644 index 000000000..9668414b0 --- /dev/null +++ b/applications/fpchess/fpchess.lpr @@ -0,0 +1,20 @@ +program fpchess; + +{$mode objfpc}{$H+} + +uses + {$IFDEF UNIX}{$IFDEF UseCThreads} + cthreads, + {$ENDIF}{$ENDIF} + Interfaces, // this includes the LCL widgetset + Forms, mainform, fpchessdrawer + { you can add units after this }; + +{$R *.res} + +begin + Application.Initialize; + Application.CreateForm(TForm1, Form1); + Application.Run; +end. + diff --git a/applications/fpchess/fpchessdrawer.pas b/applications/fpchess/fpchessdrawer.pas new file mode 100644 index 000000000..e354bec37 --- /dev/null +++ b/applications/fpchess/fpchessdrawer.pas @@ -0,0 +1,59 @@ +unit fpchessdrawer; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, Controls, Graphics, LCLType; + +type + + { TFPChessDrawer } + + TFPChessDrawer = class(TCustomControl) + public + procedure EraseBackground(DC: HDC); override; + procedure Paint; override; + procedure DrawToCanvas(ACanvas: TCanvas); + end; + +var + vFPChessDrawer: TFPChessDrawer; + +implementation + +procedure TFPChessDrawer.EraseBackground(DC: HDC); +begin + // Uncomment this to enable default background erasing + //inherited EraseBackground(DC); +end; + +procedure TFPChessDrawer.Paint; +var + x, y: Integer; + Bitmap: TBitmap; +begin + Bitmap := TBitmap.Create; + try + // Initializes the Bitmap Size + Bitmap.Height := Height; + Bitmap.Width := Width; + + DrawToCanvas(Bitmap.Canvas); + + Canvas.Draw(0, 0, Bitmap); + finally + Bitmap.Free; + end; + + inherited Paint; +end; + +procedure TFPChessDrawer.DrawToCanvas(ACanvas: TCanvas); +begin + +end; + +end. + diff --git a/applications/fpchess/mainform.lfm b/applications/fpchess/mainform.lfm new file mode 100644 index 000000000..7b0f37da9 --- /dev/null +++ b/applications/fpchess/mainform.lfm @@ -0,0 +1,166 @@ +object Form1: TForm1 + Left = 181 + Height = 300 + Top = 209 + Width = 240 + Caption = 'FP Chess 0.1' + ClientHeight = 300 + ClientWidth = 240 + LCLVersion = '0.9.29' + object notebookMain: TUntabbedNotebook + Left = 0 + Height = 300 + Top = 0 + Width = 240 + PageIndex = 2 + Align = alClient + TabOrder = 0 + TabStop = True + object pageStart: TUNBPage + Left = 0 + Height = 300 + Top = 0 + Width = 240 + object Label1: TLabel + Left = 0 + Height = 32 + Top = 8 + Width = 240 + Alignment = taCenter + AutoSize = False + Caption = 'Welcome to FP Chess 0.1' + Font.Height = -19 + ParentColor = False + ParentFont = False + end + object Label2: TLabel + Left = 8 + Height = 30 + Top = 40 + Width = 224 + AutoSize = False + Caption = 'Please choose what kind of game you would like to play:' + ParentColor = False + WordWrap = True + end + object btnSinglePlayer: TBitBtn + Left = 8 + Height = 30 + Top = 112 + Width = 224 + Caption = 'Play Against the Computer' + OnClick = HandleMainScreenButton + TabOrder = 0 + end + object buttonDirectComm: TBitBtn + Left = 8 + Height = 30 + Top = 144 + Width = 226 + Caption = 'Play with a friend through a direct connection' + OnClick = buttonDirectCommClick + TabOrder = 1 + end + object BitBtn3: TBitBtn + Left = 8 + Height = 30 + Top = 264 + Width = 224 + Caption = 'Quit' + TabOrder = 2 + end + end + object pageConfigConnection: TUNBPage + Left = 0 + Height = 300 + Top = 0 + Width = 240 + object Label3: TLabel + Left = 0 + Height = 32 + Top = 8 + Width = 240 + Alignment = taCenter + AutoSize = False + Caption = 'Direct Connection' + Font.Height = -19 + ParentColor = False + ParentFont = False + end + object LabeledEdit1: TLabeledEdit + Left = 104 + Height = 21 + Top = 72 + Width = 120 + EditLabel.AnchorSideLeft.Control = LabeledEdit1 + EditLabel.AnchorSideTop.Control = LabeledEdit1 + EditLabel.AnchorSideTop.Side = asrCenter + EditLabel.AnchorSideRight.Control = LabeledEdit1 + EditLabel.AnchorSideBottom.Control = LabeledEdit1 + EditLabel.Left = 23 + EditLabel.Height = 14 + EditLabel.Top = 75 + EditLabel.Width = 78 + EditLabel.Caption = 'Your friend''s IP:' + EditLabel.ParentColor = False + LabelPosition = lpLeft + TabOrder = 0 + Text = 'LabeledEdit1' + end + object LabeledEdit2: TLabeledEdit + Left = 104 + Height = 21 + Top = 104 + Width = 120 + EditLabel.AnchorSideLeft.Control = LabeledEdit2 + EditLabel.AnchorSideTop.Control = LabeledEdit2 + EditLabel.AnchorSideTop.Side = asrCenter + EditLabel.AnchorSideRight.Control = LabeledEdit2 + EditLabel.AnchorSideBottom.Control = LabeledEdit2 + EditLabel.Left = 19 + EditLabel.Height = 14 + EditLabel.Top = 107 + EditLabel.Width = 82 + EditLabel.Caption = 'Your IP Address:' + EditLabel.ParentColor = False + LabelPosition = lpLeft + ReadOnly = True + TabOrder = 1 + Text = 'LabeledEdit2' + end + object BitBtn1: TBitBtn + Left = 16 + Height = 30 + Top = 144 + Width = 208 + Caption = 'BitBtn1' + TabOrder = 2 + end + end + object pageConnecting: TUNBPage + Left = 0 + Height = 300 + Top = 0 + Width = 240 + object Label4: TLabel + Left = 0 + Height = 32 + Top = 8 + Width = 240 + Alignment = taCenter + AutoSize = False + Caption = 'Connecting' + Font.Height = -19 + ParentColor = False + ParentFont = False + end + object ProgressBar1: TProgressBar + Left = 8 + Height = 20 + Top = 56 + Width = 100 + TabOrder = 0 + end + end + end +end diff --git a/applications/fpchess/mainform.pas b/applications/fpchess/mainform.pas new file mode 100644 index 000000000..d11c2de59 --- /dev/null +++ b/applications/fpchess/mainform.pas @@ -0,0 +1,62 @@ +unit mainform; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls, + ComCtrls, StdCtrls, Buttons; + +type + + { TForm1 } + + TForm1 = class(TForm) + BitBtn1: TBitBtn; + btnSinglePlayer: TBitBtn; + buttonDirectComm: TBitBtn; + BitBtn3: TBitBtn; + Label1: TLabel; + Label2: TLabel; + Label3: TLabel; + Label4: TLabel; + LabeledEdit1: TLabeledEdit; + LabeledEdit2: TLabeledEdit; + pageStart: TUNBPage; + pageConfigConnection: TUNBPage; + notebookMain: TUntabbedNotebook; + pageConnecting: TUNBPage; + ProgressBar1: TProgressBar; + procedure buttonDirectCommClick(Sender: TObject); + procedure HandleMainScreenButton(Sender: TObject); + private + { private declarations } + public + { public declarations } + end; + +var + Form1: TForm1; + +implementation + +{$R *.lfm} + +{ TForm1 } + +procedure TForm1.buttonDirectCommClick(Sender: TObject); +begin + notebookMain.PageIndex := 1; +end; + +procedure TForm1.HandleMainScreenButton(Sender: TObject); +begin + if Sender = btnSinglePlayer then + begin + notebookMain.PageIndex := 2; + end; +end; + +end. + diff --git a/applications/fpchess/skins/classic/base.png b/applications/fpchess/skins/classic/base.png new file mode 100644 index 000000000..ca816133b Binary files /dev/null and b/applications/fpchess/skins/classic/base.png differ