Documentation of NoteBookTab. Redundant function parameters are removed from other classes as well.
1.1 --- a/gui/map_win.cc Wed Jan 11 15:49:06 2006 +0000
1.2 +++ b/gui/map_win.cc Thu Jan 12 13:28:54 2006 +0000
1.3 @@ -29,7 +29,7 @@
1.4 (*table).attach((*(e_combo_array[i])),0,1,i,i+1,Gtk::SHRINK,Gtk::SHRINK,10,3);
1.5
1.6 e_combo_array[i]->signal_cbt_ch().connect(sigc::bind(sigc::mem_fun(*this, &MapWin::edgeMapChanged), i));
1.7 - e_combo_array[i]->signal_newmapwin_needed().connect(sigc::bind(sigc::mem_fun(*this, &MapWin::newMapWinNeeded), i));
1.8 + e_combo_array[i]->signal_newmapwin_needed().connect(sigc::mem_fun(*this, &MapWin::newMapWinNeeded));
1.9 }
1.10
1.11 vbox.pack_start(*(new Gtk::Label("Edge properties")));
1.12 @@ -49,7 +49,7 @@
1.13 (*table).attach((*(n_combo_array[i])),0,1,i,i+1,Gtk::SHRINK,Gtk::SHRINK,10,3);
1.14
1.15 n_combo_array[i]->signal_cbt_ch().connect(sigc::bind(sigc::mem_fun(*this, &MapWin::nodeMapChanged), i));
1.16 - n_combo_array[i]->signal_newmapwin_needed().connect(sigc::bind(sigc::mem_fun(*this, &MapWin::newMapWinNeeded), i));
1.17 + n_combo_array[i]->signal_newmapwin_needed().connect(sigc::mem_fun(*this, &MapWin::newMapWinNeeded));
1.18 }
1.19
1.20 add(vbox);
1.21 @@ -76,9 +76,9 @@
1.22 mytab.propertyChange(true, prop, mapname);
1.23 }
1.24
1.25 -void MapWin::newMapWinNeeded(bool itisedge, int prop)
1.26 +void MapWin::newMapWinNeeded(bool itisedge)
1.27 {
1.28 - mytab.popupNewMapWin(itisedge, prop);
1.29 + mytab.popupNewMapWin(itisedge);
1.30 }
1.31
1.32 void MapWin::update(std::vector<std::string> eml, std::vector<std::string> nml)
2.1 --- a/gui/map_win.h Wed Jan 11 15:49:06 2006 +0000
2.2 +++ b/gui/map_win.h Thu Jan 12 13:28:54 2006 +0000
2.3 @@ -39,7 +39,7 @@
2.4
2.5 void edgeMapChanged(std::string, int);
2.6
2.7 - void newMapWinNeeded(bool, int);
2.8 + void newMapWinNeeded(bool);
2.9
2.10 ///This function inserts name of the new edgemap in the list in the combo box
2.11 void registerNewEdgeMap(std::string);
3.1 --- a/gui/nbtab.cc Wed Jan 11 15:49:06 2006 +0000
3.2 +++ b/gui/nbtab.cc Thu Jan 12 13:28:54 2006 +0000
3.3 @@ -164,9 +164,8 @@
3.4 return signal_newmap;
3.5 }
3.6
3.7 -void NoteBookTab::popupNewMapWin(bool itisedge, int prop)
3.8 +void NoteBookTab::popupNewMapWin(bool itisedge)
3.9 {
3.10 - prop=prop;
3.11 signal_newmap.emit(this, itisedge);
3.12 }
3.13
4.1 --- a/gui/nbtab.h Wed Jan 11 15:49:06 2006 +0000
4.2 +++ b/gui/nbtab.h Thu Jan 12 13:28:54 2006 +0000
4.3 @@ -11,28 +11,78 @@
4.4 #include <libgnomecanvasmm.h>
4.5 #include <libgnomecanvasmm/polygon.h>
4.6
4.7 +///One tab in the Notebook that is placed in the main window (\ref MainWin).
4.8 +
4.9 +///One graph and all of its accessories like maps are assigned to one tab in the notebook.
4.10 +///\ref NoteBookTab is responsible for the user defined display of the graph: view can be
4.11 +///set by visualized maps, therefore \ref NoteBookTab must provide an interface to set the
4.12 +///view of graph. This is \ref Mapwin window.
4.13 +///
4.14 +///\ref NoteBookTab is also
4.15 +///responsible for modify the graph if it is
4.16 +///requested. Therefore it is responsible for translating user events to modifications to
4.17 +///do on graph, like node/edge addition/deletion, map modification, addition and so on.
4.18 +///
4.19 +///To be able to solve these tasks the help of \ref MainWin is also needed, for example to
4.20 +///know which editor-tool is active at the moment. Therefore \ref MainWin knows \ref NoteBookTab.
4.21 +///
4.22 +///Some information in the other direction is needed as well: for example when new map creation is requested for this tab
4.23 +///\ref NoteBookTab must ask \ref MainWin to pop-up a \ref NewMapWin. Communication in this direction is realized by signals
4.24 +///therefore \ref NoteBookTab does not know \ref MainWin at all, but in this way it is not necessary.
4.25 class NoteBookTab : public Gtk::VBox
4.26 {
4.27 public:
4.28 +
4.29 + ///Constructor of \ref NoteBookTab
4.30 +
4.31 + ///It initiates the \re GraphDisplayerCanvas, on which the graph will be drawn
4.32 + ///Signals of \ref MapStorage will be bound to the appropriate callback functions here.
4.33 NoteBookTab();
4.34
4.35 + ///Maps assigned to the graph displayed in this \ref NoteBookTab of notebook.
4.36 MapStorage mapstorage;
4.37
4.38 + ///Title changement indicator.
4.39 +
4.40 + ///If graph is loaded from disk or saved to disk or changed its name somehow
4.41 + ///this signal will be emit to let
4.42 + ///\ref MainWin know that it has to modify the title of the main window.
4.43 + ///It contains the new title.
4.44 sigc::signal<void, std::string> signal_title;
4.45
4.46 + ///Returns \ref signal_title to be the caller able to connect it to a callback function.
4.47 sigc::signal<void, std::string> signal_title_ch();
4.48
4.49 + ///Indicates that new map window should be popped up.
4.50 +
4.51 + ///\ref NoteBookTab can ask \ref MainWin to pop up a \ref NweMapWin ny emitting this signal.
4.52 + ///The signal contains whether an edgemap or a nodemap should be popped up. \ref NewMapWin
4.53 + ///is not popped up by \ref NoteBookTab, because not only \ref NoteBookTab needs \ref NewMapWin,
4.54 + ///but for example \ref MainWin and \ref AlgoWin s as well.
4.55 sigc::signal<void, NoteBookTab *, bool> signal_newmap;
4.56
4.57 + ///Returns \ref signal_newmap to be the caller able to connect it to a callback function.
4.58 sigc::signal<void, NoteBookTab *, bool> signal_newmap_needed();
4.59
4.60 + ///Loads the given file.
4.61 +
4.62 + ///The given file will be load in the \ref MapStorage and afeter that
4.63 + ///\ref GraphDisplayerCanvas will be requested to display the graph.
4.64 + ///\ref GraphDisplayer will get datas from the recently set \ref MapStorage.
4.65 void readFile(const std::string &);
4.66
4.67 ///The graph will be drawn on this \ref GraphDisplayerCanvas
4.68 GraphDisplayerCanvas * gd_canvas;
4.69
4.70 + ///Indicates whether the \ref MapWin is opened or not. See \ref mapwin.
4.71 bool mapwinexists;
4.72
4.73 + ///Address of the only \ref MapWin that the \ref NoteBookTab can open.
4.74 +
4.75 + ///Only one of this window can be opened at the same time (\ref mapwinexists),
4.76 + ///because there is no need for more, one per tab is enough.
4.77 + ///There won1t be benefit of more than one, but it would be
4.78 + ///more complicated to synchronize them.
4.79 MapWin * mapwin;
4.80
4.81 public:
4.82 @@ -47,16 +97,64 @@
4.83 ///Callback for 'Close' action.
4.84 virtual void close();
4.85
4.86 - void propertyChange(bool, int, std::string);
4.87 - void popupNewMapWin(bool, int);
4.88 + ///Handles changement of view of graph.
4.89
4.90 - std::string getActiveEdgeMap(int);
4.91 - std::string getActiveNodeMap(int);
4.92 + ///If the user changes the map to show by a property to a nother in \ref MapWin,
4.93 + ///\ref MapWin will call this function. This function will registrate in \ref MapStorage
4.94 + ///the new map to display by the changed property. After that \ref MapStorage will
4.95 + ///emits a signal that will be forwarded to \ref GraphDisplayerCanvas to update the
4.96 + ///appropriate parts of graph.
4.97 + ///\param itiesedge whether the changed property is edge property or node property
4.98 + ///\param prop id of property, see all_include.h
4.99 + ///\param mapname name of the recently selected map
4.100 + void propertyChange(bool itisedge, int prop, std::string mapname);
4.101
4.102 - void registerNewEdgeMap(std::string);
4.103 - void registerNewNodeMap(std::string);
4.104 + ///Emits a signal that request \ref MainWin to pop up \ref NewMapWin
4.105
4.106 + ///This function is called by \ref MapWin.
4.107 + ///\param itisedge whether the new map should be an edgemap or a nodemap.
4.108 + void popupNewMapWin(bool itisedge);
4.109 +
4.110 + ///Returns the actually selected edgemap to visualize by the given property.
4.111 +
4.112 + ///\ref MapWin calls this function, beacuse it does not know \ref MapStorage.
4.113 + ///\param prop property to inquire.
4.114 + std::string getActiveEdgeMap(int prop);
4.115 +
4.116 + ///Returns the actually selected nodemap to visualize by the given property.
4.117 +
4.118 + ///\ref MapWin calls this function, beacuse it does not know \ref MapStorage.
4.119 + ///\param prop property to inquire.
4.120 + std::string getActiveNodeMap(int prop);
4.121 +
4.122 + ///Registers recently created edgemap in \ref MapWin.
4.123 +
4.124 + ///After creation of new map \ref MapStorage emits a signal.
4.125 + ///This signal is bound to this callback function, that will call
4.126 + ///a function with the same name and same parameterin \ref MapWin.
4.127 + ///This call-forwarder function is needed, because \ref Mapstorage does not know \ref MapWin
4.128 + ///\param mapname name of new map
4.129 + void registerNewEdgeMap(std::string mapname);
4.130 +
4.131 + ///Registers recently created nodemap in \ref MapWin.
4.132 +
4.133 + ///After creation of new map \ref MapStorage emits a signal.
4.134 + ///This signal is bound to this callback function, that will call
4.135 + ///a function with the same name and same parameter in \ref MapWin.
4.136 + ///This call-forwarder function is needed, because \ref Mapstorage does not know \ref MapWin
4.137 + ///\param mapname name of new map
4.138 + void registerNewNodeMap(std::string mapname);
4.139 +
4.140 + ///Pops up and registrates the \ref MapWin of \ref NoteBookTab.
4.141 +
4.142 + ///See also
4.143 + ///\ref mapwin.
4.144 void createMapWin(std::string);
4.145 +
4.146 + ///Closes and deregistrates the \ref MapWin of \ref NoteBookTab.
4.147 +
4.148 + ///See also
4.149 + ///\ref mapwin.
4.150 void closeMapWin();
4.151 };
4.152
5.1 --- a/gui/new_map_win.h Wed Jan 11 15:49:06 2006 +0000
5.2 +++ b/gui/new_map_win.h Thu Jan 12 13:28:54 2006 +0000
5.3 @@ -26,7 +26,9 @@
5.4
5.5 ///Initial values of map elements can be given
5.6 ///by numbers or by expressions. From expressions
5.7 - ///we build first a tree. This is the data structure
5.8 + ///we build first a tree according to the priorities
5.9 + ///of operations in the expression. This is the data
5.10 + ///structure
5.11 ///that can store one tree element.
5.12 struct tree_node
5.13 {