COIN-OR::LEMON - Graph Library

Changeset 1876:5ad84ad1b68f in lemon-0.x for gui/main_win.cc


Ignore:
Timestamp:
01/04/06 19:05:55 (14 years ago)
Author:
Hegyi Péter
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2451
Message:

Communication with algorithm window is developed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gui/main_win.cc

    r1872 r1876  
    105105  ag->add( Gtk::Action::create("AlgoGeneral", "_General"),
    106106           sigc::bind( sigc::mem_fun ( *this, &MainWin::createAlgoWin ), 0) );
     107  ag->add( Gtk::Action::create("AlgoKruskal", "_Kruskal"),
     108           sigc::bind( sigc::mem_fun ( *this, &MainWin::createAlgoWin ), 1) );
    107109
    108110  Gtk::RadioAction::Group tool_group;
     
    154156      "    <menu action='AlgoMenu'>"
    155157      "      <menuitem action='AlgoGeneral'/>"
     158      "      <menuitem action='AlgoKruskal'/>"
    156159      "    </menu>"
    157160      "  </menubar>"
     
    225228  set_title(tabnames[active_tab] + " - " + prog_name);
    226229  notebook.set_tab_label_text((Widget&)*(tabs[active_tab]), tabnames[active_tab]);
    227   updateAlgoWins();
     230  updateAlgoWinTabs();
    228231}
    229232
     
    247250  notebook.set_current_page(size);
    248251  set_tabtitle("unsaved file");
    249   updateAlgoWins();
     252  updateAlgoWinTabs();
    250253}
    251254
     
    307310        }
    308311
    309       updateAlgoWins();
     312      updateAlgoWinTabs();
    310313    }
    311314}
     
    405408void MainWin::createAlgoWin(int algoid)
    406409{
    407   AlgoWin * aw=new AlgoWin(algoid, tabnames);
     410  AlgoWin * aw=new AlgoWin(algoid, tabnames, tabs[0]->mapstorage.getNodeMapList(),tabs[0]->mapstorage.getEdgeMapList());
    408411  aw->signal_closing().connect(sigc::mem_fun(*this, &MainWin::deRegisterAlgoWin));
     412  aw->signal_maplist_needed().connect(sigc::mem_fun(*this, &MainWin::updateAlgoWinMaps));
    409413  aws.insert(aw);
    410414  aw->show();
    411415}
    412416
     417void MainWin::updateAlgoWinMaps(AlgoWin * awp, std::string tabname)
     418{
     419  int i=0;
     420  for(;(i<(int)tabnames.size())&&(tabnames[i]!=tabname);i++)
     421    {
     422    }
     423  awp->update_maplist(tabs[i]->mapstorage.getNodeMapList(),tabs[i]->mapstorage.getEdgeMapList());
     424}
     425
    413426void MainWin::deRegisterAlgoWin(AlgoWin * awp)
    414427{
     
    416429}
    417430
    418 void MainWin::updateAlgoWins()
     431void MainWin::updateAlgoWinTabs()
    419432{
    420433  std::set< AlgoWin* >::iterator awsi=aws.begin();
Note: See TracChangeset for help on using the changeset viewer.