COIN-OR::LEMON - Graph Library

Changeset 1871:3905d347112c in lemon-0.x


Ignore:
Timestamp:
01/03/06 18:30:22 (14 years ago)
Author:
Hegyi Péter
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2446
Message:

Coding of Algorithms has begun, but code is really-really ugly yet.

Location:
gui
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • gui/main_win.cc

    r1869 r1871  
    101101  ag->add( Gtk::Action::create("ShowMaps", "_Maps"),
    102102           sigc::mem_fun(*this, &MainWin::createMapWin));
     103
     104  ag->add( Gtk::Action::create("AlgoMenu", "_Algorithms") );
     105  ag->add( Gtk::Action::create("AlgoGeneral", "_General"),
     106           sigc::bind( sigc::mem_fun ( *this, &MainWin::createAlgoWin ), 0) );
    103107
    104108  Gtk::RadioAction::Group tool_group;
     
    147151      "    <menu action='ShowMenu'>"
    148152      "      <menuitem action='ShowMaps'/>"
     153      "    </menu>"
     154      "    <menu action='AlgoMenu'>"
     155      "      <menuitem action='AlgoGeneral'/>"
    149156      "    </menu>"
    150157      "  </menubar>"
     
    207214  set_title(tabnames[active_tab] + " - " + prog_name);
    208215  notebook.set_tab_label_text((Widget&)*(tabs[active_tab]), tabnames[active_tab]);
     216  updateAlgoWins();
    209217}
    210218
     
    229237  notebook.set_current_page(size);
    230238  set_tabtitle(tabnames[active_tab]);
     239  updateAlgoWins();
    231240}
    232241
     
    259268          for(int i=active_tab+1;i<size;i++)
    260269            {
     270              tabnames[i-1]=tabnames[i];
    261271              tabs[i-1]=tabs[i];
    262272            }
    263273        }
    264 
    265274      //if size==1 resize will delete the only element
    266275      tabs.resize(size-1);
     276      tabnames.resize(size-1);
    267277
    268278      int old_active_tab=active_tab;
     
    275285      //and this should be registrated in tabs vector,
    276286      //as well.
    277       if(old_active_tab==0)
     287      if((old_active_tab==0)&&(size!=1))
    278288        {
    279289          onChangeTab(NULL,0);
    280290        }
     291
     292      std::cout << "NAAAA" << std::endl;
    281293
    282294      //if this was the last page in notebook, there is
     
    286298          active_tab=-1;
    287299        }
     300
     301      updateAlgoWins();
    288302    }
    289303}
     
    381395}
    382396
     397void MainWin::createAlgoWin(int algoid)
     398{
     399  AlgoWin * aw=new AlgoWin(algoid, tabnames);
     400  aw->signal_closing().connect(sigc::mem_fun(*this, &MainWin::deRegisterAlgoWin));
     401  aws.insert(aw);
     402  aw->show();
     403}
     404
     405void MainWin::deRegisterAlgoWin(AlgoWin * awp)
     406{
     407  aws.erase(awp);
     408}
     409
     410void MainWin::updateAlgoWins()
     411{
     412  std::set< AlgoWin* >::iterator awsi=aws.begin();
     413  for(;awsi!=aws.end();awsi++)
     414    {
     415      (*awsi)->update_tablist(tabnames);
     416    }
     417}
     418
    383419void MainWin::changeEditorialTool(int tool)
    384420{
  • gui/main_win.h

    r1856 r1871  
    55
    66#include "all_include.h"
     7#include "algowin.h"
    78#include "map_win.h"
    89#include "new_map_win.h"
     
    2627  std::vector<NoteBookTab *> tabs;
    2728  std::vector<std::string> tabnames;
     29
     30  std::set< AlgoWin* > aws;
    2831
    2932public:
     
    6770  virtual void createMapWin();
    6871
     72  virtual void createAlgoWin(int);
     73  virtual void deRegisterAlgoWin(AlgoWin *);
     74  virtual void updateAlgoWins();
     75
    6976  virtual void changeEditorialTool(int);
    7077
Note: See TracChangeset for help on using the changeset viewer.