ladanyi@1442: // -*- C++ -*- // ladanyi@1442: ladanyi@1442: #ifndef MAP_WIN_H ladanyi@1442: #define MAP_WIN_H ladanyi@1442: hegyi@1512: class MapWin; hegyi@1512: ladanyi@1606: #include "all_include.h" ladanyi@1606: #include "graph_displayer_canvas.h" ladanyi@1606: #include "mapstorage.h" hegyi@1733: #include "new_map_win.h" ladanyi@1442: #include ladanyi@1442: #include ladanyi@1442: ladanyi@1442: ///This class is responsible for creating a window, ladanyi@1442: ///on which the visualization attributes can be ladanyi@1442: ///assigned to maps. ladanyi@1442: class MapWin : public Gtk::Window ladanyi@1442: { hegyi@1819: hegyi@1819: class MapSelector : public Gtk::HBox hegyi@1819: { hegyi@1819: protected: hegyi@1819: GraphDisplayerCanvas & gdc; hegyi@1819: ///The \ref MapStorage in which the visualizable maps are stored hegyi@1819: MapStorage & ms; hegyi@1819: hegyi@1819: int id; hegyi@1819: hegyi@1819: bool itisedge; hegyi@1819: hegyi@1819: bool default_state; hegyi@1819: hegyi@1819: bool set_new_map; hegyi@1819: hegyi@1819: Gtk::ComboBoxText cbt; hegyi@1819: hegyi@1819: Gtk::Button * newbut, * defbut; hegyi@1819: hegyi@1819: Gtk::HBox hbox; hegyi@1819: hegyi@1819: Gtk::Label * label; hegyi@1819: hegyi@1819: Node node_to_update; hegyi@1819: Edge edge_to_update; hegyi@1819: hegyi@1819: hegyi@1819: public: hegyi@1819: hegyi@1823: MapSelector(GraphDisplayerCanvas &, MapStorage &, int, bool); hegyi@1819: hegyi@1819: void update_list(); hegyi@1819: hegyi@1819: ///If a radiobutton is clicked, this function determines hegyi@1819: ///which button was that and after that calls the hegyi@1819: ///appropriate function of the \ref GraphDisplayerCanvas hegyi@1819: ///to change the visible values of that attribute. hegyi@1819: virtual void comboChanged(); hegyi@1819: hegyi@1819: virtual void new_but_pressed(); hegyi@1819: hegyi@1819: virtual void reset(); hegyi@1819: hegyi@1819: virtual void update(Node node); hegyi@1819: virtual void update(Edge edge); hegyi@1819: hegyi@1819: Glib::ustring get_active_text(); hegyi@1819: void set_active_text(Glib::ustring); hegyi@1819: void append_text(Glib::ustring); hegyi@1819: }; hegyi@1819: hegyi@1819: hegyi@1819: ladanyi@1442: protected: ladanyi@1442: ///The \ref GraphDisplayerCanvas on which the graph will be drawn. ladanyi@1442: ///It has to be known for this class, because ladanyi@1442: ///when a map assigned to a certain attribute ladanyi@1442: ///a function of the \ref GraphDisplayerCanvas will be called. ladanyi@1442: GraphDisplayerCanvas & gdc; ladanyi@1442: ladanyi@1442: ///The \ref MapStorage in which the visualizable maps are stored ladanyi@1442: MapStorage & ms; ladanyi@1442: hegyi@1512: Gtk::Table * table; ladanyi@1442: hegyi@1731: MapSelector ** e_combo_array, ** n_combo_array; ladanyi@1442: hegyi@1446: Gtk::Label * label; ladanyi@1442: hegyi@1512: Gtk::VBox vbox; hegyi@1512: ladanyi@1442: public: ladanyi@1442: ///Constructor of MapWin creates the widgets shown in MapWin. hegyi@1823: MapWin(const std::string& title, MapStorage &, GraphDisplayerCanvas &); ladanyi@1442: hegyi@1512: ///This function is created to set the appropriate maps on the newly created node hegyi@1524: void updateNode(Graph::Node); hegyi@1512: hegyi@1512: ///This function is created to set the appropriate maps on the newly created edge hegyi@1524: void updateEdge(Graph::Edge); hegyi@1512: hegyi@1586: ///This function inserts name of the new edgemap in the list in the combo box hegyi@1586: void registerNewEdgeMap(std::string); hegyi@1586: hegyi@1586: ///This function inserts name of the new nodemap in the list in the combo box hegyi@1586: void registerNewNodeMap(std::string); hegyi@1586: hegyi@1524: virtual bool closeIfEscapeIsPressed(GdkEventKey*); hegyi@1586: ladanyi@1606: void update(); ladanyi@1442: }; ladanyi@1442: ladanyi@1442: #endif //MAP_WIN_H