ScatterCtrl_Demo: Included new legend table

git-svn-id: svn://ultimatepp.org/upp/trunk@6756 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
koldo 2014-01-11 13:44:06 +00:00
parent 98680a8d7d
commit 404773ae9e
4 changed files with 16 additions and 15 deletions

View file

@ -11,23 +11,23 @@ LAYOUT(ScatterCtrl_Demo, 624, 352)
END_LAYOUT
LAYOUT(Tab1, 380, 292)
ITEM(ScatterCtrl, scatter, SetLabelsFont(StdFontZ(11)).SetTitle(t_("Basic Test")).SetTitleFont(SansSerifZ(14).Bold()).HSizePosZ(16, 12).VSizePosZ(16, 16))
ITEM(ScatterCtrl, scatter, SetTitle(t_("Basic Test")).SetTitleFont(SansSerifZ(14).Bold()).SetPlotAreaRightMargin(20).SetPlotAreaTopMargin(20).SetLabelsFont(StdFontZ(11)).SetLegendAnchor(2).HSizePosZ(16, 12).VSizePosZ(16, 16))
END_LAYOUT
LAYOUT(Tab2, 380, 292)
ITEM(ScatterCtrl, scatter, SetLabelsFont(StdFontZ(11)).SetTitle(t_("Functions")).SetTitleFont(SansSerifZ(14).Bold()).SetGridWidth(2).HSizePosZ(16, 12).VSizePosZ(16, 16))
ITEM(ScatterCtrl, scatter, SetTitle(t_("Functions")).SetTitleFont(SansSerifZ(14).Bold()).SetPlotAreaRightMargin(110).SetPlotAreaTopMargin(20).SetLabelsFont(StdFontZ(11)).SetGridWidth(2).SetLegendAnchor(2).SetLegendPosX(-107).SetLegendPosY(0).HSizePosZ(16, 12).VSizePosZ(16, 16))
END_LAYOUT
LAYOUT(Tab3, 384, 284)
ITEM(ScatterCtrl, scatter, SetTitle(t_("Parametric functions demo")).SetTitleFont(SansSerifZ(14).Bold()).SetTitleColor(White).SetPlotAreaColor(Color(229, 229, 229)).SetColor(Color(198, 212, 255)).SetLabelsColor(White).SetAxisColor(Color(28, 212, 0)).SetAxisWidth(12).SetGridColor(Color(28, 127, 0)).HSizePosZ(16, 16).VSizePosZ(16, 16))
ITEM(ScatterCtrl, scatter, SetAxisWidth(12).SetTitle(t_("Parametric functions demo")).SetTitleFont(SansSerifZ(14).Bold()).SetTitleColor(White).SetPlotAreaTopMargin(20).SetPlotAreaColor(Color(229, 229, 229)).SetLabelsColor(White).SetAxisColor(Color(28, 212, 0)).SetColor(Color(198, 212, 255)).SetGridColor(Color(28, 127, 0)).SetLegendAnchor(2).HSizePosZ(16, 16).VSizePosZ(16, 16))
END_LAYOUT
LAYOUT(Tab4, 400, 316)
ITEM(ScatterCtrl, scatter, SetLabelsFont(SansSerifZ(11)).SetTitle(t_("Temperature Average. X Axis mouse zoom + scroll")).SetTitleFont(SansSerifZ(14).Bold()).SetPlotAreaLeftMargin(40).SetPlotAreaBottomMargin(40).SetLabelX(t_("Month")).SetLegendWidth(200).HSizePosZ(16, 16).VSizePosZ(16, 16))
ITEM(ScatterCtrl, scatter, SetTitle(t_("Temperature Average. X Axis mouse zoom + scroll")).SetTitleFont(SansSerifZ(14).Bold()).SetPlotAreaLeftMargin(40).SetPlotAreaTopMargin(20).SetPlotAreaBottomMargin(40).SetLabelX(t_("Month")).SetLabelsFont(SansSerifZ(11)).SetLegendAnchor(2).HSizePosZ(16, 16).VSizePosZ(16, 16))
END_LAYOUT
LAYOUT(Tab5, 400, 288)
ITEM(ScatterCtrl, scatter, SetTitle(t_("Dynamic")).SetTitleFont(StdFontZ(14).Bold()).SetLabelX(t_("time[s]")).HSizePosZ(16, 12).VSizePosZ(12, 36))
ITEM(ScatterCtrl, scatter, SetTitle(t_("Dynamic")).SetTitleFont(StdFontZ(14).Bold()).SetPlotAreaTopMargin(20).SetLabelX(t_("time[s]")).SetLegendAnchor(2).HSizePosZ(16, 12).VSizePosZ(12, 36))
ITEM(Button, bStart, SetLabel(t_("Start")).LeftPosZ(16, 42).BottomPosZ(5, 23))
ITEM(Button, bStop, SetLabel(t_("Stop")).LeftPosZ(64, 42).BottomPosZ(5, 23))
ITEM(Button, bReset, SetLabel(t_("Reset")).LeftPosZ(112, 42).BottomPosZ(5, 23))
@ -38,11 +38,11 @@ LAYOUT(Tab5, 400, 288)
END_LAYOUT
LAYOUT(Tab6, 400, 280)
ITEM(ScatterCtrl, scatter, SetTitle(t_("Logarithmic Scale")).SetTitleFont(StdFontZ(14).Bold()).HSizePosZ(12, 12).VSizePosZ(16, 16))
ITEM(ScatterCtrl, scatter, SetTitle(t_("Logarithmic Scale")).SetTitleFont(StdFontZ(14).Bold()).SetPlotAreaTopMargin(20).SetLegendAnchor(2).HSizePosZ(12, 12).VSizePosZ(16, 16))
END_LAYOUT
LAYOUT(Tab7, 388, 300)
ITEM(ScatterCtrl, scatter, SetTitle(t_("Operations")).SetTitleFont(MonospaceZ(16).Bold()).SetPlotAreaLeftMargin(45).SetLabelX(t_("[x]")).SetLabelY(t_("[y]")).HSizePosZ(12, 12).VSizePosZ(12, 36))
ITEM(ScatterCtrl, scatter, SetTitle(t_("Operations")).SetTitleFont(MonospaceZ(16).Bold()).SetPlotAreaLeftMargin(45).SetPlotAreaTopMargin(20).SetLabelX(t_("[x]")).SetLabelY(t_("[y]")).SetLegendAnchor(2).HSizePosZ(12, 12).VSizePosZ(12, 36))
ITEM(Button, bAddSeries, SetLabel(t_("AddSeries")).LeftPosZ(12, 60).BottomPosZ(4, 20))
ITEM(Button, bRemoveLastSeries, SetLabel(t_("RemoveLastSeries")).LeftPosZ(76, 104).BottomPosZ(4, 20))
ITEM(Button, bRemoveFirstSeries, SetLabel(t_("RemoveFirstSeries")).LeftPosZ(184, 100).BottomPosZ(4, 20))
@ -50,32 +50,32 @@ LAYOUT(Tab7, 388, 300)
END_LAYOUT
LAYOUT(Tab8, 400, 316)
ITEM(ScatterCtrl, scatter, SetLabelsFont(SansSerifZ(11)).SetTitle(t_("Temperature & Pressure Averages. X-Y Axis mouse zoom + scroll")).SetTitleFont(SansSerifZ(15).Bold()).SetPlotAreaLeftMargin(40).SetPlotAreaRightMargin(70).SetPlotAreaTopMargin(50).SetPlotAreaBottomMargin(50).SetLabelX(t_("Month")).SetLabelY(t_("Legend Y")).SetLabelY2(t_("Legend Y2")).SetLegendWidth(200).HSizePosZ(16, 16).VSizePosZ(16, 16))
ITEM(ScatterCtrl, scatter, SetTitle(t_("Temperature & Pressure Averages. X-Y Axis mouse zoom + scroll")).SetTitleFont(SansSerifZ(15).Bold()).SetPlotAreaLeftMargin(40).SetPlotAreaRightMargin(70).SetPlotAreaTopMargin(20).SetPlotAreaBottomMargin(50).SetLabelX(t_("Month")).SetLabelY(t_("Legend Y")).SetLabelY2(t_("Legend Y2")).SetLabelsFont(SansSerifZ(11)).SetLegendAnchor(2).HSizePosZ(16, 16).VSizePosZ(16, 16))
END_LAYOUT
LAYOUT(Tab9, 380, 348)
ITEM(ScatterCtrl, scatter, SetLabelsFont(StdFontZ(11)).SetTitle(t_("Big dataset")).SetTitleFont(SansSerifZ(14).Bold()).HSizePosZ(16, 12).VSizePosZ(16, 76))
ITEM(ScatterCtrl, scatter, SetTitle(t_("Big dataset")).SetTitleFont(SansSerifZ(14).Bold()).SetPlotAreaTopMargin(20).SetLabelsFont(StdFontZ(11)).SetLegendAnchor(2).HSizePosZ(16, 12).VSizePosZ(16, 76))
ITEM(Option, sequentialX, SetLabel(t_("SetSequentialX")).LeftPosZ(112, 92).BottomPosZ(8, 16))
ITEM(Option, fastView, SetLabel(t_("SetFastView")).LeftPosZ(16, 84).BottomPosZ(8, 16))
ITEM(Label, dv___3, SetLabel(t_("It includes two series with 100000 points.\nTo work with Painter it requires SetFastView and SetSequentialX to be true. \nIf not the program could get stuck.")).HSizePosZ(16, 4).BottomPosZ(28, 44))
END_LAYOUT
LAYOUT(Tab10, 380, 292)
ITEM(ScatterCtrl, scatter, SetLabelsFont(StdFontZ(11)).SetTitle(t_("User graph")).SetTitleFont(SansSerifZ(14).Bold()).HSizePosZ(16, 12).VSizePosZ(16, 16))
ITEM(ScatterCtrl, scatter, SetTitle(t_("User graph")).SetTitleFont(SansSerifZ(14).Bold()).SetPlotAreaTopMargin(20).SetLabelsFont(StdFontZ(11)).SetLegendAnchor(2).HSizePosZ(16, 12).VSizePosZ(16, 16))
END_LAYOUT
LAYOUT(Tab11, 504, 468)
ITEM(ScatterCtrl, scatter, SetTitle(t_("Trend Line demo")).SetTitleFont(SansSerifZ(14).Bold()).SetPlotAreaColor(Color(229, 229, 229)).SetAxisWidth(12).HSizePosZ(8, 8).VSizePosZ(8, 108))
ITEM(ScatterCtrl, scatter, SetAxisWidth(12).SetTitle(t_("Trend Line demo")).SetTitleFont(SansSerifZ(14).Bold()).SetPlotAreaTopMargin(20).SetPlotAreaColor(Color(229, 229, 229)).SetLegendAnchor(4).HSizePosZ(8, 8).VSizePosZ(8, 108))
ITEM(ArrayCtrl, grid, HSizePosZ(112, 8).BottomPosZ(4, 100))
ITEM(Label, dv___2, SetLabel(t_("Trend Lines Details:")).LeftPosZ(8, 100).BottomPosZ(83, 21))
END_LAYOUT
LAYOUT(Tab12, 400, 260)
ITEM(ScatterCtrl, scatter, SetLabelsFont(StdFontZ(11)).SetTitle(t_("Polar Plot")).SetTitleFont(SansSerifZ(14).Bold()).SetPlotAreaColor(LtGray).HSizePosZ(4, 4).VSizePosZ(4, 4))
ITEM(ScatterCtrl, scatter, SetTitle(t_("Polar Plot")).SetTitleFont(SansSerifZ(14).Bold()).SetPlotAreaTopMargin(20).SetPlotAreaColor(LtGray).SetLabelsFont(StdFontZ(11)).HSizePosZ(4, 4).VSizePosZ(4, 4))
END_LAYOUT
LAYOUT(TabPie, 536, 440)
ITEM(PieCtrl, chart, SetLegendHeight(80).SetLegendBackColor(Color(229, 229, 229)).SetTitle(t_("Average Weather")).SetFrame(ThinInsetFrame()).HSizePosZ(8, 12).VSizePosZ(40, 12))
ITEM(PieCtrl, chart, SetLegendBackColor(Color(229, 229, 229)).SetLegendHeight(80).SetTitle(t_("Average Weather")).SetFrame(ThinInsetFrame()).HSizePosZ(8, 12).VSizePosZ(40, 12))
ITEM(Label, dv___1, SetLabel(t_(" EXPERIMENTAL")).SetFrame(ThinInsetFrame()).LeftPosZ(8, 84).TopPosZ(8, 24))
END_LAYOUT

