3 MainWin::MainWin(const std::string& title, Graph & graph, CoordinatesMap & cm, MapStorage & ms):mapwin("Map Setup", ms, gd_canvas),gd_canvas(graph, cm, ms)
6 set_default_size(WIN_WIDTH,WIN_HEIGHT);
9 ag=Gtk::ActionGroup::create();
10 ag->add( Gtk::Action::create("ShowMenu", "_Show") );
11 ag->add( Gtk::Action::create("ShowMaps", "_Maps"), sigc::mem_fun(*this, &MainWin::showMaps));
12 ag->add( Gtk::Action::create("FileMenu", "_File") );
13 ag->add( Gtk::Action::create("FileQuit", "_Quit"), sigc::mem_fun(*this, &MainWin::quit));
14 ag->add( Gtk::Action::create("ZoomMenu", "_Zoom") );
15 ag->add( Gtk::Action::create("ZoomRezoom", "_Rezoom"), sigc::mem_fun(*this, &MainWin::rezoom)); //!!!!!!
17 uim=Gtk::UIManager::create();
18 uim->insert_action_group(ag);
19 add_accel_group(uim->get_accel_group());
24 Glib::ustring ui_info =
26 " <menubar name='MenuBar'>"
27 " <menu action='FileMenu'>"
28 " <menuitem action='FileQuit'/>"
30 " <menu action='ShowMenu'>"
31 " <menuitem action='ShowMaps'/>"
33 " <menu action='ZoomMenu'>"
34 " <menuitem action='ZoomRezoom'/>"
39 uim->add_ui_from_string(ui_info);
42 catch(const Glib::Error& ex)
44 std::cerr << "building menus failed: " << ex.what();
47 Gtk::Widget* menubar = uim->get_widget("/MenuBar");
48 if(menubar)vbox.pack_start(*menubar, Gtk::PACK_SHRINK);
50 vbox.pack_start(gd_canvas);
55 void MainWin::showMaps()
65 void MainWin::rezoom()