unit Pfeil;
interface
uses
SysUtils, Classes, Controls, ExtCtrls, Graphics, Dialogs,Forms ;
type
TPfeil =
class(TPaintBox)
private
{ Private-Deklarationen }
FZiffer : Integer;
FZifferRandX : Integer;
FZifferRandY : Integer;
FZifferLueckeX : Integer;
FZifferLueckeY : Integer;
FZifferHFarbe : TColor;
//Hintergrundfarbe
FZifferRFarbe : TColor;
//Randfarbe
FZifferQuadRand: Integer;
//Randbreite
FWidthX : integer;
procedure SetZiffer(Value : Integer);
procedure SetZifferRandX(Value : Integer);
procedure SetZifferRandY(Value : Integer);
procedure SetZifferLueckeX(Value : Integer);
procedure SetZifferLueckeY(Value : Integer);
procedure SetZifferHFarbe(Value : TColor);
procedure SetZifferRFarbe(Value : TColor);
procedure SetZifferQuadRand(Value : Integer);
procedure Resize;
override;
//Komponente wird zur Designerzeit verändert
function MalZiffer : boolean;
function MalQuadraht(x,y,w:integer;RFarbe,HFarbe:TColor):boolean;
function ZifferAnz : boolean;
protected
{ Protected-Deklarationen = Im Modul und alle abgeleiteten Klassen}
public
{ Public-Deklarationen = zur Laufzeit}
constructor Create(AOwner : TComponent);
override;
published
{ Published-Deklarationen = Im Objektinspector sichtbar, Designmodus }
property Ziffer: Integer
read FZiffer
write SetZiffer;
property ZifferRandX : Integer
read FZifferRandX
write SetZifferRandX;
property ZifferRandY : Integer
read FZifferRandY
write SetZifferRandY;
property ZifferLueckeX : Integer
read FZifferLueckeX
write SetZifferLueckeX;
property ZifferLueckeY : Integer
read FZifferLueckeY
write SetZifferLueckeY;
property ZifferHFarbe : TColor
read FZifferHFarbe
write SetZifferHFarbe;
property ZifferRFarbe : TColor
read FZifferRFarbe
write SetZifferRFarbe;
property ZifferQuadRand : Integer
read FZifferQuadRand
write SetZifferQuadRand;
end;
procedure Register;
implementation
procedure Register;
begin
RegisterComponents('
Ed', [TPfeil]);
end;
//---------------------------------------------------------------------
constructor TPfeil.Create(AOwner : TComponent);
var i : integer;
begin
inherited;
FZifferRandX := 1;
FZifferRandY := 1;
FZifferLueckeX := 2;
FZifferLueckeY := 2;
FZifferHFarbe := clYellow;
FZifferRFarbe := clRed;
MalZiffer;
end;
//---------------------------------------------------------------------
procedure TPfeil.SetZiffer(Value: Integer);
begin
FZiffer := Value;
MalZiffer;
//Funktion Ziffer malen
ZifferAnz;
//Ziffer Anzeigen
end;
//---------------------------------------------------------------------
procedure TPfeil.SetZifferRandX(Value: Integer);
begin
if Value <> FZifferRandX
then begin
FZifferRandX := Value;
MalZiffer;
//Funktion Ziffer malen
end;
end;
//---------------------------------------------------------------------
procedure TPfeil.SetZifferRandY(Value: Integer);
begin
if Value <> FZifferRandY
then begin
FZifferRandY := Value;
MalZiffer;
//Funktion Ziffer malen
end;
end;
//---------------------------------------------------------------------
procedure TPfeil.SetZifferLueckeX(Value: Integer);
begin
if Value <> FZifferLueckeX
then begin
FZifferLueckeX := Value;
MalZiffer;
//Funktion Ziffer malen
end;
end;
//---------------------------------------------------------------------
procedure TPfeil.SetZifferLueckeY(Value: Integer);
begin
if Value <> FZifferLueckeY
then begin
FZifferLueckeY := Value;
MalZiffer;
//Funktion Ziffer malen
end;
end;
//---------------------------------------------------------------------
procedure TPfeil.SetZifferHFarbe(Value: TColor);
begin
if Value <> FZifferHFarbe
then begin
FZifferHFarbe := Value;
MalZiffer;
//Funktion Ziffer malen
end;
end;
//---------------------------------------------------------------------
procedure TPfeil.SetZifferRFarbe(Value: TColor);
begin
if Value <> FZifferRFarbe
then begin
FZifferRFarbe := Value;
MalZiffer;
//Funktion Ziffer malen
end;
end;
//---------------------------------------------------------------------
procedure TPfeil.SetZifferQuadRand(Value: Integer);
begin
if Value <> FZifferQuadRand
then begin
FZifferQuadRand := Value;
MalZiffer;
//Funktion Ziffer malen
end;
end;
//---------------------------------------------------------------------
function TPfeil.MalZiffer : boolean;
var i : integer;
BreiteQuad,HoeheQuad : integer;
begin
self.canvas.MoveTo(0,0);
self.canvas.LineTo(1,1);
end;
//---------------------------------------------------------------------
function TPfeil.MalQuadraht(x,y,w:integer;RFarbe,HFarbe:TColor): boolean;
{ x,y=Koordinaten, w=Penbreite, R+HFarbe=Rand+Hintergrundfarbe }
begin
{ Quad := TShape.Create(Self);
Quad.Parent := Self;
Quad.Left := 10;
Quad.Top := 10;
Quad.Width := 30;
Quad.Height := 30; }
end;
//---------------------------------------------------------------------
procedure TPfeil.Resize;
begin
inherited;
MalZiffer;
end;
function TPfeil.ZifferAnz: boolean;
begin
//
end;
end.