unit jg;

interface

uses
{$IFDEF MSWINDOWS}
  windows, messages,
{$ENDIF}
  SysUtils, Types, Classes, QGraphics, QControls, QForms, QDialogs,
  QStdCtrls, QExtCtrls;

type
  Tfinmanche = class(TForm)
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    Label5: TLabel;
    GroupBox1: TGroupBox;
    Image1: TImage;
    Image4: TImage;
    Image2: TImage;
    Image3: TImage;
    Button1: TButton;
    ListBox1: TListBox;
    procedure Button1Click(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure FormCreate(Sender: TObject);
    procedure FormShow(Sender: TObject);
  private
    { Private declarations }
  public
    procedure affTalon;
    { Public declarations }
  end;

var
  finmanche: Tfinmanche;

implementation

uses Unit1;

{$R *.xfm}

procedure Tfinmanche.Button1Click(Sender: TObject);
begin
  finmanche.Close;
end;

procedure Tfinmanche.affTalon();
begin
  if principale.linux then
  begin
    principale.ImageList1.GetBitmap(StrToInT(ListBox1.Items.Strings[0])-1,Image1.Picture.Bitmap);
    principale.ImageList1.GetBitmap(StrToInT(ListBox1.Items.Strings[1])-1,Image2.Picture.Bitmap);
    principale.ImageList1.GetBitmap(StrToInT(ListBox1.Items.Strings[2])-1,Image3.Picture.Bitmap);
    principale.ImageList1.GetBitmap(StrToInT(ListBox1.Items.Strings[3])-1,Image4.Picture.Bitmap);
  end else begin
    principale.ImageList1.Draw(Image1.canvas,0,0,StrToInT(ListBox1.Items.Strings[0])-1);
    principale.ImageList1.Draw(Image2.canvas,0,0,StrToInT(ListBox1.Items.Strings[1])-1);
    principale.ImageList1.Draw(Image3.canvas,0,0,StrToInT(ListBox1.Items.Strings[2])-1);
    principale.ImageList1.Draw(Image4.canvas,0,0,StrToInT(ListBox1.Items.Strings[3])-1);
  end;
  Image1.refresh;
  Image2.refresh;
  Image3.refresh;
  Image4.refresh;
end;


procedure Tfinmanche.FormClose(Sender: TObject; var Action: TCloseAction);
  var i :integer;
begin
  principale.Sauvegarderunepartie1.Enabled:=True;
  principale.Button6.Enabled:=True;
  principale.Button2.Enabled:=true;
  principale.Image13.Canvas.Brush.Color:=clgreen;
  principale.Image13.Canvas.Rectangle(0,0,200,200);
  principale.Image13.Refresh;
  principale.Button4.Enabled:=false;
  principale.Button5.Enabled:=false;
  principale.Button4.Caption:=' ';
  for i:=1 to 12 do tab_image[i].Enabled:=false;
  principale.TestCarteprend;
  principale.AfficheTresor;
  principale.TestFin;
  Principale.Panel1.Enabled:=True;
  Principale.Fichier.Enabled:=True;
  Action :=caFree;
end;

procedure Tfinmanche.FormCreate(Sender: TObject);
begin
  Left := (Screen.Width - Width) div 2;
  Top  := (Screen.Height - Height) div 2;
  Principale.Panel1.Enabled:=False;
  Principale.Fichier.Enabled:=false;
end;


procedure Tfinmanche.FormShow(Sender: TObject);
begin
  Finmanche.PixelsPerInch:=Principale.PixelsPerInch;
  with Label1 do
  begin
    Left := 8;
    Top := 8;
    Width := FinManche.Width-10;
    Height := 20;
    AutoSize := false;
  end;
  with Label2 do
  begin
    Left := 8;
    Top := 200;
    Width := FinManche.Width-10;
    Height := 18;
    AutoSize := false;
  end;
  with Label3 do
  begin
    Left := 8;
    Top := 216;
    Width := FinManche.Width-10;
    Height := 18;
    AutoSize := false;
  end;
  with Label4 do
  begin
    Left := 8;
    Top := 232;
    Width := FinManche.Width-10;
    Height := 18;
    AutoSize := false;
  end;
  with Label5 do
  begin
    Left := 112;
    Top := 288;
    Width := 441;
    Height := 20;
    AutoSize := false;
  end;
  with GroupBox1 do
  begin
    Left := 8;
    Top := 40;
    Width := 329;
    Height := 137;
  end;
  with Image1 do
  begin
    Left := 9;
    Top := 21;
    Width := 72;
    Height := 108;
    transparent := true;
    AutoSize := false;
  end;
  with Image4 do
  begin
    Left := 89;
    Top := 21;
    Width := 72;
    Height := 108;
    AutoSize := false;
  end;
  with Image2 do
  begin
    Left := 169;
    Top := 21;
    Width := 72;
    Height := 108;
    AutoSize := false;
  end;
  with Image3 do
  begin
    Left := 249;
    Top := 21;
    Width := 72;
    Height := 108;
    AutoSize := false;
  end;
  with Button1 do
  begin
    Left := 432;
    Top := 320;
    Width := 81;
    Height := 25;
  end;
  with ListBox1 do
  begin
    Left := 384;
    Top := 88;
    Width := 145;
    Height := 105;
  end;
  AffTalon;
end;


end.
