140 : base(handle)
141 {
142 _builder = builder;
143 builder.Autoconnect(this);
144 model = new ScottPlot.Plot();
145 data.Add(vals);
146 if (typ == PlotType.Scatter)
147 InitScatter();
148 else
149 if (typ == PlotType.Bar)
150 InitBars();
151 if (!name.EndsWith(".png") || !name.EndsWith(".PNG"))
152 file = name + ".png";
153 this.Title = name;
154 image.Drawn += Image_Drawn;
155 image.SizeAllocated += Image_SizeAllocated;
156 image.ButtonPressEvent += Image_ButtonPressEvent;
157 barMenu.ButtonPressEvent += BarMenu_ButtonPressEvent;
158 scatterMenu.ButtonPressEvent += ScatterMenu_ButtonPressEvent;
159 saveImageMenu.ButtonPressEvent += SaveImageMenu_ButtonPressEvent;
160 saveCSVMenu.ButtonPressEvent += SaveCSVMenu_ButtonPressEvent;
161 this.DeleteEvent += About_DeleteEvent;
162 this.name = name;
163 selected = this;
164 if(plots.ContainsKey(name))
165 plots[name] = this;
166 else
167 plots.Add(name,this);
168 App.ApplyStyles(this);
169 }