Structure of GUI is now more clear-cut than before.
4 bool MapWin::closeIfEscapeIsPressed(GdkEventKey* e)
6 if(e->keyval==GDK_Escape)
13 MapWin::MapWin(const std::string& title, std::vector<std::string> eml, std::vector<std::string> nml, MainWin & mw):mainwin(mw)
16 set_default_size(200, 50);
18 signal_key_press_event().connect(sigc::mem_fun(*this, &MapWin::closeIfEscapeIsPressed));
20 e_combo_array=new MapSelector * [EDGE_PROPERTY_NUM];
22 table=new Gtk::Table(EDGE_PROPERTY_NUM, 1, false);
24 for(int i=0;i<EDGE_PROPERTY_NUM;i++)
26 e_combo_array[i]=new MapSelector(eml, i, true);
28 (*table).attach((*(e_combo_array[i])),0,1,i,i+1,Gtk::SHRINK,Gtk::SHRINK,10,3);
30 e_combo_array[i]->signal_cbt_ch().connect(sigc::bind(sigc::mem_fun(*this, &MapWin::edgeMapChanged), i));
31 e_combo_array[i]->signal_newmapwin_needed().connect(sigc::bind(sigc::mem_fun(*this, &MapWin::newMapWinNeeded), i));
34 vbox.pack_start(*(new Gtk::Label("Edge properties")));
36 vbox.pack_start(*table);
38 vbox.pack_start(*(new Gtk::HSeparator));
40 n_combo_array=new MapSelector * [NODE_PROPERTY_NUM];
42 table=new Gtk::Table(NODE_PROPERTY_NUM, 1, false);
44 for(int i=0;i<NODE_PROPERTY_NUM;i++)
46 n_combo_array[i]=new MapSelector(nml, i, false);
48 (*table).attach((*(n_combo_array[i])),0,1,i,i+1,Gtk::SHRINK,Gtk::SHRINK,10,3);
50 n_combo_array[i]->signal_cbt_ch().connect(sigc::bind(sigc::mem_fun(*this, &MapWin::nodeMapChanged), i));
51 n_combo_array[i]->signal_newmapwin_needed().connect(sigc::bind(sigc::mem_fun(*this, &MapWin::newMapWinNeeded), i));
56 vbox.pack_start(*(new Gtk::Label("Node properties")));
58 vbox.pack_start(*table);
64 void MapWin::nodeMapChanged(std::string mapname, int prop)
66 mainwin.propertyChange(false, prop, mapname);
69 void MapWin::edgeMapChanged(std::string mapname, int prop)
71 mainwin.propertyChange(true, prop, mapname);
74 void MapWin::newMapWinNeeded(bool itisedge, int prop)
76 mainwin.popupNewMapWin(itisedge, prop);
79 void MapWin::update(std::vector<std::string> eml, std::vector<std::string> nml)
81 for(int i=0;i<EDGE_PROPERTY_NUM;i++)
83 e_combo_array[i]->update_list(eml);
86 for(int i=0;i<NODE_PROPERTY_NUM;i++)
88 n_combo_array[i]->update_list(nml);
92 void MapWin::registerNewEdgeMap(std::string newmapname)
94 for(int i=0;i<EDGE_PROPERTY_NUM;i++)
96 //filling in combo box with choices
97 e_combo_array[i]->append_text((Glib::ustring)newmapname);
101 void MapWin::registerNewNodeMap(std::string newmapname)
103 for(int i=0;i<NODE_PROPERTY_NUM;i++)
105 //filling in combo box with choices
106 n_combo_array[i]->append_text((Glib::ustring)newmapname);