ultimatepp/examples/ScatterCtrl_Demo/tab2.cpp
cxl 1057bc2b1b .Fixing svn directory structure
git-svn-id: svn://ultimatepp.org/upp/trunk@4892 f0d560ea-af0d-0410-9eb7-867de7ffcac7
2012-05-01 17:48:16 +00:00

32 lines
No EOL
760 B
C++

#include "ScatterCtrl_Demo.h"
double funct1(double x) {return 3;}
double funct2(double x) {return (x*x-5);}
double funct3(double x) {return (-x*x-5);}
void vfunct1(double& y, double x) {y = 0;}
void vfunct2(double& y, double x) {y = x*x;}
void vfunct3(double& y, double x) {y = -x*x;}
void Tab2::Init()
{
CtrlLayout(*this);
HSizePos().VSizePos();
scatter.SetRange(12, 60).SetXYMin(-6, -30).SetMajorUnits(2, 10);
scatter.SetMouseHandling(true);
scatter.AddSeries(&funct1).Legend("y = 3");
scatter.AddSeries(&funct2).Legend("x^2-5");
scatter.AddSeries(&funct3).Legend("-x^2-5");
}
ScatterDemo *Construct2()
{
static Tab2 tab;
return &tab;
}
INITBLOCK {
RegisterExample("Functions", Construct2, __FILE__);
}