[Lemon-commits] [lemon_svn] hegyi: r2260 - hugo/trunk/gui

Lemon SVN svn at lemon.cs.elte.hu
Mon Nov 6 20:51:19 CET 2006


Author: hegyi
Date: Fri Oct 21 15:32:12 2005
New Revision: 2260

Modified:
   hugo/trunk/gui/main_win.cc
   hugo/trunk/gui/main_win.h
   hugo/trunk/gui/map_win.cc
   hugo/trunk/gui/map_win.h
   hugo/trunk/gui/mapselector.cc
   hugo/trunk/gui/mapselector.h

Log:
MapSelector widget is able to pop up NewMap window. At the moment I hope MapSelector widget is done.

Modified: hugo/trunk/gui/main_win.cc
==============================================================================
--- hugo/trunk/gui/main_win.cc	(original)
+++ hugo/trunk/gui/main_win.cc	Fri Oct 21 15:32:12 2005
@@ -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);

Modified: hugo/trunk/gui/main_win.h
==============================================================================
--- hugo/trunk/gui/main_win.h	(original)
+++ hugo/trunk/gui/main_win.h	Fri Oct 21 15:32:12 2005
@@ -25,12 +25,12 @@
   void readFile(const std::string &);
 
 protected:
-  ///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;
 
+  ///Window of map-showing setup. Its type is \ref MapWin
+  MapWin mapwin;
+
   ///The graph will be drawn on this \ref GraphDisplayerCanvas
   GraphDisplayerCanvas gd_canvas;
 

Modified: hugo/trunk/gui/map_win.cc
==============================================================================
--- hugo/trunk/gui/map_win.cc	(original)
+++ hugo/trunk/gui/map_win.cc	Fri Oct 21 15:32:12 2005
@@ -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;i<EDGE_PROPERTY_NUM;i++)
   {
-    e_combo_array[i]=new MapSelector(gdc, ms, *this, i, true);
+    e_combo_array[i]=new MapSelector(gdc, ms, nmw, i, true);
 
     (*table).attach((*(e_combo_array[i])),0,1,i,i+1,Gtk::SHRINK,Gtk::SHRINK,10,3);
   }
@@ -40,7 +40,7 @@
 
   for(int i=0;i<NODE_PROPERTY_NUM;i++)
   {
-    n_combo_array[i]=new MapSelector(gdc, ms, *this, i, false);
+    n_combo_array[i]=new MapSelector(gdc, ms, nmw, i, false);
 
     (*table).attach((*(n_combo_array[i])),0,1,i,i+1,Gtk::SHRINK,Gtk::SHRINK,10,3);
   }
@@ -101,7 +101,7 @@
   for(int i=0;i<NODE_PROPERTY_NUM;i++)
   {
     //filling in combo box with choices
-    e_combo_array[i]->append_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);

Modified: hugo/trunk/gui/map_win.h
==============================================================================
--- hugo/trunk/gui/map_win.h	(original)
+++ hugo/trunk/gui/map_win.h	Fri Oct 21 15:32:12 2005
@@ -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 <libgnomecanvasmm.h>
 #include <libgnomecanvasmm/polygon.h>
@@ -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);

Modified: hugo/trunk/gui/mapselector.cc
==============================================================================
--- hugo/trunk/gui/mapselector.cc	(original)
+++ hugo/trunk/gui/mapselector.cc	Fri Oct 21 15:32:12 2005
@@ -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);

Modified: hugo/trunk/gui/mapselector.h
==============================================================================
--- hugo/trunk/gui/mapselector.h	(original)
+++ hugo/trunk/gui/mapselector.h	Fri Oct 21 15:32:12 2005
@@ -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 <libgnomecanvasmm.h>
 #include <libgnomecanvasmm/polygon.h>
@@ -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();
 



More information about the Lemon-commits mailing list