Adds a new application to lazarusccr, fpchess

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@1321 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
sekelsenmat 2010-09-16 11:52:47 +00:00
parent 17fe855a78
commit c4882537eb
7 changed files with 722 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 134 KiB

View File

@ -0,0 +1,415 @@
<?xml version="1.0"?>
<CONFIG>
<ProjectOptions>
<Version Value="9"/>
<PathDelim Value="\"/>
<General>
<MainUnit Value="0"/>
<ResourceType Value="res"/>
<UseXPManifest Value="True"/>
<Icon Value="0"/>
<ActiveWindowIndexAtStart Value="0"/>
</General>
<i18n>
<EnableI18N LFM="False"/>
</i18n>
<VersionInfo>
<StringTable ProductVersion=""/>
</VersionInfo>
<PublishOptions>
<Version Value="2"/>
<IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
<ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/>
</PublishOptions>
<RunParams>
<local>
<FormatVersion Value="1"/>
</local>
</RunParams>
<RequiredPackages Count="1">
<Item1>
<PackageName Value="LCL"/>
</Item1>
</RequiredPackages>
<Units Count="23">
<Unit0>
<Filename Value="fpchess.lpr"/>
<IsPartOfProject Value="True"/>
<UnitName Value="fpchess"/>
<UsageCount Value="29"/>
</Unit0>
<Unit1>
<Filename Value="mainform.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="Form1"/>
<ResourceBaseClass Value="Form"/>
<UnitName Value="mainform"/>
<EditorIndex Value="0"/>
<WindowIndex Value="0"/>
<TopLine Value="15"/>
<CursorPos X="40" Y="19"/>
<UsageCount Value="29"/>
<Loaded Value="True"/>
<LoadedDesigner Value="True"/>
</Unit1>
<Unit2>
<Filename Value="..\..\..\lazarussvn\lcl\extctrls.pp"/>
<UnitName Value="ExtCtrls"/>
<EditorIndex Value="2"/>
<WindowIndex Value="0"/>
<TopLine Value="309"/>
<CursorPos X="15" Y="326"/>
<UsageCount Value="16"/>
<Loaded Value="True"/>
</Unit2>
<Unit3>
<Filename Value="..\..\..\lazarussvn\ideintf\componenteditors.pas"/>
<UnitName Value="ComponentEditors"/>
<EditorIndex Value="19"/>
<WindowIndex Value="0"/>
<TopLine Value="864"/>
<CursorPos X="15" Y="877"/>
<UsageCount Value="16"/>
<Loaded Value="True"/>
</Unit3>
<Unit4>
<Filename Value="..\..\..\lazarussvn\lcl\include\custompage.inc"/>
<EditorIndex Value="18"/>
<WindowIndex Value="0"/>
<TopLine Value="136"/>
<CursorPos X="1" Y="136"/>
<UsageCount Value="16"/>
<Loaded Value="True"/>
</Unit4>
<Unit5>
<Filename Value="..\..\..\lazarussvn\lcl\include\customnotebook.inc"/>
<EditorIndex Value="16"/>
<WindowIndex Value="0"/>
<TopLine Value="195"/>
<CursorPos X="21" Y="207"/>
<UsageCount Value="16"/>
<Loaded Value="True"/>
</Unit5>
<Unit6>
<Filename Value="..\..\..\lazarussvn\lcl\include\untabbednotebook.inc"/>
<EditorIndex Value="14"/>
<WindowIndex Value="0"/>
<TopLine Value="155"/>
<CursorPos X="36" Y="181"/>
<UsageCount Value="16"/>
<Loaded Value="True"/>
</Unit6>
<Unit7>
<Filename Value="..\..\..\lazarussvn\ideintf\propedits.pp"/>
<UnitName Value="PropEdits"/>
<EditorIndex Value="20"/>
<WindowIndex Value="0"/>
<TopLine Value="5323"/>
<CursorPos X="3" Y="5329"/>
<UsageCount Value="16"/>
<Loaded Value="True"/>
</Unit7>
<Unit8>
<Filename Value="..\..\..\lazarussvn\lcl\include\page.inc"/>
<EditorIndex Value="4"/>
<WindowIndex Value="0"/>
<TopLine Value="24"/>
<CursorPos X="26" Y="50"/>
<UsageCount Value="16"/>
<Loaded Value="True"/>
</Unit8>
<Unit9>
<Filename Value="..\..\..\lazarussvn\lcl\lconvencoding.pas"/>
<UnitName Value="LConvEncoding"/>
<EditorIndex Value="7"/>
<WindowIndex Value="0"/>
<TopLine Value="10"/>
<CursorPos X="19" Y="15"/>
<UsageCount Value="16"/>
<Loaded Value="True"/>
</Unit9>
<Unit10>
<Filename Value="F:\JIL\AndroidJuliana\Widget\PIM\addCalendarItem\auto_001.js"/>
<WindowIndex Value="0"/>
<TopLine Value="5"/>
<CursorPos X="41" Y="31"/>
<UsageCount Value="9"/>
<DefaultSyntaxHighlighter Value="JScript"/>
</Unit10>
<Unit11>
<Filename Value="..\..\..\lazarussvn\lcl\controls.pp"/>
<UnitName Value="Controls"/>
<EditorIndex Value="6"/>
<WindowIndex Value="0"/>
<TopLine Value="193"/>
<CursorPos X="3" Y="225"/>
<UsageCount Value="16"/>
<Loaded Value="True"/>
</Unit11>
<Unit12>
<Filename Value="..\..\..\lazarussvn\lcl\include\notebook.inc"/>
<EditorIndex Value="3"/>
<WindowIndex Value="0"/>
<TopLine Value="9"/>
<CursorPos X="3" Y="40"/>
<UsageCount Value="16"/>
<Loaded Value="True"/>
</Unit12>
<Unit13>
<Filename Value="..\..\..\lazarussvn\lcl\lcltype.pp"/>
<UnitName Value="LCLType"/>
<EditorIndex Value="17"/>
<WindowIndex Value="0"/>
<TopLine Value="2728"/>
<CursorPos X="3" Y="2700"/>
<UsageCount Value="16"/>
<Loaded Value="True"/>
</Unit13>
<Unit14>
<Filename Value="..\..\..\fpcsvn\rtl\arm\mathu.inc"/>
<EditorIndex Value="15"/>
<WindowIndex Value="0"/>
<TopLine Value="148"/>
<CursorPos X="15" Y="163"/>
<UsageCount Value="15"/>
<Loaded Value="True"/>
</Unit14>
<Unit15>
<Filename Value="..\..\..\lazarus29\fpc\2.4.3\source\rtl\objpas\classes\classesh.inc"/>
<EditorIndex Value="5"/>
<WindowIndex Value="0"/>
<TopLine Value="595"/>
<CursorPos X="27" Y="612"/>
<UsageCount Value="14"/>
<Loaded Value="True"/>
</Unit15>
<Unit16>
<Filename Value="fpchessdrawer.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="fpchessdrawer"/>
<EditorIndex Value="1"/>
<WindowIndex Value="0"/>
<TopLine Value="10"/>
<CursorPos X="16" Y="23"/>
<UsageCount Value="27"/>
<Loaded Value="True"/>
</Unit16>
<Unit17>
<Filename Value="..\..\..\lazarussvn\lcl\lconvasiapage.pas"/>
<UnitName Value="LConvAsiaPage"/>
<EditorIndex Value="13"/>
<WindowIndex Value="0"/>
<TopLine Value="2"/>
<CursorPos X="26" Y="18"/>
<UsageCount Value="13"/>
<Loaded Value="True"/>
</Unit17>
<Unit18>
<Filename Value="..\..\..\lazarussvn\lcl\include\asiancodepagefunctions.inc"/>
<EditorIndex Value="12"/>
<WindowIndex Value="0"/>
<TopLine Value="18"/>
<CursorPos X="1" Y="37"/>
<UsageCount Value="13"/>
<Loaded Value="True"/>
</Unit18>
<Unit19>
<Filename Value="..\..\..\lazarussvn\lcl\translations.pas"/>
<UnitName Value="Translations"/>
<EditorIndex Value="8"/>
<WindowIndex Value="0"/>
<TopLine Value="43"/>
<CursorPos X="24" Y="66"/>
<UsageCount Value="13"/>
<Loaded Value="True"/>
</Unit19>
<Unit20>
<Filename Value="..\..\..\fpcsvn\packages\fpvectorial\src\pdfvrsemantico.pas"/>
<UnitName Value="pdfvrsemantico"/>
<EditorIndex Value="9"/>
<WindowIndex Value="0"/>
<TopLine Value="210"/>
<CursorPos X="19" Y="230"/>
<UsageCount Value="13"/>
<Loaded Value="True"/>
</Unit20>
<Unit21>
<Filename Value="..\..\..\openssl-1.0.0a\crypto\pem\pem_pkey.c"/>
<EditorIndex Value="10"/>
<WindowIndex Value="0"/>
<TopLine Value="55"/>
<CursorPos X="1" Y="76"/>
<UsageCount Value="13"/>
<Loaded Value="True"/>
<DefaultSyntaxHighlighter Value="C++"/>
</Unit21>
<Unit22>
<Filename Value="..\..\..\fpcsvn\packages\openssl\src\openssl.pas"/>
<UnitName Value="OpenSSL"/>
<IsVisibleTab Value="True"/>
<EditorIndex Value="11"/>
<WindowIndex Value="0"/>
<TopLine Value="634"/>
<CursorPos X="20" Y="656"/>
<UsageCount Value="13"/>
<Loaded Value="True"/>
</Unit22>
</Units>
<JumpHistory Count="30" HistoryIndex="29">
<Position1>
<Filename Value="..\..\..\lazarussvn\lcl\include\untabbednotebook.inc"/>
<Caret Line="171" Column="61" TopLine="154"/>
</Position1>
<Position2>
<Filename Value="..\..\..\lazarussvn\lcl\include\untabbednotebook.inc"/>
<Caret Line="186" Column="4" TopLine="154"/>
</Position2>
<Position3>
<Filename Value="..\..\..\lazarussvn\lcl\include\untabbednotebook.inc"/>
<Caret Line="171" Column="33" TopLine="154"/>
</Position3>
<Position4>
<Filename Value="..\..\..\lazarussvn\lcl\controls.pp"/>
<Caret Line="1386" Column="33" TopLine="1369"/>
</Position4>
<Position5>
<Filename Value="..\..\..\lazarussvn\lcl\lconvencoding.pas"/>
<Caret Line="19" Column="2" TopLine="2"/>
</Position5>
<Position6>
<Filename Value="..\..\..\lazarussvn\lcl\include\untabbednotebook.inc"/>
<Caret Line="171" Column="68" TopLine="154"/>
</Position6>
<Position7>
<Filename Value="..\..\..\fpcsvn\rtl\arm\mathu.inc"/>
<Caret Line="1" Column="1" TopLine="1"/>
</Position7>
<Position8>
<Filename Value="..\..\..\fpcsvn\rtl\arm\mathu.inc"/>
<Caret Line="36" Column="26" TopLine="19"/>
</Position8>
<Position9>
<Filename Value="..\..\..\lazarussvn\lcl\include\untabbednotebook.inc"/>
<Caret Line="171" Column="68" TopLine="154"/>
</Position9>
<Position10>
<Filename Value="..\..\..\lazarussvn\lcl\include\page.inc"/>
<Caret Line="36" Column="12" TopLine="7"/>
</Position10>
<Position11>
<Filename Value="..\..\..\lazarussvn\lcl\include\page.inc"/>
<Caret Line="38" Column="28" TopLine="24"/>
</Position11>
<Position12>
<Filename Value="mainform.pas"/>
<Caret Line="9" Column="10" TopLine="1"/>
</Position12>
<Position13>
<Filename Value="mainform.pas"/>
<Caret Line="19" Column="40" TopLine="15"/>
</Position13>
<Position14>
<Filename Value="..\..\..\lazarussvn\lcl\lconvencoding.pas"/>
<Caret Line="6181" Column="32" TopLine="6170"/>
</Position14>
<Position15>
<Filename Value="..\..\..\lazarussvn\lcl\lconvencoding.pas"/>
<Caret Line="1" Column="1" TopLine="1"/>
</Position15>
<Position16>
<Filename Value="..\..\..\lazarussvn\lcl\lconvencoding.pas"/>
<Caret Line="6" Column="51" TopLine="1"/>
</Position16>
<Position17>
<Filename Value="..\..\..\lazarussvn\lcl\lconvencoding.pas"/>
<Caret Line="5853" Column="29" TopLine="5836"/>
</Position17>
<Position18>
<Filename Value="..\..\..\lazarussvn\lcl\lconvencoding.pas"/>
<Caret Line="101" Column="44" TopLine="95"/>
</Position18>
<Position19>
<Filename Value="..\..\..\lazarussvn\lcl\lconvencoding.pas"/>
<Caret Line="104" Column="32" TopLine="94"/>
</Position19>
<Position20>
<Filename Value="..\..\..\lazarussvn\lcl\lconvencoding.pas"/>
<Caret Line="6188" Column="28" TopLine="6170"/>
</Position20>
<Position21>
<Filename Value="..\..\..\lazarussvn\lcl\lconvencoding.pas"/>
<Caret Line="133" Column="20" TopLine="116"/>
</Position21>
<Position22>
<Filename Value="fpchessdrawer.pas"/>
<Caret Line="18" Column="34" TopLine="4"/>
</Position22>
<Position23>
<Filename Value="..\..\..\lazarussvn\lcl\lconvasiapage.pas"/>
<Caret Line="240" Column="1" TopLine="207"/>
</Position23>
<Position24>
<Filename Value="..\..\..\lazarussvn\lcl\lconvencoding.pas"/>
<Caret Line="114" Column="38" TopLine="108"/>
</Position24>
<Position25>
<Filename Value="..\..\..\lazarussvn\lcl\lconvencoding.pas"/>
<Caret Line="1" Column="1" TopLine="1"/>
</Position25>
<Position26>
<Filename Value="..\..\..\lazarussvn\lcl\include\asiancodepagefunctions.inc"/>
<Caret Line="34" Column="3" TopLine="23"/>
</Position26>
<Position27>
<Filename Value="..\..\..\lazarussvn\lcl\translations.pas"/>
<Caret Line="1" Column="1" TopLine="1"/>
</Position27>
<Position28>
<Filename Value="..\..\..\fpcsvn\packages\fpvectorial\src\pdfvrsemantico.pas"/>
<Caret Line="48" Column="1" TopLine="27"/>
</Position28>
<Position29>
<Filename Value="..\..\..\openssl-1.0.0a\crypto\pem\pem_pkey.c"/>
<Caret Line="1" Column="1" TopLine="1"/>
</Position29>
<Position30>
<Filename Value="..\..\..\fpcsvn\packages\openssl\src\openssl.pas"/>
<Caret Line="1" Column="1" TopLine="1"/>
</Position30>
</JumpHistory>
</ProjectOptions>
<CompilerOptions>
<Version Value="9"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="fpchess"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)\"/>
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
</SearchPaths>
<Linking>
<Options>
<Win32>
<GraphicApplication Value="True"/>
</Win32>
</Options>
</Linking>
<Other>
<CompilerPath Value="$(CompPath)"/>
</Other>
</CompilerOptions>
<Debugging>
<Exceptions Count="3">
<Item1>
<Name Value="EAbort"/>
</Item1>
<Item2>
<Name Value="ECodetoolError"/>
</Item2>
<Item3>
<Name Value="EFOpenError"/>
</Item3>
</Exceptions>
</Debugging>
</CONFIG>

View File

@ -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.

View File

@ -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.

View File

@ -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

View File

@ -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.

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB