NewMapWin has become Dialog instead of Window. Therefore it is created dynamically, when there is need for it, instead of keeping one instance in memory. This solution is slower, but more correct than before.
8 #include "all_include.h"
9 #include "graph_displayer_canvas.h"
10 #include "mapstorage.h"
11 #include "new_map_win.h"
12 #include <libgnomecanvasmm.h>
13 #include <libgnomecanvasmm/polygon.h>
15 ///This class is responsible for creating a window,
16 ///on which the visualization attributes can be
18 class MapWin : public Gtk::Window
21 class MapSelector : public Gtk::HBox
24 GraphDisplayerCanvas & gdc;
25 ///The \ref MapStorage in which the visualizable maps are stored
36 Gtk::ComboBoxText cbt;
38 Gtk::Button * newbut, * defbut;
50 MapSelector(GraphDisplayerCanvas &, MapStorage &, int, bool);
54 ///If a radiobutton is clicked, this function determines
55 ///which button was that and after that calls the
56 ///appropriate function of the \ref GraphDisplayerCanvas
57 ///to change the visible values of that attribute.
58 virtual void comboChanged();
60 virtual void new_but_pressed();
64 virtual void update(Node node);
65 virtual void update(Edge edge);
67 Glib::ustring get_active_text();
68 void set_active_text(Glib::ustring);
69 void append_text(Glib::ustring);
75 ///The \ref GraphDisplayerCanvas on which the graph will be drawn.
76 ///It has to be known for this class, because
77 ///when a map assigned to a certain attribute
78 ///a function of the \ref GraphDisplayerCanvas will be called.
79 GraphDisplayerCanvas & gdc;
81 ///The \ref MapStorage in which the visualizable maps are stored
86 MapSelector ** e_combo_array, ** n_combo_array;
93 ///Constructor of MapWin creates the widgets shown in MapWin.
94 MapWin(const std::string& title, MapStorage &, GraphDisplayerCanvas &);
96 ///This function is created to set the appropriate maps on the newly created node
97 void updateNode(Graph::Node);
99 ///This function is created to set the appropriate maps on the newly created edge
100 void updateEdge(Graph::Edge);
102 ///This function inserts name of the new edgemap in the list in the combo box
103 void registerNewEdgeMap(std::string);
105 ///This function inserts name of the new nodemap in the list in the combo box
106 void registerNewNodeMap(std::string);
108 virtual bool closeIfEscapeIsPressed(GdkEventKey*);