97 sigc::mem_fun(*this, &MainWin::zoom100)); |
97 sigc::mem_fun(*this, &MainWin::zoom100)); |
98 |
98 |
99 ag->add( Gtk::Action::create("ShowMenu", _("_Show")) ); |
99 ag->add( Gtk::Action::create("ShowMenu", _("_Show")) ); |
100 ag->add( Gtk::Action::create("ShowMaps", _("_Maps")), |
100 ag->add( Gtk::Action::create("ShowMaps", _("_Maps")), |
101 sigc::mem_fun(*this, &MainWin::createMapWin)); |
101 sigc::mem_fun(*this, &MainWin::createMapWin)); |
|
102 ag->add( Gtk::Action::create("ShowDesign", _("_Design")), |
|
103 sigc::mem_fun(*this, &MainWin::createDesignWin)); |
102 |
104 |
103 ag->add( Gtk::Action::create("AlgoMenu", _("_Algorithms")) ); |
105 ag->add( Gtk::Action::create("AlgoMenu", _("_Algorithms")) ); |
104 ag->add( Gtk::Action::create("AlgoGeneral", _("_General")), |
106 ag->add( Gtk::Action::create("AlgoGeneral", _("_General")), |
105 sigc::bind( sigc::mem_fun ( *this, &MainWin::createAlgoWin ), 0) ); |
107 sigc::bind( sigc::mem_fun ( *this, &MainWin::createAlgoWin ), 0) ); |
106 ag->add( Gtk::Action::create("AlgoKruskal", _("_Kruskal")), |
108 ag->add( Gtk::Action::create("AlgoKruskal", _("_Kruskal")), |
119 ag->add( Gtk::RadioAction::create(tool_group, "EditEdgeMap", Gtk::StockID("gd-editlink"), _("Edit edge map")), |
121 ag->add( Gtk::RadioAction::create(tool_group, "EditEdgeMap", Gtk::StockID("gd-editlink"), _("Edit edge map")), |
120 sigc::bind( sigc::mem_fun ( *this, &MainWin::changeEditorialTool ), 4) ); |
122 sigc::bind( sigc::mem_fun ( *this, &MainWin::changeEditorialTool ), 4) ); |
121 |
123 |
122 ag->add( Gtk::Action::create("AddMap", Gtk::StockID("gd-newmap")), |
124 ag->add( Gtk::Action::create("AddMap", Gtk::StockID("gd-newmap")), |
123 sigc::mem_fun ( *this , &MainWin::createNewMapWin ) ); |
125 sigc::mem_fun ( *this , &MainWin::createNewMapWin ) ); |
|
126 |
|
127 ag->add( Gtk::Action::create("DesignGraph", Gtk::Stock::REFRESH), |
|
128 sigc::mem_fun ( *this , &MainWin::reDesignGraph ) ); |
124 |
129 |
125 uim=Gtk::UIManager::create(); |
130 uim=Gtk::UIManager::create(); |
126 uim->insert_action_group(ag); |
131 uim->insert_action_group(ag); |
127 add_accel_group(uim->get_accel_group()); |
132 add_accel_group(uim->get_accel_group()); |
128 |
133 |
147 " <menuitem action='ViewZoom100' />" |
152 " <menuitem action='ViewZoom100' />" |
148 " <menuitem action='ViewZoomFit' />" |
153 " <menuitem action='ViewZoomFit' />" |
149 " </menu>" |
154 " </menu>" |
150 " <menu action='ShowMenu'>" |
155 " <menu action='ShowMenu'>" |
151 " <menuitem action='ShowMaps'/>" |
156 " <menuitem action='ShowMaps'/>" |
|
157 " <menuitem action='ShowDesign'/>" |
152 " </menu>" |
158 " </menu>" |
153 " <menu action='AlgoMenu'>" |
159 " <menu action='AlgoMenu'>" |
154 " <menuitem action='AlgoGeneral'/>" |
160 " <menuitem action='AlgoGeneral'/>" |
155 " <menuitem action='AlgoKruskal'/>" |
161 " <menuitem action='AlgoKruskal'/>" |
156 " </menu>" |
162 " </menu>" |
171 " <toolitem action='CreateEdge' />" |
177 " <toolitem action='CreateEdge' />" |
172 " <toolitem action='EraseItem' />" |
178 " <toolitem action='EraseItem' />" |
173 " <toolitem action='EditEdgeMap' />" |
179 " <toolitem action='EditEdgeMap' />" |
174 " <separator />" |
180 " <separator />" |
175 " <toolitem action='AddMap' />" |
181 " <toolitem action='AddMap' />" |
|
182 " <toolitem action='DesignGraph' />" |
176 " </toolbar>" |
183 " </toolbar>" |
177 "</ui>"; |
184 "</ui>"; |
178 |
185 |
179 uim->add_ui_from_string(ui_info); |
186 uim->add_ui_from_string(ui_info); |
180 |
187 |
446 { |
453 { |
447 tabs[active_tab]->createMapWin(tabnames[active_tab]); |
454 tabs[active_tab]->createMapWin(tabnames[active_tab]); |
448 } |
455 } |
449 } |
456 } |
450 |
457 |
|
458 void MainWin::createDesignWin() |
|
459 { |
|
460 if(active_tab!=-1) |
|
461 { |
|
462 tabs[active_tab]->createDesignWin(tabnames[active_tab]); |
|
463 } |
|
464 } |
|
465 |
451 void MainWin::createAlgoWin(int algoid) |
466 void MainWin::createAlgoWin(int algoid) |
452 { |
467 { |
453 AlgoWin * aw=new AlgoWin(algoid, tabnames); |
468 AlgoWin * aw=new AlgoWin(algoid, tabnames); |
454 aw->signal_closing().connect(sigc::mem_fun(*this, &MainWin::deRegisterAlgoWin)); |
469 aw->signal_closing().connect(sigc::mem_fun(*this, &MainWin::deRegisterAlgoWin)); |
455 aw->signal_maplist_needed().connect(sigc::mem_fun(*this, &MainWin::updateAlgoWinMaps)); |
470 aw->signal_maplist_needed().connect(sigc::mem_fun(*this, &MainWin::updateAlgoWinMaps)); |
534 double radius=radius_size->get_value(); |
549 double radius=radius_size->get_value(); |
535 bool zoomtrack=zoom_track->get_active(); |
550 bool zoomtrack=zoom_track->get_active(); |
536 bool autoscale=auto_scale->get_active(); |
551 bool autoscale=auto_scale->get_active(); |
537 tabs[active_tab]->setView(autoscale, zoomtrack, width, radius); |
552 tabs[active_tab]->setView(autoscale, zoomtrack, width, radius); |
538 } |
553 } |
|
554 |
|
555 void MainWin::reDesignGraph() |
|
556 { |
|
557 tabs[active_tab]->reDesignGraph(); |
|
558 } |