equal
deleted
inserted
replaced
1 #include <nbtab.h> |
1 #include <nbtab.h> |
2 |
2 |
3 NoteBookTab::NoteBookTab():mapwinexists(false) |
3 NoteBookTab::NoteBookTab():mapwinexists(false), designwinexists(false) |
4 { |
4 { |
5 Gtk::ScrolledWindow *pScrolledWindow = manage(new Gtk::ScrolledWindow); |
5 Gtk::ScrolledWindow *pScrolledWindow = manage(new Gtk::ScrolledWindow); |
6 gd_canvas=new GraphDisplayerCanvas(*this); |
6 gd_canvas=new GraphDisplayerCanvas(*this); |
7 pScrolledWindow->add(*gd_canvas); |
7 pScrolledWindow->add(*gd_canvas); |
8 add(*pScrolledWindow); |
8 add(*pScrolledWindow); |
205 mapwin->show(); |
205 mapwin->show(); |
206 mapwinexists=true; |
206 mapwinexists=true; |
207 } |
207 } |
208 } |
208 } |
209 |
209 |
|
210 void NoteBookTab::createDesignWin(std::string name) |
|
211 { |
|
212 if(!designwinexists) |
|
213 { |
|
214 double attraction, propulsation; |
|
215 int iterations; |
|
216 gd_canvas->get_design_data(attraction, propulsation, iterations); |
|
217 designwin=new DesignWin("Design Setup - "+name, attraction, propulsation, iterations); |
|
218 |
|
219 designwin->signal_attraction().connect(sigc::mem_fun(*this, &NoteBookTab::attraction_ch)); |
|
220 designwin->signal_propulsation().connect(sigc::mem_fun(*this, &NoteBookTab::propulsation_ch)); |
|
221 designwin->signal_iteration().connect(sigc::mem_fun(*gd_canvas, &GraphDisplayerCanvas::set_iteration)); |
|
222 designwin->close_run().connect(sigc::mem_fun(*gd_canvas, &GraphDisplayerCanvas::reDesignGraph)); |
|
223 |
|
224 designwin->signal_delete_event().connect(sigc::mem_fun(*this, &NoteBookTab::closeDesignWin)); |
|
225 |
|
226 designwin->show(); |
|
227 designwinexists=true; |
|
228 } |
|
229 } |
|
230 |
210 void NoteBookTab::closeMapWin() |
231 void NoteBookTab::closeMapWin() |
211 { |
232 { |
212 mapwinexists=false; |
233 mapwinexists=false; |
213 delete mapwin; |
234 delete mapwin; |
214 } |
235 } |
215 |
236 |
|
237 bool NoteBookTab::closeDesignWin(GdkEventAny * e) |
|
238 { |
|
239 if(e->type==GDK_DELETE) |
|
240 { |
|
241 designwinexists=false; |
|
242 delete designwin; |
|
243 } |
|
244 } |
|
245 |
216 sigc::signal<void, std::string> NoteBookTab::signal_title_ch() |
246 sigc::signal<void, std::string> NoteBookTab::signal_title_ch() |
217 { |
247 { |
218 return signal_title; |
248 return signal_title; |
219 } |
249 } |
220 |
250 |
225 |
255 |
226 void NoteBookTab::getView(bool & autoscale, bool & zoomtrack, double& width, double& radius) |
256 void NoteBookTab::getView(bool & autoscale, bool & zoomtrack, double& width, double& radius) |
227 { |
257 { |
228 gd_canvas->getView(autoscale, zoomtrack, width, radius); |
258 gd_canvas->getView(autoscale, zoomtrack, width, radius); |
229 } |
259 } |
|
260 |
|
261 void NoteBookTab::reDesignGraph() |
|
262 { |
|
263 gd_canvas->reDesignGraph(); |
|
264 } |
|
265 |
|
266 void NoteBookTab::attraction_ch(double v) |
|
267 { |
|
268 gd_canvas->set_attraction(v); |
|
269 } |
|
270 |
|
271 void NoteBookTab::propulsation_ch(double v) |
|
272 { |
|
273 gd_canvas->set_propulsation(v); |
|
274 } |
|
275 |
|
276 void NoteBookTab::iteration_ch(int v) |
|
277 { |
|
278 gd_canvas->set_iteration(v); |
|
279 } |
|
280 |