Empty graph is (strongly) connected.
4 bool MapWin::closeIfEscapeIsPressed(GdkEventKey* e)
6 if(e->keyval==GDK_Escape)
13 MapWin::MapWin(const std::string& title, MapStorage & mapst, GraphDisplayerCanvas & grdispc, NewMapWin & newmapwin):gdc(grdispc),ms(mapst), nmw(newmapwin)
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(gdc, ms, nmw, i, true);
28 (*table).attach((*(e_combo_array[i])),0,1,i,i+1,Gtk::SHRINK,Gtk::SHRINK,10,3);
31 vbox.pack_start(*(new Gtk::Label("Edge properties")));
33 vbox.pack_start(*table);
35 vbox.pack_start(*(new Gtk::HSeparator));
37 n_combo_array=new MapSelector * [NODE_PROPERTY_NUM];
39 table=new Gtk::Table(NODE_PROPERTY_NUM, 1, false);
41 for(int i=0;i<NODE_PROPERTY_NUM;i++)
43 n_combo_array[i]=new MapSelector(gdc, ms, nmw, i, false);
45 (*table).attach((*(n_combo_array[i])),0,1,i,i+1,Gtk::SHRINK,Gtk::SHRINK,10,3);
50 vbox.pack_start(*(new Gtk::Label("Node properties")));
52 vbox.pack_start(*table);
60 for(int i=0;i<EDGE_PROPERTY_NUM;i++)
62 e_combo_array[i]->update_list();
65 for(int i=0;i<NODE_PROPERTY_NUM;i++)
67 n_combo_array[i]->update_list();
72 void MapWin::updateNode(Node node)
74 for(int i=0;i<NODE_PROPERTY_NUM;i++)
76 n_combo_array[i]->update(node);
80 void MapWin::updateEdge(Edge edge)
82 for(int i=0;i<EDGE_PROPERTY_NUM;i++)
84 e_combo_array[i]->update(edge);
88 void MapWin::registerNewEdgeMap(std::string newmapname)
90 for(int i=0;i<EDGE_PROPERTY_NUM;i++)
92 //filling in combo box with choices
93 e_combo_array[i]->append_text((Glib::ustring)newmapname);
97 void MapWin::registerNewNodeMap(std::string newmapname)
99 for(int i=0;i<NODE_PROPERTY_NUM;i++)
101 //filling in combo box with choices
102 n_combo_array[i]->append_text((Glib::ustring)newmapname);