unit umain;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls, Buttons;
type
TForm1 =
class(TForm)
Panel1: TPanel;
Panel2: TPanel;
BitBtn_stift: TBitBtn;
BitBtn_strich: TBitBtn;
BitBtn_viereck: TBitBtn;
BitBtn_ellipse: TBitBtn;
BitBtn_schwarz: TBitBtn;
BitBtn_weiss: TBitBtn;
BitBtn_rot: TBitBtn;
BitBtn_gruen: TBitBtn;
BitBtn_blau: TBitBtn;
BitBtn_gelb: TBitBtn;
BitBtn_violett: TBitBtn;
Image1: TImage;
procedure FormCreate (Sender: TObject);
procedure BitBtn_stiftClick(Sender: TObject);
procedure BitBtn_strichClick(Sender: TObject);
procedure BitBtn_viereckClick(Sender: TObject);
procedure BitBtn_ellipseClick(Sender: TObject);
procedure FormMouseDown (Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X,Y: Integer);
procedure FormMouseUp (Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X,Y: Integer);
procedure FormMouseMove (Sender: TObject; Shift: TShiftState;
X,Y: Integer);
procedure Merkwuerdig (Sender: TObject);
private
{ Private-Deklarationen }
MausGedrueckt: Boolean;
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
image1.canvas
end;
procedure TForm1.BitBtn_stiftClick(Sender: TObject);
begin
BitBtn_stift.Enabled := False;
BitBtn_strich.Enabled := True;
BitBtn_viereck.Enabled := True;
BitBtn_ellipse.Enabled := True;
end;
procedure TForm1.BitBtn_strichClick(Sender: TObject);
begin
BitBtn_stift.Enabled := True;
BitBtn_strich.Enabled := False;
BitBtn_viereck.Enabled := True;
BitBtn_ellipse.Enabled := True;
end;
procedure TForm1.BitBtn_viereckClick(Sender: TObject);
begin
BitBtn_stift.Enabled := True;
BitBtn_strich.Enabled := True;
BitBtn_viereck.Enabled := False;
BitBtn_ellipse.Enabled := True;
end;
procedure TForm1.BitBtn_ellipseClick(Sender: TObject);
begin
BitBtn_stift.Enabled := True;
BitBtn_strich.Enabled := True;
BitBtn_viereck.Enabled := True;
BitBtn_ellipse.Enabled := False;
end;
procedure TForm1.FormMouseDown (Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X,Y: Integer);
begin
MausGedrueckt := True;
Canvas.MoveTo (X,Y) ;
end;
procedure TForm1.FormMouseMove (Sender: TObject; Shift: TShiftState;
X,Y: Integer);
begin
if MausGedrueckt
then Canvas.LineTo (X,Y)
end;
procedure TForm1.FormMouseUp (Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X,Y: Integer);
begin
MausGedrueckt := False
end;
procedure TForm1.Merkwuerdig;
var I: Boolean;
begin
for I := False
to True
do
Form1.Left := Form1.Left+50;
end;
end.