ScatterCtrl_Demo: Added LinkedWith()

git-svn-id: svn://ultimatepp.org/upp/trunk@7126 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
koldo 2014-04-01 19:34:11 +00:00
parent 9a4a93e5fc
commit 298f76840e
5 changed files with 53 additions and 11 deletions

View file

@ -177,10 +177,10 @@ public:
typedef Tab12 CLASSNAME;
virtual void Init();
virtual ScatterCtrl &Scatter() {return scatter;};
virtual ScatterCtrl &Scatter() {return scatter1;};
private:
Vector<Pointf> s1;
Vector<Pointf> s1, s2, s3;
};
class TabPie : public WithTabPie<StaticRect> {

View file

@ -70,8 +70,14 @@ LAYOUT(Tab11, 504, 468)
ITEM(Label, dv___2, SetLabel(t_("Trend Lines Details:")).LeftPosZ(8, 100).BottomPosZ(83, 21))
END_LAYOUT
LAYOUT(Tab12, 400, 260)
ITEM(ScatterCtrl, scatter, SetTitle(t_("Polar Plot")).SetTitleFont(SansSerifZ(14).Bold()).SetPlotAreaTopMargin(20).SetPlotAreaColor(LtGray).SetLabelsFont(StdFontZ(11)).HSizePosZ(4, 4).VSizePosZ(4, 4))
LAYOUT(Tab12, 456, 464)
ITEM(ScatterCtrl, scatter1, SetTitle(t_("All plots are linked together")).SetTitleFont(SansSerifZ(14).Bold()).SetPlotAreaTopMargin(20).SetLabelsFont(StdFontZ(11)).SetLegendAnchor(1).HSizePosZ(4, 4).TopPosZ(4, 152))
ITEM(ScatterCtrl, scatter2, SetTitleFont(SansSerifZ(14).Bold()).SetPlotAreaTopMargin(0).SetLabelsFont(StdFontZ(11)).SetLegendAnchor(1).HSizePosZ(4, 4).TopPosZ(152, 152))
ITEM(ScatterCtrl, scatter3, SetTitleFont(SansSerifZ(14).Bold()).SetPlotAreaTopMargin(0).SetLabelsFont(StdFontZ(11)).SetLegendAnchor(1).HSizePosZ(4, 4).VSizePosZ(300, 4))
END_LAYOUT
LAYOUT(Tab13, 420, 236)
ITEM(ScatterCtrl, scatter, SetTitle(t_("Polar Plot")).SetTitleFont(SansSerifZ(14).Bold()).SetPlotAreaTopMargin(20).SetLabelsFont(StdFontZ(11)).HSizePosZ(4, 4).VSizePosZ(4, 4))
END_LAYOUT
LAYOUT(TabPie, 536, 440)

View file

@ -22,6 +22,7 @@ file
tab9.cpp,
tab10.cpp,
tab11.cpp,
tab12.cpp,
tabPie.cpp,
symbol.iml;

View file

@ -1,15 +1,27 @@
#include "ScatterCtrl_Demo.h"
void Tab12::Init()
{
CtrlLayout(*this);
HSizePos().VSizePos();
s1 << Pointf(50, 10) << Pointf(100, 20) << Pointf(150, 30) << Pointf(200, 20) << Pointf(250, 10);
scatter.AddSeries(s1).Legend("Series 1").Fill();
scatter.SetXYMin(50, 0).SetRange(200, 40).SetMajorUnits(50, 10).SetPolar();
scatter.ShowInfo().ShowContextMenu().ShowPropertiesDlg().SetPopText("h", "v", "v2").SetMouseHandling(true, true);
scatter1.SetRange(1000, 40).SetXYMin(0, -20);
scatter1.SetMouseHandling(true).SetMaxRange(5000).SetMinRange(2);
scatter2.SetRange(1000, 40).SetXYMin(0, -20);
scatter2.SetMouseHandling(true).SetMaxRange(5000).SetMinRange(2);
scatter3.SetRange(1000, 40).SetXYMin(0, -20);
scatter3.SetMouseHandling(true).SetMaxRange(5000).SetMinRange(2);
for (int t = 0; t < 1000; ++t) {
s1 << Pointf(t, 20*sin(6*M_PI*t/500));
s2 << Pointf(t, 20*sin(6*1.1*M_PI*t/500));
s3 << Pointf(t, 20*sin(6*1.2*M_PI*t/500));
}
scatter1.AddSeries(s1).Legend("Series 1").NoMark().Stroke(2, LtRed());
scatter2.AddSeries(s2).Legend("Series 2").NoMark().Stroke(2, LtBlue());
scatter3.AddSeries(s3).Legend("Series 3").NoMark().Stroke(2, LtGreen());
scatter1.ShowInfo();
scatter2.ShowInfo().LinkedWith(scatter1);
scatter3.ShowInfo().LinkedWith(scatter2);
}
ScatterDemo *Construct12()
@ -19,5 +31,5 @@ ScatterDemo *Construct12()
}
INITBLOCK {
RegisterExample("Polar plot", Construct12, __FILE__);
RegisterExample("Linked controls", Construct12, __FILE__);
}

View file

@ -0,0 +1,23 @@
#include "ScatterCtrl_Demo.h"
void Tab12::Init()
{
CtrlLayout(*this);
HSizePos().VSizePos();
s1 << Pointf(50, 10) << Pointf(100, 20) << Pointf(150, 30) << Pointf(200, 20) << Pointf(250, 10);
scatter.AddSeries(s1).Legend("Series 1").Fill();
scatter.SetXYMin(50, 0).SetRange(200, 40).SetMajorUnits(50, 10).SetPolar();
scatter.ShowInfo().ShowContextMenu().ShowPropertiesDlg().SetPopText("h", "v", "v2").SetMouseHandling(true, true);
}
ScatterDemo *Construct12()
{
static Tab12 tab;
return &tab;
}
INITBLOCK {
RegisterExample("Polar plot", Construct12, __FILE__);
}