#include "map_win.h" #include bool MapWin::closeIfEscapeIsPressed(GdkEventKey* e) { if(e->keyval==GDK_Escape) { mytab.closeMapWin(); // hide(); } return true; } MapWin::MapWin(const std::string& title, std::vector eml, std::vector nml, NoteBookTab & mw):mytab(mw) { set_title(title); set_default_size(200, 50); signal_key_press_event().connect(sigc::mem_fun(*this, &MapWin::closeIfEscapeIsPressed)); e_combo_array=new MapSelector * [EDGE_PROPERTY_NUM]; table=new Gtk::Table(EDGE_PROPERTY_NUM, 1, false); for(int i=0;isignal_cbt_ch().connect(sigc::bind(sigc::mem_fun(*this, &MapWin::edgeMapChanged), i)); e_combo_array[i]->signal_newmapwin_needed().connect(sigc::bind(sigc::mem_fun(*this, &MapWin::newMapWinNeeded), i)); } vbox.pack_start(*(new Gtk::Label("Edge properties"))); vbox.pack_start(*table); vbox.pack_start(*(new Gtk::HSeparator)); n_combo_array=new MapSelector * [NODE_PROPERTY_NUM]; table=new Gtk::Table(NODE_PROPERTY_NUM, 1, false); for(int i=0;isignal_cbt_ch().connect(sigc::bind(sigc::mem_fun(*this, &MapWin::nodeMapChanged), i)); n_combo_array[i]->signal_newmapwin_needed().connect(sigc::bind(sigc::mem_fun(*this, &MapWin::newMapWinNeeded), i)); } add(vbox); vbox.pack_start(*(new Gtk::Label("Node properties"))); vbox.pack_start(*table); show_all_children(); } MapWin::~MapWin() { } void MapWin::nodeMapChanged(std::string mapname, int prop) { mytab.propertyChange(false, prop, mapname); } void MapWin::edgeMapChanged(std::string mapname, int prop) { mytab.propertyChange(true, prop, mapname); } void MapWin::newMapWinNeeded(bool itisedge, int prop) { mytab.popupNewMapWin(itisedge, prop); } void MapWin::update(std::vector eml, std::vector nml) { for(int i=0;iupdate_list(eml); } for(int i=0;iupdate_list(nml); } } void MapWin::registerNewEdgeMap(std::string newmapname) { for(int i=0;iappend_text((Glib::ustring)newmapname); } } void MapWin::registerNewNodeMap(std::string newmapname) { for(int i=0;iappend_text((Glib::ustring)newmapname); } } bool MapWin::on_delete_event(GdkEventAny * event) { event=event; mytab.closeMapWin(); return true; }