ultimatepp/examples/ScatterCtrl_Demo/tab18_UserPaint.cpp
koldo 1f0b3adb98 ScatterCtrl_Demo: DataSourceSurf changes
git-svn-id: svn://ultimatepp.org/upp/trunk@12665 f0d560ea-af0d-0410-9eb7-867de7ffcac7
2019-01-12 23:59:22 +00:00

30 lines
800 B
C++

#include "ScatterCtrl_Demo.h"
void Tab_UserPaint::Init()
{
CtrlLayout(*this);
SizePos();
double a = 1, b = 0, c = 1;
for (double x = -6; x < 6; x += 0.1)
s1 << Pointf(x, a*exp(-sqr(x - b)/(2*c*c)));
scatter.AddSeries(s1).Legend("Gauss").Opacity(0.3).Fill().NoMark();
scatter.ShowInfo().ShowContextMenu().ShowPropertiesDlg().ShowProcessDlg().
SetMouseHandling(true, true);
scatter.SetLegendPos(Point(20, 20)).SetLegendAnchor(ScatterDraw::RIGHT_BOTTOM);
scatter.Rotate(ScatterCtrl::Angle_0);
scatter.ZoomToFit(true, true);
scatter.WhenPainter = THISBACK(OnPainter);
scatter.WhenDraw = THISBACK(OnDraw);
}
ScatterDemo *Construct18()
{
static Tab_UserPaint tab;
return &tab;
}
INITBLOCK {
RegisterExample("User paint", Construct18, __FILE__);
}