COIN-OR::LEMON - Graph Library

Changeset 1872:3b7694cf0a08 in lemon-0.x for gui


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

Best feature ever\! Name of tabs are different from now on\!

Location:
gui
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • gui/main_win.cc

    r1871 r1872  
    211211void MainWin::set_tabtitle(std::string name)
    212212{
    213   tabnames[active_tab]=name;
     213  if(strinst.find(name)==strinst.end())
     214    {
     215      tabnames[active_tab]=name;
     216      strinst[name]=1;
     217    }
     218  else
     219    {
     220      strinst[name]++;
     221      std::ostringstream o;
     222      o << strinst[name];
     223      tabnames[active_tab]=name+" - "+o.str();
     224    }
    214225  set_title(tabnames[active_tab] + " - " + prog_name);
    215226  notebook.set_tab_label_text((Widget&)*(tabs[active_tab]), tabnames[active_tab]);
     
    230241  active_tab=size;
    231242  tabs[active_tab]=new NoteBookTab();
    232   tabnames[active_tab]="unsaved file";
    233243  tabs[active_tab]->signal_title_ch().connect(sigc::mem_fun(*this, &MainWin::set_tabtitle));
    234244  tabs[active_tab]->signal_newmap_needed().connect(sigc::mem_fun(*this, &MainWin::createNewMapWinAfterSignal));
     
    236246  notebook.append_page((Gtk::Widget&)(*(tabs[active_tab])));
    237247  notebook.set_current_page(size);
    238   set_tabtitle(tabnames[active_tab]);
     248  set_tabtitle("unsaved file");
    239249  updateAlgoWins();
    240250}
     
    290300        }
    291301
    292       std::cout << "NAAAA" << std::endl;
    293 
    294302      //if this was the last page in notebook, there is
    295303      //no active_tab now
  • gui/main_win.h

    r1871 r1872  
    2727  std::vector<NoteBookTab *> tabs;
    2828  std::vector<std::string> tabnames;
     29
     30  std::map<std::string, int> strinst;
    2931
    3032  std::set< AlgoWin* > aws;
Note: See TracChangeset for help on using the changeset viewer.