unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Menus, StdCtrls, ExtCtrls;
type
TForm1 =
class(TForm)
MainMenu1: TMainMenu;
Datei1: TMenuItem;
N1: TMenuItem;
Beenden1: TMenuItem;
Neu1: TMenuItem;
lblSpieler1: TLabel;
edtNameS1: TEdit;
lblSpieler2: TLabel;
edtNameS2: TEdit;
btnStart: TButton;
lblName1: TLabel;
lblName2: TLabel;
PBP1: TPaintBox;
PBP2: TPaintBox;
btnWortwahl: TButton;
GBBuchstaben: TGroupBox;
btnF: TButton;
btnE: TButton;
btnB: TButton;
btnG: TButton;
btnA: TButton;
btnC: TButton;
btnD: TButton;
btnM: TButton;
btnL: TButton;
btnK: TButton;
btnJ: TButton;
btnI: TButton;
btnH: TButton;
btnS: TButton;
btnR: TButton;
btnO: TButton;
btnT: TButton;
btnN: TButton;
btnP: TButton;
btnQ: TButton;
btnV: TButton;
btnW: TButton;
btnX: TButton;
btnY: TButton;
btnZ: TButton;
btnU: TButton;
procedure btnStartClick(Sender: TObject);
procedure Beenden1Click(Sender: TObject);
procedure Neu1Click(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
var S1, S2:
String;
var a, b: TPoint;
procedure TForm1.btnStartClick(Sender: TObject);
begin
S1 :=
String(edtNameS1.Text);
S2 :=
String(edtNameS2.Text);
if
(S1 = '
Name')
or (S2 = '
Name')
then
Application.MessageBox('
Bitte geben Sie einen Namen ein!!!','
Warnung!')
else
begin
PBP1.Visible := true;
PBP2.Visible := true;
edtNameS1.Visible := false;
edtNameS2.Visible := false;
lblSpieler1.Visible := false;
lblSpieler2.Visible := false;
btnStart.Visible := false;
GBBuchstaben.Visible := true;
lblName1.Visible := true;
lblName2.Visible := true;
lblName1.Caption :=
String(S1);
lblName2.Caption :=
String(S2);
lblName1.Alignment := taCenter;
lblName2.Alignment := taCenter;
lblName1.Width := 88;
lblName2.Width := 88;
btnWortwahl.Visible := true;
PBP1.Canvas.Rectangle (0,0,PBP1.height,PBP1.width);
with PBP1
do
begin
a.x := 5;
a.y := height-5;
b.x := width-5;
b.y := a.y;
canvas.moveto(a.x, a.y);
canvas.lineto(b.x, b.y);
end;
PBP2.Canvas.Rectangle (0,0,PBP2.height,PBP2.width);
with PBP2
do
begin
a.x := 5;
a.y := height-5;
b.x := width-5;
b.y := a.y;
canvas.moveto(a.x, a.y);
canvas.lineto(b.x, b.y);
end;
end;
end;
procedure TForm1.Beenden1Click(Sender: TObject);
begin
Form1.Close;
end;
procedure TForm1.Neu1Click(Sender: TObject);
begin
edtNameS1.Visible := true;
edtNameS2.Visible := true;
edtNameS1.Text := '
Name';
edtNameS2.Text := '
Name';
lblSpieler1.Visible := true;
lblSpieler2.Visible := true;
btnStart.Visible := true;
lblName1.Visible := false;
lblName2.Visible := false;
PBP1.Visible := false;
PBP2.Visible := false;
btnWortwahl.Visible := false;
end;
end.