[1606] | 1 | #include "main_win.h" |
---|
[1862] | 2 | #include "guipixbufs.h" |
---|
[1442] | 3 | |
---|
[1849] | 4 | MainWin::MainWin() |
---|
[1442] | 5 | { |
---|
[1849] | 6 | set_title ("no file"); |
---|
[1442] | 7 | set_default_size(WIN_WIDTH,WIN_HEIGHT); |
---|
| 8 | add(vbox); |
---|
| 9 | |
---|
[1634] | 10 | // custom icons for the toolbar |
---|
| 11 | Glib::RefPtr<Gtk::IconFactory> p_icon_factory = Gtk::IconFactory::create(); |
---|
| 12 | |
---|
[1635] | 13 | Glib::RefPtr<Gdk::Pixbuf> p_move_pixbuf = Gdk::Pixbuf::create_from_inline( |
---|
| 14 | 2328, gui_icons_move); |
---|
| 15 | Glib::RefPtr<Gdk::Pixbuf> p_addnode_pixbuf = Gdk::Pixbuf::create_from_inline( |
---|
| 16 | 2328, gui_icons_addnode); |
---|
| 17 | Glib::RefPtr<Gdk::Pixbuf> p_addlink_pixbuf = Gdk::Pixbuf::create_from_inline( |
---|
| 18 | 2328, gui_icons_addlink); |
---|
| 19 | Glib::RefPtr<Gdk::Pixbuf> p_delete_pixbuf = Gdk::Pixbuf::create_from_inline( |
---|
| 20 | 2328, gui_icons_delete); |
---|
| 21 | Glib::RefPtr<Gdk::Pixbuf> p_editlink_pixbuf = Gdk::Pixbuf::create_from_inline( |
---|
| 22 | 2328, gui_icons_editlink); |
---|
| 23 | Glib::RefPtr<Gdk::Pixbuf> p_editnode_pixbuf = Gdk::Pixbuf::create_from_inline( |
---|
| 24 | 2328, gui_icons_editnode); |
---|
| 25 | Glib::RefPtr<Gdk::Pixbuf> p_newmap_pixbuf = Gdk::Pixbuf::create_from_inline( |
---|
| 26 | 2328, gui_icons_newmap); |
---|
[1634] | 27 | |
---|
| 28 | Gtk::IconSource move_icon_source; |
---|
[1635] | 29 | move_icon_source.set_pixbuf(p_move_pixbuf); |
---|
[1634] | 30 | Gtk::IconSet move_icon_set; |
---|
| 31 | move_icon_set.add_source(move_icon_source); |
---|
| 32 | p_icon_factory->add(Gtk::StockID("gd-move"), move_icon_set); |
---|
| 33 | |
---|
| 34 | Gtk::IconSource addnode_icon_source; |
---|
[1635] | 35 | addnode_icon_source.set_pixbuf(p_addnode_pixbuf); |
---|
[1634] | 36 | Gtk::IconSet addnode_icon_set; |
---|
| 37 | addnode_icon_set.add_source(addnode_icon_source); |
---|
| 38 | p_icon_factory->add(Gtk::StockID("gd-addnode"), addnode_icon_set); |
---|
| 39 | |
---|
| 40 | Gtk::IconSource addlink_icon_source; |
---|
[1635] | 41 | addlink_icon_source.set_pixbuf(p_addlink_pixbuf); |
---|
[1634] | 42 | Gtk::IconSet addlink_icon_set; |
---|
| 43 | addlink_icon_set.add_source(addlink_icon_source); |
---|
| 44 | p_icon_factory->add(Gtk::StockID("gd-addlink"), addlink_icon_set); |
---|
| 45 | |
---|
| 46 | Gtk::IconSource delete_icon_source; |
---|
[1635] | 47 | delete_icon_source.set_pixbuf(p_delete_pixbuf); |
---|
[1634] | 48 | Gtk::IconSet delete_icon_set; |
---|
| 49 | delete_icon_set.add_source(delete_icon_source); |
---|
| 50 | p_icon_factory->add(Gtk::StockID("gd-delete"), delete_icon_set); |
---|
| 51 | |
---|
| 52 | Gtk::IconSource editlink_icon_source; |
---|
[1635] | 53 | editlink_icon_source.set_pixbuf(p_editlink_pixbuf); |
---|
[1634] | 54 | Gtk::IconSet editlink_icon_set; |
---|
| 55 | editlink_icon_set.add_source(editlink_icon_source); |
---|
| 56 | p_icon_factory->add(Gtk::StockID("gd-editlink"), editlink_icon_set); |
---|
| 57 | |
---|
| 58 | Gtk::IconSource editnode_icon_source; |
---|
[1635] | 59 | editnode_icon_source.set_pixbuf(p_editnode_pixbuf); |
---|
[1634] | 60 | Gtk::IconSet editnode_icon_set; |
---|
| 61 | editnode_icon_set.add_source(editnode_icon_source); |
---|
| 62 | p_icon_factory->add(Gtk::StockID("gd-editnode"), editnode_icon_set); |
---|
| 63 | |
---|
| 64 | Gtk::IconSource newmap_icon_source; |
---|
[1635] | 65 | newmap_icon_source.set_pixbuf(p_newmap_pixbuf); |
---|
[1634] | 66 | Gtk::IconSet newmap_icon_set; |
---|
| 67 | newmap_icon_set.add_source(newmap_icon_source); |
---|
| 68 | p_icon_factory->add(Gtk::StockID("gd-newmap"), newmap_icon_set); |
---|
| 69 | |
---|
| 70 | p_icon_factory->add_default(); |
---|
| 71 | |
---|
[1442] | 72 | ag=Gtk::ActionGroup::create(); |
---|
| 73 | |
---|
| 74 | ag->add( Gtk::Action::create("FileMenu", "_File") ); |
---|
[1869] | 75 | ag->add( Gtk::Action::create("FileNew", Gtk::Stock::NEW), |
---|
[1849] | 76 | sigc::mem_fun(*this, &MainWin::newTab)); |
---|
[1442] | 77 | ag->add( Gtk::Action::create("FileOpen", Gtk::Stock::OPEN), |
---|
| 78 | sigc::mem_fun(*this, &MainWin::openFile)); |
---|
[1869] | 79 | ag->add( Gtk::Action::create("FileClearTab", "Clear Tab"), |
---|
| 80 | sigc::mem_fun(*this, &MainWin::newFile)); |
---|
[1442] | 81 | ag->add( Gtk::Action::create("FileSave", Gtk::Stock::SAVE), |
---|
| 82 | sigc::mem_fun(*this, &MainWin::saveFile)); |
---|
| 83 | ag->add( Gtk::Action::create("FileSaveAs", Gtk::Stock::SAVE_AS), |
---|
| 84 | sigc::mem_fun(*this, &MainWin::saveFileAs)); |
---|
[1606] | 85 | ag->add( Gtk::Action::create("Close", Gtk::Stock::CLOSE), |
---|
[1869] | 86 | sigc::mem_fun(*this, &MainWin::closeTab)); |
---|
[1606] | 87 | ag->add( Gtk::Action::create("Quit", Gtk::Stock::QUIT), |
---|
[1598] | 88 | sigc::mem_fun(*this, &MainWin::hide)); |
---|
[1442] | 89 | |
---|
| 90 | ag->add( Gtk::Action::create("ViewMenu", "_View") ); |
---|
| 91 | ag->add( Gtk::Action::create("ViewZoomIn", Gtk::Stock::ZOOM_IN), |
---|
[1849] | 92 | sigc::mem_fun(*this, &MainWin::zoomIn)); |
---|
[1442] | 93 | ag->add( Gtk::Action::create("ViewZoomOut", Gtk::Stock::ZOOM_OUT), |
---|
[1849] | 94 | sigc::mem_fun(*this, &MainWin::zoomOut)); |
---|
[1442] | 95 | ag->add( Gtk::Action::create("ViewZoomFit", Gtk::Stock::ZOOM_FIT), |
---|
[1849] | 96 | sigc::mem_fun(*this, &MainWin::zoomFit)); |
---|
[1442] | 97 | ag->add( Gtk::Action::create("ViewZoom100", Gtk::Stock::ZOOM_100), |
---|
[1849] | 98 | sigc::mem_fun(*this, &MainWin::zoom100)); |
---|
[1442] | 99 | |
---|
| 100 | ag->add( Gtk::Action::create("ShowMenu", "_Show") ); |
---|
| 101 | ag->add( Gtk::Action::create("ShowMaps", "_Maps"), |
---|
[1838] | 102 | sigc::mem_fun(*this, &MainWin::createMapWin)); |
---|
[1442] | 103 | |
---|
[1606] | 104 | Gtk::RadioAction::Group tool_group; |
---|
[1634] | 105 | ag->add( Gtk::RadioAction::create(tool_group, "MoveItem", Gtk::StockID("gd-move"), "Move"), |
---|
[1849] | 106 | sigc::bind( sigc::mem_fun ( *this, &MainWin::changeEditorialTool ), 0) ); |
---|
[1634] | 107 | ag->add( Gtk::RadioAction::create(tool_group, "CreateNode", Gtk::StockID("gd-addnode"), "Create node"), |
---|
[1849] | 108 | sigc::bind( sigc::mem_fun ( *this, &MainWin::changeEditorialTool ), 1) ); |
---|
[1634] | 109 | ag->add( Gtk::RadioAction::create(tool_group, "CreateEdge", Gtk::StockID("gd-addlink"), "Create edge"), |
---|
[1849] | 110 | sigc::bind( sigc::mem_fun ( *this, &MainWin::changeEditorialTool ), 2) ); |
---|
[1634] | 111 | ag->add( Gtk::RadioAction::create(tool_group, "EraseItem", Gtk::StockID("gd-delete"), "Delete"), |
---|
[1849] | 112 | sigc::bind( sigc::mem_fun ( *this, &MainWin::changeEditorialTool ), 3) ); |
---|
[1634] | 113 | |
---|
| 114 | ag->add( Gtk::RadioAction::create(tool_group, "EditEdgeMap", Gtk::StockID("gd-editlink"), "Edit edge map"), |
---|
[1849] | 115 | sigc::bind( sigc::mem_fun ( *this, &MainWin::changeEditorialTool ), 4) ); |
---|
[1634] | 116 | ag->add( Gtk::RadioAction::create(tool_group, "EditNodeMap", Gtk::StockID("gd-editnode"), "Edit node map"), |
---|
[1849] | 117 | sigc::bind( sigc::mem_fun ( *this, &MainWin::changeEditorialTool ), 5) ); |
---|
[1634] | 118 | |
---|
| 119 | ag->add( Gtk::Action::create("AddMap", Gtk::StockID("gd-newmap")), |
---|
[1849] | 120 | sigc::mem_fun ( *this , &MainWin::createNewMapWin ) ); |
---|
[1502] | 121 | |
---|
[1442] | 122 | uim=Gtk::UIManager::create(); |
---|
| 123 | uim->insert_action_group(ag); |
---|
| 124 | add_accel_group(uim->get_accel_group()); |
---|
| 125 | |
---|
| 126 | try |
---|
| 127 | { |
---|
| 128 | |
---|
| 129 | Glib::ustring ui_info = |
---|
| 130 | "<ui>" |
---|
| 131 | " <menubar name='MenuBar'>" |
---|
| 132 | " <menu action='FileMenu'>" |
---|
| 133 | " <menuitem action='FileNew'/>" |
---|
| 134 | " <menuitem action='FileOpen'/>" |
---|
[1869] | 135 | " <menuitem action='FileClearTab'/>" |
---|
[1442] | 136 | " <menuitem action='FileSave'/>" |
---|
| 137 | " <menuitem action='FileSaveAs'/>" |
---|
[1606] | 138 | " <menuitem action='Close'/>" |
---|
| 139 | " <menuitem action='Quit'/>" |
---|
[1442] | 140 | " </menu>" |
---|
| 141 | " <menu action='ViewMenu'>" |
---|
| 142 | " <menuitem action='ViewZoomIn' />" |
---|
| 143 | " <menuitem action='ViewZoomOut' />" |
---|
| 144 | " <menuitem action='ViewZoom100' />" |
---|
[1777] | 145 | " <menuitem action='ViewZoomFit' />" |
---|
[1442] | 146 | " </menu>" |
---|
| 147 | " <menu action='ShowMenu'>" |
---|
| 148 | " <menuitem action='ShowMaps'/>" |
---|
| 149 | " </menu>" |
---|
| 150 | " </menubar>" |
---|
| 151 | " <toolbar name='ToolBar'>" |
---|
| 152 | " <toolitem action='FileNew' />" |
---|
| 153 | " <toolitem action='FileOpen' />" |
---|
| 154 | " <toolitem action='FileSave' />" |
---|
[1606] | 155 | " <toolitem action='Close' />" |
---|
[1442] | 156 | " <separator />" |
---|
| 157 | " <toolitem action='ViewZoomIn' />" |
---|
| 158 | " <toolitem action='ViewZoomOut' />" |
---|
| 159 | " <toolitem action='ViewZoom100' />" |
---|
[1777] | 160 | " <toolitem action='ViewZoomFit' />" |
---|
[1502] | 161 | " <separator />" |
---|
[1606] | 162 | " <toolitem action='MoveItem' />" |
---|
[1502] | 163 | " <toolitem action='CreateNode' />" |
---|
| 164 | " <toolitem action='CreateEdge' />" |
---|
| 165 | " <toolitem action='EraseItem' />" |
---|
[1550] | 166 | " <toolitem action='EditEdgeMap' />" |
---|
| 167 | " <toolitem action='EditNodeMap' />" |
---|
[1634] | 168 | " <separator />" |
---|
[1592] | 169 | " <toolitem action='AddMap' />" |
---|
[1442] | 170 | " </toolbar>" |
---|
| 171 | "</ui>"; |
---|
| 172 | |
---|
| 173 | uim->add_ui_from_string(ui_info); |
---|
| 174 | |
---|
| 175 | } |
---|
| 176 | catch(const Glib::Error& ex) |
---|
| 177 | { |
---|
| 178 | std::cerr << "building menus failed: " << ex.what(); |
---|
| 179 | } |
---|
| 180 | |
---|
| 181 | Gtk::Widget* menubar = uim->get_widget("/MenuBar"); |
---|
| 182 | if (menubar){ |
---|
| 183 | vbox.pack_start(*menubar, Gtk::PACK_SHRINK); |
---|
| 184 | } |
---|
| 185 | |
---|
| 186 | Gtk::Widget* toolbar = uim->get_widget("/ToolBar"); |
---|
| 187 | if (toolbar) |
---|
| 188 | { |
---|
| 189 | static_cast<Gtk::Toolbar*>(toolbar)->set_toolbar_style(Gtk::TOOLBAR_ICONS); |
---|
| 190 | vbox.pack_start(*toolbar, Gtk::PACK_SHRINK); |
---|
| 191 | } |
---|
| 192 | |
---|
[1601] | 193 | tooltips.set_tip(*(uim->get_widget("/ToolBar/CreateNode")),"Create Node"); |
---|
| 194 | tooltips.enable(); |
---|
[1442] | 195 | |
---|
[1849] | 196 | active_tab=-1; |
---|
| 197 | notebook.signal_switch_page().connect(sigc::mem_fun(*this, &MainWin::onChangeTab)); |
---|
| 198 | |
---|
| 199 | vbox.pack_start(notebook); |
---|
| 200 | |
---|
[1442] | 201 | show_all_children(); |
---|
| 202 | } |
---|
| 203 | |
---|
[1849] | 204 | void MainWin::set_tabtitle(std::string name) |
---|
[1616] | 205 | { |
---|
[1849] | 206 | tabnames[active_tab]=name; |
---|
| 207 | set_title(tabnames[active_tab] + " - " + prog_name); |
---|
| 208 | notebook.set_tab_label_text((Widget&)*(tabs[active_tab]), tabnames[active_tab]); |
---|
| 209 | } |
---|
| 210 | |
---|
| 211 | void MainWin::readFile(const std::string & filename) |
---|
| 212 | { |
---|
| 213 | newTab(); |
---|
| 214 | tabs[active_tab]->readFile(filename); |
---|
| 215 | } |
---|
| 216 | |
---|
| 217 | void MainWin::newTab() |
---|
| 218 | { |
---|
| 219 | int size=tabs.size(); |
---|
| 220 | tabs.resize(size+1); |
---|
| 221 | tabnames.resize(size+1); |
---|
| 222 | active_tab=size; |
---|
| 223 | tabs[active_tab]=new NoteBookTab(); |
---|
| 224 | tabnames[active_tab]="unsaved file"; |
---|
| 225 | tabs[active_tab]->signal_title_ch().connect(sigc::mem_fun(*this, &MainWin::set_tabtitle)); |
---|
| 226 | tabs[active_tab]->signal_newmap_needed().connect(sigc::mem_fun(*this, &MainWin::createNewMapWinAfterSignal)); |
---|
| 227 | tabs[active_tab]->gd_canvas->changeEditorialTool(active_tool); |
---|
| 228 | notebook.append_page((Gtk::Widget&)(*(tabs[active_tab]))); |
---|
| 229 | notebook.set_current_page(size); |
---|
| 230 | set_tabtitle(tabnames[active_tab]); |
---|
| 231 | } |
---|
| 232 | |
---|
[1856] | 233 | void MainWin::closeTab() |
---|
| 234 | { |
---|
| 235 | if(active_tab!=-1) |
---|
| 236 | { |
---|
[1869] | 237 | if (tabs[active_tab]->mapstorage.modified) |
---|
| 238 | { |
---|
| 239 | Gtk::MessageDialog mdialog("<b>Save changes before closing?</b>", true, |
---|
| 240 | Gtk::MESSAGE_WARNING, Gtk::BUTTONS_NONE); |
---|
| 241 | mdialog.add_button("Close file _without Saving", Gtk::RESPONSE_REJECT); |
---|
| 242 | mdialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); |
---|
| 243 | mdialog.add_button(Gtk::Stock::SAVE, Gtk::RESPONSE_ACCEPT); |
---|
| 244 | switch (mdialog.run()) |
---|
| 245 | { |
---|
| 246 | case Gtk::RESPONSE_CANCEL: |
---|
| 247 | return; |
---|
| 248 | case Gtk::RESPONSE_REJECT: |
---|
| 249 | break; |
---|
| 250 | case Gtk::RESPONSE_ACCEPT: |
---|
| 251 | tabs[active_tab]->saveFile(); |
---|
| 252 | break; |
---|
| 253 | } |
---|
| 254 | } |
---|
[1856] | 255 | //tabs vector will be decreased with the deleted value |
---|
| 256 | int size=tabs.size(); |
---|
| 257 | if(size>1) |
---|
| 258 | { |
---|
| 259 | for(int i=active_tab+1;i<size;i++) |
---|
| 260 | { |
---|
| 261 | tabs[i-1]=tabs[i]; |
---|
| 262 | } |
---|
| 263 | } |
---|
| 264 | |
---|
| 265 | //if size==1 resize will delete the only element |
---|
| 266 | tabs.resize(size-1); |
---|
| 267 | |
---|
| 268 | int old_active_tab=active_tab; |
---|
| 269 | notebook.remove_page(active_tab); |
---|
| 270 | |
---|
| 271 | //If the first tab was active, upon delete notebook |
---|
| 272 | //will first switch one tab upper and not lower like |
---|
| 273 | //in the case, when not the first tab was active. |
---|
| 274 | //But after deletion it will become the first tab, |
---|
| 275 | //and this should be registrated in tabs vector, |
---|
| 276 | //as well. |
---|
| 277 | if(old_active_tab==0) |
---|
| 278 | { |
---|
| 279 | onChangeTab(NULL,0); |
---|
| 280 | } |
---|
| 281 | |
---|
| 282 | //if this was the last page in notebook, there is |
---|
| 283 | //no active_tab now |
---|
| 284 | if(size==1) |
---|
| 285 | { |
---|
| 286 | active_tab=-1; |
---|
| 287 | } |
---|
| 288 | } |
---|
| 289 | } |
---|
| 290 | |
---|
[1849] | 291 | void MainWin::onChangeTab(GtkNotebookPage* page, guint page_num) |
---|
| 292 | { |
---|
| 293 | page=page; |
---|
| 294 | active_tab=page_num; |
---|
| 295 | tabs[active_tab]->gd_canvas->changeEditorialTool(active_tool); |
---|
| 296 | set_title(tabnames[active_tab]); |
---|
| 297 | } |
---|
| 298 | |
---|
| 299 | void MainWin::onCloseTab() |
---|
| 300 | { |
---|
[1616] | 301 | } |
---|
| 302 | |
---|
[1442] | 303 | void MainWin::newFile() |
---|
| 304 | { |
---|
[1849] | 305 | if(active_tab!=-1) |
---|
[1606] | 306 | { |
---|
[1849] | 307 | tabs[active_tab]->newFile(); |
---|
[1606] | 308 | } |
---|
[1442] | 309 | } |
---|
[1849] | 310 | |
---|
[1442] | 311 | void MainWin::openFile() |
---|
| 312 | { |
---|
[1849] | 313 | if(active_tab!=-1) |
---|
[1606] | 314 | { |
---|
[1849] | 315 | tabs[active_tab]->openFile(); |
---|
[1606] | 316 | } |
---|
[1442] | 317 | } |
---|
[1849] | 318 | |
---|
[1442] | 319 | void MainWin::saveFile() |
---|
| 320 | { |
---|
[1849] | 321 | if(active_tab!=-1) |
---|
| 322 | { |
---|
| 323 | tabs[active_tab]->saveFile(); |
---|
| 324 | } |
---|
[1442] | 325 | } |
---|
[1849] | 326 | |
---|
[1442] | 327 | void MainWin::saveFileAs() |
---|
| 328 | { |
---|
[1849] | 329 | if(active_tab!=-1) |
---|
| 330 | { |
---|
| 331 | tabs[active_tab]->saveFileAs(); |
---|
| 332 | } |
---|
[1442] | 333 | } |
---|
[1849] | 334 | |
---|
[1606] | 335 | void MainWin::close() |
---|
| 336 | { |
---|
[1849] | 337 | if(active_tab!=-1) |
---|
[1606] | 338 | { |
---|
[1849] | 339 | tabs[active_tab]->close(); |
---|
[1838] | 340 | } |
---|
[1837] | 341 | } |
---|
| 342 | |
---|
[1849] | 343 | void MainWin::zoomIn() |
---|
[1837] | 344 | { |
---|
[1849] | 345 | if(active_tab!=-1) |
---|
[1838] | 346 | { |
---|
[1849] | 347 | tabs[active_tab]->gd_canvas->zoomIn(); |
---|
| 348 | } |
---|
| 349 | } |
---|
| 350 | |
---|
| 351 | void MainWin::zoomOut() |
---|
| 352 | { |
---|
| 353 | if(active_tab!=-1) |
---|
| 354 | { |
---|
| 355 | tabs[active_tab]->gd_canvas->zoomOut(); |
---|
| 356 | } |
---|
| 357 | } |
---|
| 358 | |
---|
| 359 | void MainWin::zoomFit() |
---|
| 360 | { |
---|
| 361 | if(active_tab!=-1) |
---|
| 362 | { |
---|
| 363 | tabs[active_tab]->gd_canvas->zoomFit(); |
---|
| 364 | } |
---|
| 365 | } |
---|
| 366 | |
---|
| 367 | void MainWin::zoom100() |
---|
| 368 | { |
---|
| 369 | if(active_tab!=-1) |
---|
| 370 | { |
---|
| 371 | tabs[active_tab]->gd_canvas->zoom100(); |
---|
[1838] | 372 | } |
---|
[1837] | 373 | } |
---|
[1838] | 374 | |
---|
| 375 | void MainWin::createMapWin() |
---|
| 376 | { |
---|
[1849] | 377 | if(active_tab!=-1) |
---|
[1838] | 378 | { |
---|
[1849] | 379 | tabs[active_tab]->createMapWin(tabnames[active_tab]); |
---|
[1838] | 380 | } |
---|
| 381 | } |
---|
| 382 | |
---|
[1849] | 383 | void MainWin::changeEditorialTool(int tool) |
---|
[1838] | 384 | { |
---|
[1849] | 385 | active_tool=tool; |
---|
| 386 | if(active_tab!=-1) |
---|
| 387 | { |
---|
| 388 | tabs[active_tab]->gd_canvas->changeEditorialTool(tool); |
---|
| 389 | } |
---|
[1838] | 390 | } |
---|
[1849] | 391 | |
---|
| 392 | void MainWin::createNewMapWin() |
---|
| 393 | { |
---|
| 394 | if(active_tab!=-1) |
---|
| 395 | { |
---|
| 396 | NewMapWin * nmw=new NewMapWin("Create New Map - "+tabnames[active_tab], *(tabs[active_tab])); |
---|
| 397 | nmw->show(); |
---|
| 398 | } |
---|
| 399 | } |
---|
| 400 | |
---|
| 401 | void MainWin::createNewMapWinAfterSignal(NoteBookTab * nbt, bool itisedge) |
---|
| 402 | { |
---|
| 403 | std::vector<NoteBookTab*>::iterator nbti=tabs.begin(); |
---|
| 404 | int i=0; |
---|
| 405 | for(;nbti!=tabs.end();nbti++) |
---|
| 406 | { |
---|
| 407 | if(*nbti!=nbt) |
---|
| 408 | { |
---|
| 409 | i++; |
---|
| 410 | } |
---|
| 411 | else |
---|
| 412 | { |
---|
| 413 | continue; |
---|
| 414 | } |
---|
| 415 | } |
---|
| 416 | NewMapWin * nmw=new NewMapWin("Create New Map - "+tabnames[i], *nbt, itisedge, false); |
---|
| 417 | nmw->run(); |
---|
| 418 | } |
---|