Changeset 1871:3905d347112c in lemon-0.x for gui/main_win.cc
- Timestamp:
- 01/03/06 18:30:22 (17 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2446
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gui/main_win.cc
r1869 r1871 101 101 ag->add( Gtk::Action::create("ShowMaps", "_Maps"), 102 102 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) ); 103 107 104 108 Gtk::RadioAction::Group tool_group; … … 147 151 " <menu action='ShowMenu'>" 148 152 " <menuitem action='ShowMaps'/>" 153 " </menu>" 154 " <menu action='AlgoMenu'>" 155 " <menuitem action='AlgoGeneral'/>" 149 156 " </menu>" 150 157 " </menubar>" … … 207 214 set_title(tabnames[active_tab] + " - " + prog_name); 208 215 notebook.set_tab_label_text((Widget&)*(tabs[active_tab]), tabnames[active_tab]); 216 updateAlgoWins(); 209 217 } 210 218 … … 229 237 notebook.set_current_page(size); 230 238 set_tabtitle(tabnames[active_tab]); 239 updateAlgoWins(); 231 240 } 232 241 … … 259 268 for(int i=active_tab+1;i<size;i++) 260 269 { 270 tabnames[i-1]=tabnames[i]; 261 271 tabs[i-1]=tabs[i]; 262 272 } 263 273 } 264 265 274 //if size==1 resize will delete the only element 266 275 tabs.resize(size-1); 276 tabnames.resize(size-1); 267 277 268 278 int old_active_tab=active_tab; … … 275 285 //and this should be registrated in tabs vector, 276 286 //as well. 277 if( old_active_tab==0)287 if((old_active_tab==0)&&(size!=1)) 278 288 { 279 289 onChangeTab(NULL,0); 280 290 } 291 292 std::cout << "NAAAA" << std::endl; 281 293 282 294 //if this was the last page in notebook, there is … … 286 298 active_tab=-1; 287 299 } 300 301 updateAlgoWins(); 288 302 } 289 303 } … … 381 395 } 382 396 397 void 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 405 void MainWin::deRegisterAlgoWin(AlgoWin * awp) 406 { 407 aws.erase(awp); 408 } 409 410 void 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 383 419 void MainWin::changeEditorialTool(int tool) 384 420 {
Note: See TracChangeset
for help on using the changeset viewer.