unit ProgrammBlock2;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ExtCtrls, StdCtrls;
type
TProgrammBlock2 =
class(TImage)
private
FText :
string;
FLinienfarbe : TColor;
FHintergrund : TColor;
procedure WMPaint(
var Message: TWMPaint);
message WM_PAINT;
protected
public
constructor Create(AOwner: TComponent);
published
property Text :
string read FText
write FText;
property Linienfarbe : TColor
read FLinienfarbe
write FLinienfarbe;
property Hintergrund : TColor
read FHintergrund
write FHintergrund;
end;
procedure Register;
implementation
procedure TProgrammBlock2.WMPaint(
var Message: TWMPaint);
begin
inherited;
canvas.Brush.Color := FHintergrund;
canvas.Pen.Color := FLinienfarbe;
canvas.Rectangle(Self.ClientRect);
end;
constructor TProgrammBlock2.Create(AOwner: TComponent);
var
NeuesMemo : TMemo;
begin
inherited;
NeuesMemo := TMemo.Create(AOwner);
NeuesMemo.Clear;
NeuesMemo.Width := Width - 10;
NeuesMemo.Width := Height - 10;
NeuesMemo.Top := 10;
NeuesMemo.Left := 10;
Parent := NeuesMemo;
end;
procedure Register;
begin
RegisterComponents('
ProgrammStruckturen', [TProgrammBlock2]);
end;
end.