View file

@ -100,7 +100,7 @@ void ScatterCtrl_Demo::Preview()
r.Landscape();
Size pageSize = r.GetPageSize();
const Drawing &w = Examples()[examplesList.GetCursor()].ctrl()->Scatter().GetDrawing(true);
const Drawing &w = Examples()[examplesList.GetCursor()].ctrl()->Scatter().GetDrawing(Size(800, 600));
r.DrawDrawing(0, 0, pageSize.cx, pageSize.cy, w);
Perform(r);

View file

@ -34,6 +34,7 @@ void Tab1::Init()
scatter.SetRange(60, 50).SetMajorUnits(10, 10);
scatter.ShowInfo().ShowContextMenu().ShowPropertiesDlg().SetPopText("h", "v", "v2").SetMouseHandling(true, true);
scatter.SetLegendPos(Point(20, 20));
}
ScatterDemo *Construct1()

View file

@ -5,7 +5,7 @@ void Tab11::Init()
CtrlLayout(*this);
HSizePos().VSizePos();
scatter.SetRange(5, 1500).SetMajorUnits(1, 250).SetXYMin(-3, 0);
scatter.SetMouseHandling(true, true).ShowContextMenu().SetLegendWidth(160);
scatter.SetMouseHandling(true, true).ShowContextMenu();
sx << -3.067E0 << -2.981E0 << -2.921E0 << -2.912E0 << -2.840E0 << -2.797E0 << -2.702E0 << -2.699E0 << -2.633E0 << -2.481E0 << -2.363E0 << -2.322E0 << -1.501E0 << -1.460E0 << -1.274E0 << -1.212E0 << -1.100E0 << -1.046E0 << -0.915E0 << -0.714E0 << -0.566E0 << -0.545E0 << -0.400E0 << -0.309E0 << -0.109E0 << -0.103E0 << 0.010E0 << 0.119E0 << 0.377E0 << 0.790E0 << 0.963E0 << 1.006E0 << 1.115E0 << 1.572E0 << 1.841E0 << 2.047E0 << 2.200E0;
sy << 80.574E0 << 84.248E0 << 87.264E0 << 87.195E0 << 89.076E0 << 89.608E0 << 89.868E0 << 90.101E0 << 92.405E0 << 95.854E0 << 100.696E0 << 101.060E0 << 401.672E0 << 390.724E0 << 567.534E0 << 635.316E0 << 733.054E0 << 759.087E0 << 894.206E0 << 990.785E0 << 1090.109E0 << 1080.914E0 << 1122.643E0 << 1178.351E0 << 1260.531E0 << 1273.514E0 << 1288.339E0 << 1327.543E0 << 1353.863E0 << 1414.509E0 << 1425.208E0 << 1421.384E0 << 1442.962E0 << 1464.350E0 << 1468.705E0 << 1447.894E0 << 1457.628E0;