mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-15 14:16:07 -06:00
.ScatterCtrl_Demo: Fixes Thanks to ManfredHerr
git-svn-id: svn://ultimatepp.org/upp/trunk@5872 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
fc0f80ceb7
commit
fc5fa2a7ae
3 changed files with 15 additions and 13 deletions
|
|
@ -35,8 +35,10 @@ GUI_APP_MAIN
|
|||
Sort(Examples(), CompareExamples);
|
||||
for (int i = 0; i < Examples().GetCount(); ++i)
|
||||
Examples()[i].ctrl()->Init();
|
||||
|
||||
ScatterCtrl_Demo().Run();
|
||||
|
||||
ScatterCtrl_Demo demo;
|
||||
|
||||
demo.Run();
|
||||
}
|
||||
|
||||
ScatterCtrl_Demo::ScatterCtrl_Demo()
|
||||
|
|
@ -73,7 +75,9 @@ void ScatterCtrl_Demo::Preview()
|
|||
Report r;
|
||||
|
||||
const Drawing &w = Examples()[tab.Get()].ctrl()->Scatter().GetDrawing();
|
||||
r.DrawDrawing(300, 300, w.GetSize().cx, w.GetSize().cy, w);
|
||||
r.Landscape();
|
||||
Size pageSize = r.GetPageSize();
|
||||
r.DrawDrawing(0, 0, pageSize.cx, pageSize.cy, w);
|
||||
|
||||
Perform(r);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,8 +17,7 @@ void Tab7::AddSeries()
|
|||
int num = scatter.GetCount();
|
||||
double f = 1 + num*1.1;
|
||||
|
||||
Vector<Pointf> s1;
|
||||
Vector<Pointf> &s = series.AddPick(s1);
|
||||
Vector<Pointf> &s = series.Add();
|
||||
s << Pointf(10, 3*f) << Pointf(30, 7*f) << Pointf(50, 12*f) << Pointf(70, 10*f);
|
||||
scatter.AddSeries(s).Legend(String("series") + AsString(num));
|
||||
}
|
||||
|
|
@ -28,17 +27,16 @@ void Tab7::RemoveFirstSeries()
|
|||
if (scatter.IsEmpty())
|
||||
return;
|
||||
scatter.RemoveSeries(0);
|
||||
if (!series.IsEmpty())
|
||||
series[0].Clear();
|
||||
series.Remove(0);
|
||||
}
|
||||
|
||||
void Tab7::RemoveLastSeries()
|
||||
{
|
||||
if (scatter.IsEmpty())
|
||||
return;
|
||||
int topIndex = scatter.GetCount()-1;
|
||||
if (topIndex >= 0) {
|
||||
series.Remove(topIndex);
|
||||
scatter.RemoveSeries(topIndex);
|
||||
}
|
||||
scatter.RemoveSeries(topIndex);
|
||||
series.Remove(topIndex);
|
||||
}
|
||||
|
||||
void Tab7::RemoveAllSeries()
|
||||
|
|
|
|||
|
|
@ -5,8 +5,8 @@ void Tab8::Init()
|
|||
{
|
||||
CtrlLayout(*this);
|
||||
HSizePos().VSizePos();
|
||||
scatter.SetRange(13,50,20);
|
||||
scatter.SetMajorUnits(1,10);
|
||||
scatter.SetRange(13, 50, 20);
|
||||
scatter.SetMajorUnits(1, 10);
|
||||
scatter.SetXYMin(0,-20, 1000);
|
||||
scatter.SetMouseHandling(true, true);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue