# HG changeset patch # User hegyi # Date 1129901532 0 # Node ID ee009c0f4bcf4961ce804c2b5928cf6a349d5671 # Parent 5ad61c33487c438888c77c5b7c797840477edaa1 MapSelector widget is able to pop up NewMap window. At the moment I hope MapSelector widget is done. diff -r 5ad61c33487c -r ee009c0f4bcf main_win.cc --- a/main_win.cc Thu Oct 20 15:50:23 2005 +0000 +++ b/main_win.cc Fri Oct 21 13:32:12 2005 +0000 @@ -2,8 +2,9 @@ #include "icons/guipixbufs.h" MainWin::MainWin() : - mapwin("Map Setup", mapstorage, gd_canvas), - newmapwin("Creating new map", gd_canvas), gd_canvas(mapstorage, mapwin, (Gtk::Window *)this) + newmapwin("Creating new map", gd_canvas), + mapwin("Map Setup", mapstorage, gd_canvas, newmapwin), + gd_canvas(mapstorage, mapwin, (Gtk::Window *)this) { set_title ("unsaved file - " + prog_name); set_default_size(WIN_WIDTH,WIN_HEIGHT); diff -r 5ad61c33487c -r ee009c0f4bcf main_win.h --- a/main_win.h Thu Oct 20 15:50:23 2005 +0000 +++ b/main_win.h Fri Oct 21 13:32:12 2005 +0000 @@ -25,12 +25,12 @@ void readFile(const std::string &); protected: + ///We need to store newmapwin, to be able to set the appropriate values for properties of new map. + NewMapWin newmapwin; + ///Window of map-showing setup. Its type is \ref MapWin MapWin mapwin; - ///We need to store newmapwin, to be able to set the appropriate values for properties of new map. - NewMapWin newmapwin; - ///The graph will be drawn on this \ref GraphDisplayerCanvas GraphDisplayerCanvas gd_canvas; diff -r 5ad61c33487c -r ee009c0f4bcf map_win.cc --- a/map_win.cc Thu Oct 20 15:50:23 2005 +0000 +++ b/map_win.cc Fri Oct 21 13:32:12 2005 +0000 @@ -10,7 +10,7 @@ return true; } -MapWin::MapWin(const std::string& title, MapStorage & mapst, GraphDisplayerCanvas & grdispc):gdc(grdispc),ms(mapst) +MapWin::MapWin(const std::string& title, MapStorage & mapst, GraphDisplayerCanvas & grdispc, NewMapWin & newmapwin):gdc(grdispc),ms(mapst), nmw(newmapwin) { set_title(title); set_default_size(200, 50); @@ -23,7 +23,7 @@ for(int i=0;iappend_text((Glib::ustring)newmapname); + n_combo_array[i]->append_text((Glib::ustring)newmapname); } //setting text property for the new map n_combo_array[N_TEXT]->set_active_text((Glib::ustring)newmapname); diff -r 5ad61c33487c -r ee009c0f4bcf map_win.h --- a/map_win.h Thu Oct 20 15:50:23 2005 +0000 +++ b/map_win.h Fri Oct 21 13:32:12 2005 +0000 @@ -8,6 +8,7 @@ #include "all_include.h" #include "graph_displayer_canvas.h" #include "mapstorage.h" +#include "new_map_win.h" #include "mapselector.h" #include #include @@ -27,6 +28,8 @@ ///The \ref MapStorage in which the visualizable maps are stored MapStorage & ms; + NewMapWin & nmw; + Gtk::Table * table; MapSelector ** e_combo_array, ** n_combo_array; @@ -37,7 +40,7 @@ public: ///Constructor of MapWin creates the widgets shown in MapWin. - MapWin(const std::string& title, MapStorage &, GraphDisplayerCanvas &); + MapWin(const std::string& title, MapStorage &, GraphDisplayerCanvas &, NewMapWin &); ///This function is created to set the appropriate maps on the newly created node void updateNode(Graph::Node); diff -r 5ad61c33487c -r ee009c0f4bcf mapselector.cc --- a/mapselector.cc Thu Oct 20 15:50:23 2005 +0000 +++ b/mapselector.cc Fri Oct 21 13:32:12 2005 +0000 @@ -1,6 +1,6 @@ #include "mapselector.h" -MapSelector::MapSelector(GraphDisplayerCanvas & grdispc, MapStorage & mapst, MapWin & mapw, int identifier, bool edge):gdc(grdispc),ms(mapst),mw(mapw),id(identifier),itisedge(edge),default_state(true),node_to_update(INVALID),edge_to_update(INVALID) +MapSelector::MapSelector(GraphDisplayerCanvas & grdispc, MapStorage & mapst, NewMapWin & newmapw, int identifier, bool edge):gdc(grdispc),ms(mapst),nmw(newmapw),id(identifier),itisedge(edge),default_state(true),node_to_update(INVALID),edge_to_update(INVALID) { update_list(); @@ -34,6 +34,11 @@ newbut=new Gtk::Button(Gtk::Stock::NEW); + newbut->signal_pressed().connect + ( + sigc::mem_fun(nmw, &NewMapWin::show) + ); + add(*label); add(cbt); diff -r 5ad61c33487c -r ee009c0f4bcf mapselector.h --- a/mapselector.h Thu Oct 20 15:50:23 2005 +0000 +++ b/mapselector.h Fri Oct 21 13:32:12 2005 +0000 @@ -7,7 +7,7 @@ #include "all_include.h" #include "mapstorage.h" -#include "map_win.h" +#include "new_map_win.h" #include "graph_displayer_canvas.h" #include #include @@ -18,7 +18,7 @@ GraphDisplayerCanvas & gdc; ///The \ref MapStorage in which the visualizable maps are stored MapStorage & ms; - MapWin & mw; + NewMapWin & nmw; int id; @@ -40,7 +40,7 @@ public: - MapSelector(GraphDisplayerCanvas &, MapStorage &, MapWin &, int, bool); + MapSelector(GraphDisplayerCanvas &, MapStorage &, NewMapWin &, int, bool); void update_list();