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 <libgnomecanvasmm.h>
11 #include <libgnomecanvasmm/polygon.h>
14 ///This class is responsible for creating a window,
15 ///on which the parameters of a new map can be set.
17 class NewMapWin : public Gtk::Dialog
19 ///The \ref GraphDisplayerCanvas on which the graph will be drawn.
20 ///It has to be known for this class, because
21 ///when a map is created
22 ///a function of the \ref GraphDisplayerCanvas will be called.
23 GraphDisplayerCanvas & gdc;
29 tree_node * left_child;
30 tree_node * right_child;
33 ///Constructor of NewMapWin creates the widgets shown in NewMapWin.
34 NewMapWin(const std::string& title, GraphDisplayerCanvas &, bool itisedge=true, bool edgenode=true);
36 ///Signal on button is connected to this function,
37 ///Therefore this function determines whether to
38 ///call the map/creatort function, and if yes, it
39 //tells it the attributes.(name, default value)
40 virtual void on_response(int response_id);
42 virtual bool closeIfEscapeIsPressed(GdkEventKey*);
44 ///Function that creates a tree from an appropriately manipulated string
45 tree_node * weightedString2Tree(std::string, std::vector<unsigned int> &, int);
47 ///Function that creates a string from a tree by postorder reading.
48 std::string postOrder(tree_node *);
50 std::string string2Polishform(std::string, bool);
52 bool validVariable(std::string, bool);
54 std::map<char, std::string> ch2var;
56 Gtk::Entry name, default_value;
61 Gtk::RadioButton node, edge;