Changeset 1869:52f5a7f9fb48 in lemon-0.x for gui/main_win.cc
- Timestamp:
- 01/03/06 15:56:45 (18 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2444
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gui/main_win.cc
r1862 r1869 73 73 74 74 ag->add( Gtk::Action::create("FileMenu", "_File") ); 75 ag->add( Gtk::Action::create("FileNew Tab", "New _Tab"),75 ag->add( Gtk::Action::create("FileNew", Gtk::Stock::NEW), 76 76 sigc::mem_fun(*this, &MainWin::newTab)); 77 ag->add( Gtk::Action::create("FileCloseTab", "_Close Tab"),78 sigc::mem_fun(*this, &MainWin::closeTab));79 ag->add( Gtk::Action::create("FileNew", Gtk::Stock::NEW),80 sigc::mem_fun(*this, &MainWin::newFile));81 77 ag->add( Gtk::Action::create("FileOpen", Gtk::Stock::OPEN), 82 78 sigc::mem_fun(*this, &MainWin::openFile)); 79 ag->add( Gtk::Action::create("FileClearTab", "Clear Tab"), 80 sigc::mem_fun(*this, &MainWin::newFile)); 83 81 ag->add( Gtk::Action::create("FileSave", Gtk::Stock::SAVE), 84 82 sigc::mem_fun(*this, &MainWin::saveFile)); … … 86 84 sigc::mem_fun(*this, &MainWin::saveFileAs)); 87 85 ag->add( Gtk::Action::create("Close", Gtk::Stock::CLOSE), 88 sigc::mem_fun(*this, &MainWin::close ));86 sigc::mem_fun(*this, &MainWin::closeTab)); 89 87 ag->add( Gtk::Action::create("Quit", Gtk::Stock::QUIT), 90 88 sigc::mem_fun(*this, &MainWin::hide)); … … 133 131 " <menubar name='MenuBar'>" 134 132 " <menu action='FileMenu'>" 135 " <menuitem action='FileNewTab'/>"136 " <menuitem action='FileCloseTab'/>"137 133 " <menuitem action='FileNew'/>" 138 134 " <menuitem action='FileOpen'/>" 135 " <menuitem action='FileClearTab'/>" 139 136 " <menuitem action='FileSave'/>" 140 137 " <menuitem action='FileSaveAs'/>" … … 238 235 if(active_tab!=-1) 239 236 { 237 if (tabs[active_tab]->mapstorage.modified) 238 { 239 Gtk::MessageDialog mdialog("<b>Save changes before closing?</b>", true, 240 Gtk::MESSAGE_WARNING, Gtk::BUTTONS_NONE); 241 mdialog.add_button("Close file _without Saving", Gtk::RESPONSE_REJECT); 242 mdialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); 243 mdialog.add_button(Gtk::Stock::SAVE, Gtk::RESPONSE_ACCEPT); 244 switch (mdialog.run()) 245 { 246 case Gtk::RESPONSE_CANCEL: 247 return; 248 case Gtk::RESPONSE_REJECT: 249 break; 250 case Gtk::RESPONSE_ACCEPT: 251 tabs[active_tab]->saveFile(); 252 break; 253 } 254 } 240 255 //tabs vector will be decreased with the deleted value 241 256 int size=tabs.size();
Note: See TracChangeset
for help on using the changeset viewer.