source: branches/delphi/Forms/UFormPlayer.pas

Last change on this file was 44, checked in by chronos, 10 years ago
  • Added: Test Delphi conversion.
File size: 924 bytes
Line 
1unit UFormPlayer;
2
3interface
4
5uses
6 Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, ExtCtrls,
7 UGame;
8
9type
10
11 { TFormPlayer }
12
13 TFormPlayer = class(TForm)
14 ButtonCancel: TButton;
15 ButtonOk: TButton;
16 ColorBox1: TColorBox;
17 ComboBox1: TComboBox;
18 EditName: TEdit;
19 Label1: TLabel;
20 Label2: TLabel;
21 Label3: TLabel;
22 private
23 { private declarations }
24 public
25 procedure Load(Player: TPlayer);
26 procedure Save(Player: TPlayer);
27 end;
28
29var
30 FormPlayer: TFormPlayer;
31
32implementation
33
34{$R *.dfm}
35
36{ TFormPlayer }
37
38procedure TFormPlayer.Load(Player: TPlayer);
39begin
40 EditName.Text := Player.Name;
41 ComboBox1.ItemIndex := Integer(Player.Mode);
42 ColorBox1.Selected := Player.Color;
43end;
44
45procedure TFormPlayer.Save(Player: TPlayer);
46begin
47 Player.Name := EditName.Text;
48 Player.Mode := TPlayerMode(ComboBox1.ItemIndex);
49 Player.Color := ColorBox1.Selected;
50end;
51
52end.
53
Note: See TracBrowser for help on using the repository browser.