void Tab12_Linked::Init() { CtrlLayout(*this); SizePos(); 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(); scatter3.ShowInfo(); link = true; OnLink(); link.WhenAction = THISBACK(OnLink); }
VegaTab2::VegaTab2() { CtrlLayout(*this); SizePos(); //id, label, width arrp.AddColumn("Board", "Board", 5) ; //0 arrp.AddColumn("WhitePlayer", "White Player", 15); //1 arrp.AddColumn("ScoreW", " ", 5); //3 arrp.AddColumn("BlackPlayer", "Black Player", 15); //1 arrp.AddColumn("ScoreB", " ", 5); //3 arrp.AddColumn("IDW", "ID white", 5); //3 arrp.AddColumn("IDB", "ID black", 5); //3 //arr.WhenLeftClick = THISBACK(PromptCell); //arr.WhenLeftDouble = THISBACK(SortRecord); // color even rows arrp.EvenRowColor(); //avoid two identical row //arr.NoDuplicating(); //doesn't work! //set the callback for the Add_Player button //btnAdd <<= THISBACK(AddPlayer); /* btnAdd <<= THISBACK(AddPlayer); btnModify <<= THISBACK(ModifyPlayer); btnClear <<= THISBACK(MaskDefaultValue); */ }
void Tab1_Basic::Init() { CtrlLayout(*this); SizePos(); s1 << Pointf(10, 26) << Pointf(20, 37) << Pointf(30, 31) << Pointf(40, 33) << Pointf(50, 28); scatter.AddSeries(s1).Legend("Series 1").Opacity(0.3).Fill().MarkBorderColor(); s2y[0] = 22; s2y[1] = 33; s2y[2] = 27; s2y[3] = 29; s2y[4] = 24; scatter.AddSeries(s2y, 5, 10, 10).Legend("Series 2").Id(SERIE2).PlotStyle<LineSeriesPlot>() .Dash("").MarkColor(Red()).Fill().Opacity(0.5).MarkBorderColor(); s3y[0] = 18; s3y[1] = 29; s3y[2] = 23; s3y[3] = 25; s3y[4] = 20; s3x[0] = 10; s3x[1] = 20; s3x[2] = 30; s3x[3] = 40; s3x[4] = 50; scatter.AddSeries(s3x, s3y, 5).Legend("Series 3").MarkBorderColor(); s4y << 14 << 25 << 19 << 21 << 16; s4x << 10 << 20 << 30 << 40 << 50; scatter.AddSeries(s4x, s4y).Legend("Series 4").PlotStyle<StaggeredSeriesPlot>().Dash("").NoMark().Fill().Stroke(3, LtRed()); s5.Add(10, 10); s5.Add(20, 21); s5.Add(30, 15); s5.Add(40, 16); s5.Add(50, 12); int barWidth = 4; scatter.AddSeries(s5).Legend("Series 5").PlotStyle<BarSeriesPlot>(barWidth).Dash("").NoMark().Fill(); scatter.SetRange(60, 50).SetMajorUnits(10, 10); scatter.ShowInfo().ShowContextMenu().ShowPropertiesDlg().ShowProcessDlg().SetPopText("h", "v", "v2").SetMouseHandling(true, true); scatter.SetLegendPos(Point(20, 20)); }
void TextsTab::Init(ScatterCtrl& scatter) { CtrlLayout(*this); SizePos(); pscatter = &scatter; title <<= scatter.GetTitle(); title <<= THISBACK(Change); xLabel <<= scatter.GetLabelX(); xLabel <<= THISBACK(Change); yLabel <<= scatter.GetLabelY(); yLabel <<= THISBACK(Change); yLabel2 <<= scatter.GetLabelY2(); yLabel2 <<= THISBACK(Change); leftMargin <<= scatter.GetPlotAreaLeftMargin(); leftMargin <<= THISBACK(Change); rightMargin <<= scatter.GetPlotAreaRightMargin(); rightMargin <<= THISBACK(Change); topMargin <<= scatter.GetPlotAreaTopMargin(); topMargin <<= THISBACK(Change); bottomMargin <<= scatter.GetPlotAreaBottomMargin(); bottomMargin <<= THISBACK(Change); Change(); }
void Tab10::Init() { CtrlLayout(*this); SizePos(); sy[0] = 18; sy[1] = 29; sy[2] = 23; sy[3] = 25; sy[4] = 20; sx[0] = 10; sx[1] = 20; sx[2] = 30; sx[3] = 40; sx[4] = 50; scatter.AddSeries(sx, sy, 5).Legend("Series").PlotStyle<MyPlot>().MarkStyle<MyMark>().Stroke(3, LtGreen()).Fill(LtGray()); scatter.SetRange(60, 50).SetMajorUnits(10, 10); scatter.ShowInfo().ShowContextMenu(); }
VegaTab2::VegaTab2() { CtrlLayout(*this); SizePos(); //id, label, width arrp.AddColumn("Board", "Board", 4) ; //0 arrp.AddColumn("White", "White Player", 25); //1 arrp.AddColumn("Black", "Black Player", 25); //1 arrp.AddColumn("ID", "IDW-IDB", 8); //3 arrp.EvenRowColor(); arrp.SetLineCy(19); //option image adjustment... }
VegaTab1::VegaTab1() { // set the widths of each coloumn // arr.ColumnWidths("25 3 5 12 8 8 2 3 3 3 3"); CtrlLayout(*this, ""); SizePos(); //id, label, width arr.AddColumn("ID", "ID", 3).HeaderTab().WhenAction = THISBACK1(SortRecord, 0); //0 arr.AddColumn("Name", "Name", 21).HeaderTab().WhenAction = THISBACK1(SortRecord, 1); //1 arr.AddColumn("Country", "Fed", 3); //2 arr.AddColumn("Birthday", "Birthday", 6); //3 arr.AddColumn("Gender", "G", 3); //4 arr.AddColumn("Title", "Title", 4); //5 arr.AddColumn("IDFIDE", "ID FIDE", 6); //6 arr.AddColumn("RatFIDE", "Rtg FIDE", 5).HeaderTab().WhenAction = THISBACK1(SortRecord, 7); //7 arr.AddColumn("IDNat", "ID Nat", 6); //8 arr.AddColumn("RatNat", "Rtg Nat", 5).HeaderTab().WhenAction = THISBACK1(SortRecord, 9); //9 arr.AddColumn("K", "K", 3); //10 arr.AddColumn("Status", "Status", 5).Ctrls(Avail3); //11 // arr.AddColumn("Status", "Status", 5).Ctrls(Avail3).HeaderTab().WhenAction = THISBACK1(SortRecord, 12); //11 // arr.AddColumn("Avail", "Avail?", 4).Ctrls(Avail3).Ctrls(Callback1<One<Ctrl>&> factory); // arr.AddColumn("Extra","Extra",6).Ctrls(Extra2); arr.NoHorzGrid(); arr.SetLineCy(VegaImg::imgYes().GetSize().cy+2); //option image adjustment... //arr.WhenLeftClick = THISBACK(PromptCell); arr.WhenLeftClick = THISBACK(FillFieldsFromRow); // color even rows arr.EvenRowColor(); //drop list widget editTitle.Add("1", "WGM"); editTitle.Add("2", "CM"); editTitle.Add("3", "AA"); // btnAdd <<= THISBACK(AddPlayer); //maybe it's better to have all callbacks from main menu?... btnModify <<= THISBACK(ModifyPlayer); btnClear <<= THISBACK(MaskDefaultValue); tsex.SetImage(VegaImg::female, VegaImg::male); // false state, true state tsex <<= 1; //set to 'male' // tsex <<= THISBACK(Tsex); editName.SetFilter(FilterCommaSpace).MaxChars(25); //added filter editIDFIDE.MaxChars(8); //set limit editIDNat.MaxChars(8); //set limit editRatFIDE.MaxChars(4); //set limit editRatNat.MaxChars(4); //set limit kcoeff.MaxChars(2); //set limit //fill with default value MaskDefaultValue(); }
void Tab6_Logarithmic::Init() { CtrlLayout(*this); SizePos(); scatter.SetRange(6,100); scatter.SetMajorUnits(1,20); scatter.ShowInfo(); s1 <<Pointf(log10(10.0),14)<<Pointf(log10(1e2),25)<<Pointf(log10(1e3),39)<<Pointf(log10(1e4),44)<<Pointf(log10(1e5),76); scatter.AddSeries(s1).Legend("series1"); scatter.cbModifFormatX = THISBACK(FormatX); }
void Tab2::Init() { CtrlLayout(*this); SizePos(); scatter.SetRange(12, 60).SetXYMin(-6, -30).SetMajorUnits(2, 10); scatter.SetMouseHandling(true); scatter.AddSeries(&funct1).Legend("y = 3").NoMark(); scatter.AddSeries(&funct2).Legend("y = x^2-5").NoMark(); scatter.AddSeries(&funct3).Legend("y = -x^2-5").NoMark(); scatter.AddSeries(&vfunct1).Legend("y = 0").NoMark(); scatter.AddSeries(&vfunct2).Legend("y = x^2").NoMark(); scatter.AddSeries(&vfunct3).Legend("y = -x^2").NoMark(); }
void MeasuresTab::Init(ScatterCtrl& scatter) { CtrlLayout(*this); SizePos(); pscatter = &scatter; xMin <<= scatter.GetXMin(); xMax <<= scatter.GetXRange() + scatter.GetXMin(); yMin <<= scatter.GetYMin(); yMax <<= scatter.GetYRange() + scatter.GetYMin(); yMin2 <<= scatter.GetYMin2(); yMax2 <<= scatter.GetY2Range() + scatter.GetYMin2(); butUpdate.WhenAction = THISBACK(Change); Change(); }
void Tab5_Dynamic::Init() { CtrlLayout(*this); SizePos(); scatter.SetRange(10, 100); scatter.AddSeries(s1).Legend("U-t").Units("V", "s").NoMark(); scatter.AddSeries(s2).Legend("I-t").Units("A", "s").NoMark(); bStart <<=(THISBACK(Start)); bStop <<=(THISBACK(Stop)); bReset <<=(THISBACK(Reset)); bPgDown <<=(THISBACK(PgDown)); bPgUp <<=(THISBACK(PgUp)); bPlus <<=(THISBACK(Plus)); bMinus <<=(THISBACK(Minus)); t = 0; bStop.Disable(); }
void Tab3::Init() { CtrlLayout(*this); SizePos(); scatter.SetRange(7, 4); scatter.SetMajorUnits(0.5, 0.5); scatter.SetXYMin(-2, -2); scatter.AddSeries(&opara1, 20).Legend("Circle 1");//.NoMark(); scatter.AddSeries(STDBACK(para1), 100).Legend("Circle 2").NoMark(); scatter.AddSeries(STDBACK(para2), 100).Legend("Coil").NoMark(); scatter.AddSeries(STDBACK(para3), 150).Legend("Spiral 1").NoMark(); scatter.AddSeries(STDBACK1(para3p, 2.5), 150, 0, 1).Legend("Spiral 2").NoMark(); scatter.AddSeries(STDBACK(para4), 2).Legend("VLine").NoMark(); scatter.AddSeries(STDBACK(para5), 2).Legend("HLine").NoMark(); scatter.AddSeries(STDBACK2(para1p, 4.0, 0.25), 50, 0, 1).Legend("Ellipse 1").NoMark(); scatter.AddSeries(STDBACK2(para1p, 2.0, 0.5), 50, 0, 1).Legend("Ellipse 2").NoMark(); }
void TabBubblePlot::Init() { CtrlLayout(*this); SizePos(); scatter.SetMouseHandling(true, true).ShowContextMenu(); for (double size = 0; size <= 10; size += 2.) { Vector<double> &data = s1.Add(); data << size << (10 + 10*Random(30)*size) << Random(80); } idsBubble << 2; static Vector<int> idVoid; scatter.AddSeries(s1, 0, 1, idVoid, idVoid, idsBubble).Legend("Importance").MarkStyle<BubblePlot>() .NoPlot().MarkColor(Green()).MarkBorderColor(LtRed()).MarkBorderWidth(3); scatter.SetLabelY("Size"); scatter.ZoomToFit(true, true, 0.2); }
void DataTab::Init(ScatterCtrl& scatter) { CtrlLayout(*this); SizePos(); pscatter = &scatter; tab.Reset(); series.Clear(); for(int c = 0; c < scatter.GetCount(); c++) if (!IsNull(scatter.GetCount(c))) { WithDataSeries <StaticRect> &dataseries = series.Add(); CtrlLayout(dataseries); tab.Add(dataseries.SizePos(), scatter.GetLegend(c)); } OnTab(); tab <<= THISBACK(OnTab); }
void GeneralTab::Init(ScatterCtrl& scatter) { CtrlLayout(*this); SizePos(); pscatter = &scatter; title <<= scatter.GetTitle(); title <<= THISBACK(Change); xLabel <<= scatter.GetLabelX(); xLabel <<= THISBACK(Change); yLabel <<= scatter.GetLabelY(); yLabel <<= THISBACK(Change); yLabel2 <<= scatter.GetLabelY2(); yLabel2 <<= THISBACK(Change); showLegend <<= scatter.GetShowLegend(); showLegend <<= THISBACK(Change); setLegendWidth <<= scatter.GetLegendWidth(); setLegendWidth <<= THISBACK(Change); }
void TabRangePlot::Init() { CtrlLayout(*this); SizePos(); scatter.SetMouseHandling(true, true).ShowContextMenu(); for (double time = 0; time <= 10; time += 2.) { Vector<double> &data = s1.Add(); double size = time * 10.; data << time << ((size - 10) + Random(50)) << ((size - 4) + Random(50)) << ((size + 4) + Random(50)) << ((size + 10) + Random(50)); } idsRange << 1 << 2 << 3 << 4; static Vector<int> idVoid; scatter.AddSeries(s1, 0, Null, idVoid, idsRange, idVoid).Legend("Size").Units("m") .MarkStyle<RangePlot>(RangePlot::MIN_AVG_MAX);//.NoPlot(); scatter.SetLabelY("Size").SetLabelX("time [seg]"); scatter.ZoomToFit(true, true, 0.2); }
void Tab4::Init() { CtrlLayout(*this); SizePos(); scatter.SetRange(13, 50) .SetMajorUnits(1, 10) .SetXYMin(0, -20); scatter.SetMouseHandling(true).ShowContextMenu(); s1 <<Pointf(1,-6)<<Pointf(2,-4)<<Pointf(3,2)<<Pointf(4,8)<<Pointf(5,8)<<Pointf(6,15)<<Pointf(7,20)<<Pointf(8,25)<<Pointf(9,14)<<Pointf(10,10)<<Pointf(11,3)<<Pointf(12,-11); scatter.AddSeries(s1).Legend("2005").Units("ºC"); s2 <<Pointf(1,-12)<<Pointf(2,-7)<<Pointf(3,0)<<Pointf(4,2)<<Pointf(5,10)<<Pointf(6,18)<<Pointf(7,25)<<Pointf(8,26)<<Pointf(9,15)<<Pointf(10,12)<<Pointf(11,7)<<Pointf(12,-6); scatter.AddSeries(s2).Legend("2006").Units("ºC").MarkStyle<CircleMarkPlot>(); scatter.Graduation_FormatX(ScatterCtrl::MON) .SetLabelY("Temperature") .SetMarkWidth(1, 4) .SetMinXmin(0).SetMaxXmax(13); }
void LegendTab::Init(ScatterCtrl& scatter) { CtrlLayout(*this); SizePos(); pscatter = &scatter; showLegend <<= scatter.GetShowLegend(); showLegend <<= THISBACK(Change); legendPosition <<= (scatter.GetLegendAnchor() == ScatterDraw::LEGEND_TOP ? 0 : 1); legendPosition <<= THISBACK(Change); legendAnchorRT = true; switch(scatter.GetLegendAnchor()) { case ScatterDraw::LEGEND_ANCHOR_LEFT_TOP: legendAnchorLT = true; break; case ScatterDraw::LEGEND_ANCHOR_RIGHT_TOP: legendAnchorRT = true; break; case ScatterDraw::LEGEND_ANCHOR_LEFT_BOTTOM: legendAnchorLB = true; break; case ScatterDraw::LEGEND_ANCHOR_RIGHT_BOTTOM: legendAnchorRB = true; break; } legendAnchorLT <<= THISBACK1(ChangeAnchor, &legendAnchorLT); legendAnchorRT <<= THISBACK1(ChangeAnchor, &legendAnchorRT); legendAnchorLB <<= THISBACK1(ChangeAnchor, &legendAnchorLB); legendAnchorRB <<= THISBACK1(ChangeAnchor, &legendAnchorRB); fillColor <<= scatter.GetLegendFillColor(); fillColor <<= THISBACK(Change); borderColor <<= scatter.GetLegendBorderColor(); borderColor <<= THISBACK(Change); Point p = scatter.GetLegendPos(); tableHoriz <<= p.x; tableHoriz <<= THISBACK(Change); tableVert <<= p.y; tableVert <<= THISBACK(Change); numCols <<= scatter.GetLegendNumCols(); numCols <<= THISBACK(Change); rowSpacing <<= scatter.GetLegendRowSpacing(); rowSpacing <<= THISBACK(Change); Change(); }
void SeriesTab::Init(ScatterCtrl& scatter) { CtrlLayout(*this); SizePos(); pscatter = &scatter; list.Reset(); list.SetLineCy(EditField::GetStdHeight()); list.AddColumn(t_("Name")); for(int i = 0; i < scatter.GetCount(); i++) list.Add(scatter.GetLegend(i)); list.SetCursor(0); list.WhenSel = THISBACK(UpdateFields); markstyle.Add(t_("No mark")); for(int i = 0; i < MarkPlot::GetCount(); i++) markstyle.Add(MarkPlot::TypeName(i)); markstyle.SetIndex(0); UpdateFields(); linecolor <<= THISBACK(Change); fillcolor <<= THISBACK(Change); visible <<= THISBACK(Change); dash <<= THISBACK(Change); linethickness <<= THISBACK(Change); markstyle <<= THISBACK(Change); markcolor <<= THISBACK(Change); markwidth <<= THISBACK(Change); unitsY <<= THISBACK(Change); unitsX <<= THISBACK(Change); name <<= THISBACK(Change); primary <<= THISBACK(Change); name.SetFocus(); }