Changeset 95:628c0b383d2f in glemon-0.x for main_win.cc
- Timestamp:
- 11/30/05 14:24:23 (18 years ago)
- Branch:
- gui
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk/gui@2391
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main_win.cc
r94 r95 2 2 #include "icons/guipixbufs.h" 3 3 4 MainWin::MainWin() 5 { 6 mapwin=new MapWin("Map Setup", mapstorage.getEdgeMapList(), mapstorage.getNodeMapList(), *this); 4 MainWin::MainWin():mapwinexists(false) 5 { 7 6 gd_canvas=new GraphDisplayerCanvas(*this); 8 7 … … 106 105 ag->add( Gtk::Action::create("ShowMenu", "_Show") ); 107 106 ag->add( Gtk::Action::create("ShowMaps", "_Maps"), 108 sigc::mem_fun(*(this->mapwin), &MapWin::show));107 sigc::mem_fun(*this, &MainWin::createMapWin)); 109 108 110 109 Gtk::RadioAction::Group tool_group; … … 213 212 mapstorage.modified = false; 214 213 gd_canvas->drawGraph(); 215 mapwin->update(mapstorage.getEdgeMapList(), mapstorage.getNodeMapList()); 214 if(mapwinexists) 215 { 216 mapwin->update(mapstorage.getEdgeMapList(), mapstorage.getNodeMapList()); 217 } 216 218 set_title(Glib::filename_display_basename(file) + " - " + prog_name); 217 219 } … … 239 241 gd_canvas->clear(); 240 242 mapstorage.clear(); 241 mapwin->update(mapstorage.getEdgeMapList(), mapstorage.getNodeMapList()); 243 if(mapwinexists) 244 { 245 mapwin->update(mapstorage.getEdgeMapList(), mapstorage.getNodeMapList()); 246 } 242 247 set_title("unsaved file - " + prog_name); 243 248 } … … 276 281 mapstorage.modified = false; 277 282 gd_canvas->drawGraph(); 278 mapwin->update(mapstorage.getEdgeMapList(), mapstorage.getNodeMapList()); 283 if(mapwinexists) 284 { 285 mapwin->update(mapstorage.getEdgeMapList(), mapstorage.getNodeMapList()); 286 } 279 287 set_title(Glib::filename_display_basename(filename) + " - " + prog_name); 280 288 } … … 333 341 gd_canvas->clear(); 334 342 mapstorage.clear(); 335 mapwin->update(mapstorage.getEdgeMapList(), mapstorage.getNodeMapList()); 343 if(mapwinexists) 344 { 345 mapwin->update(mapstorage.getEdgeMapList(), mapstorage.getNodeMapList()); 346 } 336 347 set_title("unsaved file - " + prog_name); 337 348 } … … 360 371 void MainWin::registerNewEdgeMap(std::string mapname) 361 372 { 362 mapwin->registerNewEdgeMap(mapname); 373 if(mapwinexists) 374 { 375 mapwin->registerNewEdgeMap(mapname); 376 } 363 377 } 364 378 365 379 void MainWin::registerNewNodeMap(std::string mapname) 366 380 { 367 mapwin->registerNewNodeMap(mapname); 368 } 381 if(mapwinexists) 382 { 383 mapwin->registerNewNodeMap(mapname); 384 } 385 } 386 387 void MainWin::createMapWin() 388 { 389 if(!mapwinexists) 390 { 391 mapwin=new MapWin("Map Setup", mapstorage.getEdgeMapList(), mapstorage.getNodeMapList(), *this); 392 mapwin->show(); 393 mapwinexists=true; 394 } 395 } 396 397 void MainWin::closeMapWin() 398 { 399 mapwinexists=false; 400 delete mapwin; 401 }
Note: See TracChangeset
for help on using the changeset viewer.