lazarus/components/plotfunction/demo/event/frmmain.pp
mattias 26cb90f023 renamed plotpanel to plotfunction
git-svn-id: trunk@17519 -
2008-11-22 15:55:23 +00:00

51 lines
829 B
ObjectPascal

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
{ 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;
initialization
{$I frmmain.lrs}
end.