unit JLS;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ExtCtrls, StdCtrls ;
type
TForm1 =
class(TForm)
Button1: TButton;
Button2: TButton;
Button3: TButton;
Edit1: TEdit;
Image1: TImage;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
Function Ticker(Befehl:
String) :Boolean;
Function Jalousiefahrt(Befehl:
String):Boolean;
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
TLammelle =
packed Record
Active : Boolean;
Stellwert: Byte;
LammelleZahl:Byte;
end;
var
Form1: TForm1;
Rect:TRect;
implementation
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
var h,j,I:Integer;
begin
h:=54;
I:=StrToInt(Edit1.Text);
if I>=10
then I:=9;
Image1.Canvas.Brush.Style:=bsSolid;
Image1.Canvas.Brush.Color:=clBlack;
Image1.Canvas.Rectangle(32,64,150,164);
for j:=1
to 10
do
begin
h:=h+10;
Image1.Canvas.Brush.Style:=bsSolid;
Image1.Canvas.Brush.Color:=clBlack;
Image1.Canvas.Rectangle(32,h,150,h+I);
end;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
Jalousiefahrt('
Fahr');
end;
Function TForm1.Jalousiefahrt(Befehl:
String):Boolean;
var h,j,I:Integer;
begin
h:=54;
I:=9;
Image1.Canvas.Brush.Style:=bsSolid;
Image1.Canvas.Brush.Color:=clBlack;
Image1.Canvas.Rectangle(32,64,150,164);
for j:=1
to 10
do
begin
h:=h+10;
Image1.Canvas.Brush.Style:=bsSolid;
Image1.Canvas.Brush.Color:=clBlack;
Image1.Canvas.Rectangle(32,h,150,h+I);
if Befehl ='
Stop'
then break;
end;
end;
procedure TForm1.Button3Click(Sender: TObject);
begin
Ticker('
Stop');
Jalousiefahrt('
Stop');
end;
{Function DrawLamelle(x1,y1,x2,y2:Integer):Boolean;
begin
Image1.Canvas.Rectangle(x1,y1,x2,y2);
end; }
Function TForm1.Ticker(Befehl:
String):Boolean;
var i:Integer;
begin
if Befehl<>'
Stop'
then
for i:=0
to 2
do
begin
Sleep(100);
Application.ProcessMessages;
Result:=True;
end
else
Result:=False
end;
end.