source: trunk/UControls.pas

Last change on this file was 1, checked in by chronos, 3 years ago
  • Added: "Clovece nezlob se" game with adjustable board for different player count.
File size: 775 bytes
Line 
1unit UControls;
2
3{$mode delphi}
4
5interface
6
7uses
8 Classes, SysUtils, UGraphics;
9
10type
11
12 { TControl }
13
14 TControl = class
15 Canvas: TCanvas;
16 Position: TPoint;
17 Size: TPoint;
18 Text: string;
19 procedure Paint; virtual;
20 constructor Create;
21 destructor Destroy; override;
22 end;
23
24 { TButton }
25
26 TButton = class(TControl)
27 procedure Paint; override;
28 end;
29
30implementation
31
32{ TButton }
33
34procedure TButton.Paint;
35begin
36 with Canvas do begin
37 Rectangle(Rect(0, 0, Size.Width, Size.Height));
38 TextOut(Point(Position.X, Position.Y), Text);
39 end;
40end;
41
42{ TControl }
43
44procedure TControl.Paint;
45begin
46
47end;
48
49constructor TControl.Create;
50begin
51 Canvas := TCanvas.Create;
52end;
53
54destructor TControl.Destroy;
55begin
56 Canvas.Free;
57 inherited;
58end;
59
60end.
61
Note: See TracBrowser for help on using the repository browser.