Registriert seit: 19. Sep 2013
Ort: Braunschweig
204 Beiträge
Delphi 6 Professional
|
AW: Komponentenentwicklung LED über TShape ?
27. Sep 2013, 10:50
Ich wollte mal meine Komponente Testen, jedoch wird nix dsrgestellt
Delphi-Quellcode:
unit LedUnit;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls;
type
TLED = class(TGraphicControl)
//HoyLed: TShape;
private
{ Private declarations }
FActive: Boolean;
procedure SetActive( const Value: Boolean);
protected
{ Protected declarations }
public
{ Public declarations }
published
{ Published declarations }
property Active: Boolean read FActive write SetActive;
end;
var
LED: TLED;
Shape : TShape;
Brush: TShape;
Color: TColor;
ShowHint: Boolean;
implementation
{$R *.dfm}
procedure TLED.SetActive( const Value: Boolean);
begin
if Active <> FActive then
begin
FActive := Active;
invalidate;
end;
begin
Shape := TShape.Create(LED);
with Shape do
begin
Left := 30;
Top := 30;
Width := 30;
end;
end;
end;
type
TTriangleShape = class(TShape)
private
{ Private declarations }
protected
{ Protected declarations }
procedure Paint; override;
public
{ Public declarations }
published
{ Published declarations }
end;
type
TPointArray = array [0..2] of TPoint;
PPointArray = ^TPointArray;
procedure TTriangleShape.Paint;
begin
with Canvas do
begin
Polygon([Point(0, (Self.Height-2)), Point((Self.Width div 2), 0),
Point(Self.Width, (Self.Height-2)), Point(0, (Self.Height-2))]);
end;
end;
jemand ne Ahnung warum nichts beim Test während der Laufzeit auf meinem Formular zu sehen ist ?? Ich langsam nicht mehr
Christian
|
|
Zitat
|