Subversion Repositories svnkaklik

Rev

Go to most recent revision | Details | Last modification | View Log

Rev Author Line No. Line
6 kaklik 1
unit Unit1;
2
 
3
interface
4
 
5
uses
6
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
7
  Dialogs, StdCtrls, ExtCtrls, ToolWin, ComCtrls;
8
 
9
type
10
  TForm1 = class(TForm)
11
    PaintBox1: TPaintBox;
12
    Button1: TButton;
13
    Button2: TButton;
14
    ScrollBar1: TScrollBar;
15
    procedure Button1Click(Sender: TObject);
16
    procedure Button2Click(Sender: TObject);
17
    procedure ScrollBar1Change(Sender: TObject);
18
 
19
  private
20
    { Private declarations }
21
  public
22
    { Public declarations }
23
  end;
24
 
25
var
26
  Form1: TForm1;
27
 
28
implementation
29
 
30
{$R *.dfm}
31
 
32
procedure TForm1.Button1Click(Sender: TObject);
33
begin
34
    with PaintBox1 do begin
35
    Canvas.Brush.Color := clRed;
36
    Canvas.Brush.Style := bsDiagCross;
37
    Canvas.Ellipse(0, 0, PaintBox1.Width, PaintBox1.Height);
38
  end;
39
end;
40
 
41
procedure TForm1.Button2Click(Sender: TObject);
42
var Y: Integer;
43
 
44
begin
45
 
46
  { first call FillRect to paint the surface of the form.
47
  this removes any previously drawn lines (and anything else!)
48
  PaintBox1.Canvas.FillRect(ClientRect);}
49
 
50
  PaintBox1.Canvas.MoveTo(0, 0);
51
  PaintBox1.Canvas.LineTo(PaintBox1.Width,PaintBox1.Height);
52
 
53
 
54
end;
55
 
56
procedure TForm1.ScrollBar1Change(Sender: TObject);
57
begin
58
  PaintBox1.Canvas.MoveTo(0,ScrollBar1.Position);
59
  PaintBox1.Canvas.LineTo(256,ScrollBar1.Position);
60
end;
61
 
62
end.