1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
|
unit frmmain;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
plotpanel;
type
{ TMainForm }
TMainForm = class(TForm)
procedure CreatePlotter(Sender: TObject);
private
{ private declarations }
FPlot:TPlotFunctionPanel;
public
{ public declarations }
Procedure PlotResult(Const X : TPlotFloat; Out Y : TPlotFloat);
end;
var
MainForm: TMainForm;
implementation
{$R *.lfm}
{ TMainForm }
procedure TMainForm.CreatePlotter(Sender: TObject);
begin
FPlot:=TPlotFunctionPanel.Create(Self);
FPlot.parent:=Self;
FPlot.Align:=alClient;
Fplot.OnCalcPlot:=@PlotResult;
FPlot.Active:=True;
end;
procedure TMainForm.PlotResult(const X: TPlotFloat; out Y: TPlotFloat);
begin
Y:=X*X/100;
end;
end.
|