7 |
7 |
8 #include "all_include.h" |
8 #include "all_include.h" |
9 #include "graph_displayer_canvas.h" |
9 #include "graph_displayer_canvas.h" |
10 #include "mapstorage.h" |
10 #include "mapstorage.h" |
11 #include "new_map_win.h" |
11 #include "new_map_win.h" |
12 #include "mapselector.h" |
|
13 #include <libgnomecanvasmm.h> |
12 #include <libgnomecanvasmm.h> |
14 #include <libgnomecanvasmm/polygon.h> |
13 #include <libgnomecanvasmm/polygon.h> |
15 |
14 |
16 ///This class is responsible for creating a window, |
15 ///This class is responsible for creating a window, |
17 ///on which the visualization attributes can be |
16 ///on which the visualization attributes can be |
18 ///assigned to maps. |
17 ///assigned to maps. |
19 class MapWin : public Gtk::Window |
18 class MapWin : public Gtk::Window |
20 { |
19 { |
|
20 |
|
21 class MapSelector : public Gtk::HBox |
|
22 { |
|
23 protected: |
|
24 GraphDisplayerCanvas & gdc; |
|
25 ///The \ref MapStorage in which the visualizable maps are stored |
|
26 MapStorage & ms; |
|
27 NewMapWin & nmw; |
|
28 |
|
29 int id; |
|
30 |
|
31 bool itisedge; |
|
32 |
|
33 bool default_state; |
|
34 |
|
35 bool set_new_map; |
|
36 |
|
37 Gtk::ComboBoxText cbt; |
|
38 |
|
39 Gtk::Button * newbut, * defbut; |
|
40 |
|
41 Gtk::HBox hbox; |
|
42 |
|
43 Gtk::Label * label; |
|
44 |
|
45 Node node_to_update; |
|
46 Edge edge_to_update; |
|
47 |
|
48 |
|
49 public: |
|
50 |
|
51 MapSelector(GraphDisplayerCanvas &, MapStorage &, NewMapWin &, int, bool); |
|
52 |
|
53 void update_list(); |
|
54 |
|
55 ///If a radiobutton is clicked, this function determines |
|
56 ///which button was that and after that calls the |
|
57 ///appropriate function of the \ref GraphDisplayerCanvas |
|
58 ///to change the visible values of that attribute. |
|
59 virtual void comboChanged(); |
|
60 |
|
61 virtual void new_but_pressed(); |
|
62 |
|
63 virtual void reset(); |
|
64 |
|
65 virtual void update(Node node); |
|
66 virtual void update(Edge edge); |
|
67 |
|
68 Glib::ustring get_active_text(); |
|
69 void set_active_text(Glib::ustring); |
|
70 void append_text(Glib::ustring); |
|
71 }; |
|
72 |
|
73 |
|
74 |
21 protected: |
75 protected: |
22 ///The \ref GraphDisplayerCanvas on which the graph will be drawn. |
76 ///The \ref GraphDisplayerCanvas on which the graph will be drawn. |
23 ///It has to be known for this class, because |
77 ///It has to be known for this class, because |
24 ///when a map assigned to a certain attribute |
78 ///when a map assigned to a certain attribute |
25 ///a function of the \ref GraphDisplayerCanvas will be called. |
79 ///a function of the \ref GraphDisplayerCanvas will be called. |