1 #include <main_win.h> |
1 #include <main_win.h> |
2 |
2 |
3 MainWin::MainWin(const std::string& title, Graph & graph, CoordinatesMap & cm, |
3 MainWin::MainWin(const std::string& title, Graph & graph, CoordinatesMap & cm, |
4 MapStorage & ms):mapwin("Map Setup", ms, gd_canvas),editwin("Editorial Window", gd_canvas),gd_canvas(graph, cm, ms, &mapwin) |
4 MapStorage & ms):mapwin("Map Setup", ms, gd_canvas),editwin("Editorial Window", gd_canvas),newmapwin("Creating new map",gd_canvas),gd_canvas(graph, cm, ms, &mapwin) |
5 { |
5 { |
|
6 //Creating a window for setting new maps. |
|
7 // newmapwin=new NewMapWi("Creating new map",*this); |
|
8 |
|
9 |
6 set_title (title); |
10 set_title (title); |
7 set_default_size(WIN_WIDTH,WIN_HEIGHT); |
11 set_default_size(WIN_WIDTH,WIN_HEIGHT); |
8 add(vbox); |
12 add(vbox); |
9 |
13 |
10 ag=Gtk::ActionGroup::create(); |
14 ag=Gtk::ActionGroup::create(); |
47 sigc::bind( sigc::mem_fun ( this->gd_canvas, &GraphDisplayerCanvas::changeEditorialTool ), 0) ); |
51 sigc::bind( sigc::mem_fun ( this->gd_canvas, &GraphDisplayerCanvas::changeEditorialTool ), 0) ); |
48 ag->add( Gtk::Action::create("EditEdgeMap", Gtk::Stock::PROPERTIES), |
52 ag->add( Gtk::Action::create("EditEdgeMap", Gtk::Stock::PROPERTIES), |
49 sigc::bind( sigc::mem_fun ( this->gd_canvas, &GraphDisplayerCanvas::changeEditorialTool ), 4) ); |
53 sigc::bind( sigc::mem_fun ( this->gd_canvas, &GraphDisplayerCanvas::changeEditorialTool ), 4) ); |
50 ag->add( Gtk::Action::create("EditNodeMap", Gtk::Stock::PREFERENCES), |
54 ag->add( Gtk::Action::create("EditNodeMap", Gtk::Stock::PREFERENCES), |
51 sigc::bind( sigc::mem_fun ( this->gd_canvas, &GraphDisplayerCanvas::changeEditorialTool ), 5) ); |
55 sigc::bind( sigc::mem_fun ( this->gd_canvas, &GraphDisplayerCanvas::changeEditorialTool ), 5) ); |
52 ag->add( Gtk::Action::create("AddEdgeMap", Gtk::Stock::NEW), |
56 ag->add( Gtk::Action::create("AddMap", Gtk::Stock::NEW), |
53 sigc::mem_fun ( this->gd_canvas, &GraphDisplayerCanvas::addNewEdgeMap ) ); |
57 sigc::mem_fun ( this->newmapwin, &NewMapWin::show ) ); |
54 ag->add( Gtk::Action::create("AddNodeMap", Gtk::Stock::NEW), |
|
55 sigc::mem_fun ( this->gd_canvas, &GraphDisplayerCanvas::addNewNodeMap ) ); |
|
56 |
58 |
57 uim=Gtk::UIManager::create(); |
59 uim=Gtk::UIManager::create(); |
58 uim->insert_action_group(ag); |
60 uim->insert_action_group(ag); |
59 add_accel_group(uim->get_accel_group()); |
61 add_accel_group(uim->get_accel_group()); |
60 |
62 |
96 " <toolitem action='CreateEdge' />" |
98 " <toolitem action='CreateEdge' />" |
97 " <toolitem action='EraseItem' />" |
99 " <toolitem action='EraseItem' />" |
98 " <toolitem action='MoveItem' />" |
100 " <toolitem action='MoveItem' />" |
99 " <toolitem action='EditEdgeMap' />" |
101 " <toolitem action='EditEdgeMap' />" |
100 " <toolitem action='EditNodeMap' />" |
102 " <toolitem action='EditNodeMap' />" |
101 " <toolitem action='AddEdgeMap' />" |
103 " <toolitem action='AddMap' />" |
102 " <toolitem action='AddNodeMap' />" |
|
103 " </toolbar>" |
104 " </toolbar>" |
104 "</ui>"; |
105 "</ui>"; |
105 |
106 |
106 uim->add_ui_from_string(ui_info); |
107 uim->add_ui_from_string(ui_info); |
107 |
108 |