Added two new classes.
4 bool MapWin::closeIfEscapeIsPressed(GdkEventKey* e)
6 if(e->keyval==GDK_Escape)
14 MapWin::MapWin(const std::string& title, std::vector<std::string> eml, std::vector<std::string> nml, NoteBookTab & mw):mytab(mw)
17 set_default_size(200, 50);
21 signal_key_press_event().connect(sigc::mem_fun(*this, &MapWin::closeIfEscapeIsPressed));
23 mytab.signal_title_ch().connect(sigc::mem_fun(*this, &MapWin::set_title));
25 e_combo_array=new MapSelector * [EDGE_PROPERTY_NUM];
27 table=new Gtk::Table(EDGE_PROPERTY_NUM, 1, false);
29 for(int i=0;i<EDGE_PROPERTY_NUM;i++)
31 e_combo_array[i]=new MapSelector(eml, mytab.getActiveEdgeMap(i), edge_property_strings[i], true);
33 (*table).attach((*(e_combo_array[i])),0,1,i,i+1,Gtk::SHRINK,Gtk::SHRINK,10,3);
35 e_combo_array[i]->signal_cbt_ch().connect(sigc::bind(sigc::mem_fun(*this, &MapWin::edgeMapChanged), i));
36 e_combo_array[i]->signal_newmapwin_needed().connect(sigc::mem_fun(*this, &MapWin::newMapWinNeeded));
39 vbox.pack_start(*(new Gtk::Label("Edge properties")));
41 vbox.pack_start(*table);
43 vbox.pack_start(*(new Gtk::HSeparator));
45 n_combo_array=new MapSelector * [NODE_PROPERTY_NUM];
47 table=new Gtk::Table(NODE_PROPERTY_NUM, 1, false);
49 for(int i=0;i<NODE_PROPERTY_NUM;i++)
51 n_combo_array[i]=new MapSelector(nml, mytab.getActiveNodeMap(i), node_property_strings[i], false);
53 (*table).attach((*(n_combo_array[i])),0,1,i,i+1,Gtk::SHRINK,Gtk::SHRINK,10,3);
55 n_combo_array[i]->signal_cbt_ch().connect(sigc::bind(sigc::mem_fun(*this, &MapWin::nodeMapChanged), i));
56 n_combo_array[i]->signal_newmapwin_needed().connect(sigc::mem_fun(*this, &MapWin::newMapWinNeeded));
61 vbox.pack_start(*(new Gtk::Label("Node properties")));
63 vbox.pack_start(*table);
69 void MapWin::nodeMapChanged(std::string mapname, int prop)
71 mytab.propertyChange(false, prop, mapname);
74 void MapWin::edgeMapChanged(std::string mapname, int prop)
76 mytab.propertyChange(true, prop, mapname);
79 void MapWin::newMapWinNeeded(bool itisedge)
81 mytab.popupNewMapWin(itisedge);
84 void MapWin::update(std::vector<std::string> eml, std::vector<std::string> nml)
86 for(int i=0;i<EDGE_PROPERTY_NUM;i++)
88 e_combo_array[i]->update_list(eml);
91 for(int i=0;i<NODE_PROPERTY_NUM;i++)
93 n_combo_array[i]->update_list(nml);
96 mytab.active_maps_needed();
99 void MapWin::registerNewEdgeMap(std::string newmapname)
101 for(int i=0;i<EDGE_PROPERTY_NUM;i++)
103 //filling in combo box with choices
104 e_combo_array[i]->append_text((Glib::ustring)newmapname);
108 void MapWin::registerNewNodeMap(std::string newmapname)
110 for(int i=0;i<NODE_PROPERTY_NUM;i++)
112 //filling in combo box with choices
113 n_combo_array[i]->append_text((Glib::ustring)newmapname);
117 bool MapWin::on_delete_event(GdkEventAny * event)
124 void MapWin::changeEntry(bool isitedge, int prop, std::string mapname)
128 e_combo_array[prop]->set_active_text(mapname);
132 n_combo_array[prop]->set_active_text(mapname);
136 void MapWin::set_title(std::string tabname)
138 Gtk::Window::set_title("Map Setup - "+tabname);