MapSelector widget is able to pop up NewMap window. At the moment I hope MapSelector widget is done.
authorhegyi
Fri, 21 Oct 2005 13:32:12 +0000
changeset 17335e0d97823ba2
parent 1732 edeee3cbd80c
child 1734 2fb5ceac10e7
MapSelector widget is able to pop up NewMap window. At the moment I hope MapSelector widget is done.
gui/main_win.cc
gui/main_win.h
gui/map_win.cc
gui/map_win.h
gui/mapselector.cc
gui/mapselector.h
     1.1 --- a/gui/main_win.cc	Fri Oct 21 08:34:47 2005 +0000
     1.2 +++ b/gui/main_win.cc	Fri Oct 21 13:32:12 2005 +0000
     1.3 @@ -2,8 +2,9 @@
     1.4  #include "icons/guipixbufs.h"
     1.5  
     1.6  MainWin::MainWin() :
     1.7 -  mapwin("Map Setup", mapstorage, gd_canvas),
     1.8 -  newmapwin("Creating new map", gd_canvas), gd_canvas(mapstorage, mapwin, (Gtk::Window *)this)
     1.9 +  newmapwin("Creating new map", gd_canvas),
    1.10 +  mapwin("Map Setup", mapstorage, gd_canvas, newmapwin),
    1.11 +  gd_canvas(mapstorage, mapwin, (Gtk::Window *)this)
    1.12  {
    1.13    set_title ("unsaved file - " + prog_name);
    1.14    set_default_size(WIN_WIDTH,WIN_HEIGHT);
     2.1 --- a/gui/main_win.h	Fri Oct 21 08:34:47 2005 +0000
     2.2 +++ b/gui/main_win.h	Fri Oct 21 13:32:12 2005 +0000
     2.3 @@ -25,12 +25,12 @@
     2.4    void readFile(const std::string &);
     2.5  
     2.6  protected:
     2.7 +  ///We need to store newmapwin, to be able to set the appropriate values for properties of new map.
     2.8 +  NewMapWin newmapwin;
     2.9 +
    2.10    ///Window of map-showing setup. Its type is \ref MapWin
    2.11    MapWin mapwin;
    2.12  
    2.13 -  ///We need to store newmapwin, to be able to set the appropriate values for properties of new map.
    2.14 -  NewMapWin newmapwin;
    2.15 -
    2.16    ///The graph will be drawn on this \ref GraphDisplayerCanvas
    2.17    GraphDisplayerCanvas gd_canvas;
    2.18  
     3.1 --- a/gui/map_win.cc	Fri Oct 21 08:34:47 2005 +0000
     3.2 +++ b/gui/map_win.cc	Fri Oct 21 13:32:12 2005 +0000
     3.3 @@ -10,7 +10,7 @@
     3.4    return true;
     3.5  }
     3.6  
     3.7 -MapWin::MapWin(const std::string& title, MapStorage & mapst, GraphDisplayerCanvas & grdispc):gdc(grdispc),ms(mapst)
     3.8 +MapWin::MapWin(const std::string& title, MapStorage & mapst, GraphDisplayerCanvas & grdispc, NewMapWin & newmapwin):gdc(grdispc),ms(mapst), nmw(newmapwin)
     3.9  {
    3.10    set_title(title);
    3.11    set_default_size(200, 50);
    3.12 @@ -23,7 +23,7 @@
    3.13  
    3.14    for(int i=0;i<EDGE_PROPERTY_NUM;i++)
    3.15    {
    3.16 -    e_combo_array[i]=new MapSelector(gdc, ms, *this, i, true);
    3.17 +    e_combo_array[i]=new MapSelector(gdc, ms, nmw, i, true);
    3.18  
    3.19      (*table).attach((*(e_combo_array[i])),0,1,i,i+1,Gtk::SHRINK,Gtk::SHRINK,10,3);
    3.20    }
    3.21 @@ -40,7 +40,7 @@
    3.22  
    3.23    for(int i=0;i<NODE_PROPERTY_NUM;i++)
    3.24    {
    3.25 -    n_combo_array[i]=new MapSelector(gdc, ms, *this, i, false);
    3.26 +    n_combo_array[i]=new MapSelector(gdc, ms, nmw, i, false);
    3.27  
    3.28      (*table).attach((*(n_combo_array[i])),0,1,i,i+1,Gtk::SHRINK,Gtk::SHRINK,10,3);
    3.29    }
    3.30 @@ -101,7 +101,7 @@
    3.31    for(int i=0;i<NODE_PROPERTY_NUM;i++)
    3.32    {
    3.33      //filling in combo box with choices
    3.34 -    e_combo_array[i]->append_text((Glib::ustring)newmapname);
    3.35 +    n_combo_array[i]->append_text((Glib::ustring)newmapname);
    3.36    }
    3.37    //setting text property for the new map
    3.38    n_combo_array[N_TEXT]->set_active_text((Glib::ustring)newmapname);
     4.1 --- a/gui/map_win.h	Fri Oct 21 08:34:47 2005 +0000
     4.2 +++ b/gui/map_win.h	Fri Oct 21 13:32:12 2005 +0000
     4.3 @@ -8,6 +8,7 @@
     4.4  #include "all_include.h"
     4.5  #include "graph_displayer_canvas.h"
     4.6  #include "mapstorage.h"
     4.7 +#include "new_map_win.h"
     4.8  #include "mapselector.h"
     4.9  #include <libgnomecanvasmm.h>
    4.10  #include <libgnomecanvasmm/polygon.h>
    4.11 @@ -27,6 +28,8 @@
    4.12    ///The \ref MapStorage in which the visualizable maps are stored
    4.13    MapStorage & ms;
    4.14  
    4.15 +  NewMapWin & nmw;
    4.16 +
    4.17    Gtk::Table * table;
    4.18    
    4.19    MapSelector ** e_combo_array, ** n_combo_array;
    4.20 @@ -37,7 +40,7 @@
    4.21  
    4.22  public:
    4.23    ///Constructor of MapWin creates the widgets shown in MapWin.
    4.24 -  MapWin(const std::string& title, MapStorage &, GraphDisplayerCanvas &);
    4.25 +  MapWin(const std::string& title, MapStorage &, GraphDisplayerCanvas &, NewMapWin &);
    4.26  
    4.27    ///This function is created to set the appropriate maps on the newly created node
    4.28    void updateNode(Graph::Node);
     5.1 --- a/gui/mapselector.cc	Fri Oct 21 08:34:47 2005 +0000
     5.2 +++ b/gui/mapselector.cc	Fri Oct 21 13:32:12 2005 +0000
     5.3 @@ -1,6 +1,6 @@
     5.4  #include "mapselector.h"
     5.5  
     5.6 -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)
     5.7 +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)
     5.8  {
     5.9    update_list();
    5.10  
    5.11 @@ -34,6 +34,11 @@
    5.12  
    5.13    newbut=new Gtk::Button(Gtk::Stock::NEW);
    5.14  
    5.15 +  newbut->signal_pressed().connect
    5.16 +    (
    5.17 +     sigc::mem_fun(nmw, &NewMapWin::show)
    5.18 +     );
    5.19 +
    5.20    add(*label);
    5.21  
    5.22    add(cbt);
     6.1 --- a/gui/mapselector.h	Fri Oct 21 08:34:47 2005 +0000
     6.2 +++ b/gui/mapselector.h	Fri Oct 21 13:32:12 2005 +0000
     6.3 @@ -7,7 +7,7 @@
     6.4  
     6.5  #include "all_include.h"
     6.6  #include "mapstorage.h"
     6.7 -#include "map_win.h"
     6.8 +#include "new_map_win.h"
     6.9  #include "graph_displayer_canvas.h"
    6.10  #include <libgnomecanvasmm.h>
    6.11  #include <libgnomecanvasmm/polygon.h>
    6.12 @@ -18,7 +18,7 @@
    6.13    GraphDisplayerCanvas & gdc;
    6.14    ///The \ref MapStorage in which the visualizable maps are stored
    6.15    MapStorage & ms;
    6.16 -  MapWin & mw;
    6.17 +  NewMapWin & nmw;
    6.18  
    6.19    int id;
    6.20  
    6.21 @@ -40,7 +40,7 @@
    6.22  
    6.23  public:
    6.24  
    6.25 -  MapSelector(GraphDisplayerCanvas &, MapStorage &, MapWin &, int, bool);
    6.26 +  MapSelector(GraphDisplayerCanvas &, MapStorage &, NewMapWin &, int, bool);
    6.27  
    6.28    void update_list();
    6.29