FGVRAJZ

Top  Previous  Next

unit FgvRajz;

 

interface

 

Uses

SysUtils, WinTypes, WinProcs, Messages, Classes, StdCtrls, ExtCtrls,

Graphics, Controls, Forms, Dialogs, Szoveg, Geom, Szamok, Koord;

 

Type

TFuncDraw = class(TCoordSystem)

private

  FFormula: string;

  procedure SetFormula(Value: string);

protected

  procedure Paint; override;

public

  constructor Create(AOwner:TComponent);override;

  destructor Destroy;override;

published

  property Formula: string read FFormula write SetFormula;

end;

 

procedure Register;

 

implementation

 

procedure Register;

begin

   RegisterComponents('AL',[TFuncDraw]);

end;

 

constructor TFuncDraw.Create(AOwner:TComponent);

begin

   inherited Create(AOwner);

end;

 

destructor TFuncDraw.Destroy;

begin

   inherited Destroy;

end;

 

procedure TFuncDraw.Paint;

var i,x,y: integer;

begin

Inherited Paint;

Canvas.Pen.Color:=clYellow;

For i:=-50 to 50 do begin

  x := ScreenX(i/10);

  y := ScreenY(sin(i/10)); If i=-50 then Canvas.MoveTo(x,y);

  Canvas.LineTo(x,y);

end;

end;

 

procedure TFuncDraw.SetFormula(Value: string);

begin

If FFormula<>Value then begin

   FFormula:=Value;

   Invalidate;

end;

end;

 

end.