Odpowiedzi

2009-09-28T19:26:03+02:00
Kółko krzyżyk :)

unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Buttons, StdCtrls, ExtCtrls, MPlayer, ComCtrls;

type
TForm1 = class(TForm)
sb1: TSpeedButton;
sb2: TSpeedButton;
sb3: TSpeedButton;
sb4: TSpeedButton;
sb5: TSpeedButton;
sb6: TSpeedButton;
sb7: TSpeedButton;
sb8: TSpeedButton;
sb9: TSpeedButton;
sbGracz1: TSpeedButton;
sbGracz2: TSpeedButton;
pClose: TButton;
ptAbout: TLabel;
pNewtur: TButton;
MediaPlayer1: TMediaPlayer;
chbMuzyka: TCheckBox;
ptGracz1: TEdit;
ptGracz2: TEdit;
Label1: TLabel;
Label2: TLabel;
StatusBar1: TStatusBar;
procedure sb1Click(Sender: TObject);
procedure sb2Click(Sender: TObject);
procedure sb3Click(Sender: TObject);
procedure sb4Click(Sender: TObject);
procedure sb5Click(Sender: TObject);
procedure sb6Click(Sender: TObject);
procedure sb7Click(Sender: TObject);
procedure sb8Click(Sender: TObject);
procedure sb9Click(Sender: TObject);
procedure sb1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure pCloseClick(Sender: TObject);
procedure ptAboutClick(Sender: TObject);
procedure pNewturClick(Sender: TObject);
procedure chbMuzykaClick(Sender: TObject);
procedure pImionaClick(Sender: TObject);
procedure ptGracz1Change(Sender: TObject);
procedure ptGracz2Change(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

uses Unit2, Unit3;

{$R *.dfm}

procedure TForm1.sb1Click(Sender: TObject);
var
rys1:TBitmap;
rys2:TBitmap;
begin
rys1 := TBitmap.Create;
rys1.LoadFromFile('picture\X.bmp');
rys2 := Tbitmap.Create;
rys2.LoadFromfile('picture\O.bmp');
if sbGracz1.Down then
sb1.Glyph :=rys1;
if sbGracz2.Down then
sb1.Glyph :=rys2;
end;

procedure TForm1.sb2Click(Sender: TObject);
var
rys1 :TBitmap;
rys2 :TBitmap;
begin
rys1 := TBitmap.Create;
rys1.LoadFromFile('picture\X.bmp');
rys2 := Tbitmap.Create;
rys2.LoadFromfile('picture\O.bmp');
if sbGracz1.Down then
sb2.Glyph :=rys1;
if sbGracz2.Down then
sb2.Glyph :=rys2
end;

procedure TForm1.sb3Click(Sender: TObject);
var
rys1 :TBitmap;
rys2 :TBitmap;
begin
rys1 := TBitmap.Create;
rys1.LoadFromFile('picture\X.bmp');
rys2 := Tbitmap.Create;
rys2.LoadFromfile('picture\O.bmp');
if sbGracz1.Down then
sb3.Glyph :=rys1;
if sbGracz2.Down then
sb3.Glyph :=rys2
end;

procedure TForm1.sb4Click(Sender: TObject);
var
rys1 :TBitmap;
rys2 :TBitmap;
begin
rys1 := TBitmap.Create;
rys1.LoadFromFile('picture\X.bmp');
rys2 := Tbitmap.Create;
rys2.LoadFromfile('picture\O.bmp');
if sbGracz1.Down then
sb4.Glyph :=rys1;
if sbGracz2.Down then
sb4.Glyph :=rys2
end;

procedure TForm1.sb5Click(Sender: TObject);
var
rys1 :TBitmap;
rys2 :TBitmap;
begin
rys1 := TBitmap.Create;
rys1.LoadFromFile('picture\X.bmp');
rys2 := Tbitmap.Create;
rys2.LoadFromfile('picture\O.bmp');
if sbGracz1.Down then
sb5.Glyph :=rys1;
if sbGracz2.Down then
sb5.Glyph :=rys2
end;

procedure TForm1.sb6Click(Sender: TObject);
var
rys1 :TBitmap;
rys2 :TBitmap;
begin
rys1 := TBitmap.Create;
rys1.LoadFromFile('picture\X.bmp');
rys2 := Tbitmap.Create;
rys2.LoadFromfile('picture\O.bmp');
if sbGracz1.Down then
sb6.Glyph :=rys1;
if sbGracz2.Down then
sb6.Glyph :=rys2
end;

procedure TForm1.sb7Click(Sender: TObject);
var
rys1 :TBitmap;
rys2 :TBitmap;
begin
rys1 := TBitmap.Create;
rys1.LoadFromFile('picture\X.bmp');
rys2 := Tbitmap.Create;
rys2.LoadFromfile('picture\O.bmp');
if sbGracz1.Down then
sb7.Glyph :=rys1;
if sbGracz2.Down then
sb7.Glyph :=rys2
end;

procedure TForm1.sb8Click(Sender: TObject);
var
rys1 :TBitmap;
rys2 :TBitmap;
begin
rys1 := TBitmap.Create;
rys1.LoadFromFile('picture\X.bmp');
rys2 := Tbitmap.Create;
rys2.LoadFromfile('picture\O.bmp');
if sbGracz1.Down then
sb8.Glyph :=rys1;
if sbGracz2.Down then
sb8.Glyph :=rys2
end;

procedure TForm1.sb9Click(Sender: TObject);
var
rys1 :TBitmap;
rys2 :TBitmap;
begin
rys1 := TBitmap.Create;
rys1.LoadFromFile('picture\X.bmp');
rys2 := Tbitmap.Create;
rys2.LoadFromfile('picture\O.bmp');
if sbGracz1.Down then
sb9.Glyph :=rys1;
if sbGracz2.Down then
sb9.Glyph :=rys2
end;


procedure TForm1.sb1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
if sbGracz1.down = true then begin
sbGracz2.Down := true;
end else
sbGracz1.Down := true;
end;

procedure TForm1.pCloseClick(Sender: TObject);
begin
close;
end;

procedure TForm1.ptAboutClick(Sender: TObject);
begin
Autor.showmodal;{powoduje wyswietlenie okna about okno anout musi byc form}
end;

procedure TForm1.pNewturClick(Sender: TObject);
var
rys : TBitmap;
begin
rys := TBitmap.create;
rys.LoadFromFile('picture\v.bmp');
sb1.glyph := rys;
sb2.glyph := rys;
sb3.glyph := rys;
sb4.glyph := rys;
sb5.glyph := rys;
sb6.glyph := rys;
sb7.glyph := rys;
sb8.glyph := rys;
sb9.glyph := rys;
end;

procedure TForm1.chbMuzykaClick(Sender: TObject);
begin
if chbMuzyka.Checked=true then begin
MediaPlayer1.filename :='files\Muza.mid';
MediaPlayer1.open;
MediaPlayer1.play;
end else
MediaPlayer1.stop;
end;

procedure TForm1.pImionaClick(Sender: TObject);
begin
sbGracz1.Caption := ptGracz1.text;
sbGracz2.Caption := ptGracz2.text;
end;

procedure TForm1.ptGracz1Change(Sender: TObject);
begin
sbGracz1.Caption := ptGracz1.Text;
end;

procedure TForm1.ptGracz2Change(Sender: TObject);
begin
sbGracz2.Caption := ptGracz2.Text;
end;

end.

Brakuje tylko procedury wyświetlania wygranego, ale to powinieneś sobie sam dać radę napisać :)
1 5 1