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

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


Author: hegyi
Date: Mon Oct 24 12:15:40 2005
New Revision: 2265

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

Log:
Newly created map is realized by the property givening by common sense.

Modified: hugo/trunk/gui/map_win.cc
==============================================================================
--- hugo/trunk/gui/map_win.cc	(original)
+++ hugo/trunk/gui/map_win.cc	Mon Oct 24 12:15:40 2005
@@ -92,8 +92,6 @@
     //filling in combo box with choices
     e_combo_array[i]->append_text((Glib::ustring)newmapname);
   }
-  //setting text property for the new map
-  e_combo_array[N_TEXT]->set_active_text((Glib::ustring)newmapname);
 }
 
 void MapWin::registerNewNodeMap(std::string newmapname)
@@ -103,6 +101,4 @@
     //filling in combo box with choices
     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/mapselector.cc
==============================================================================
--- hugo/trunk/gui/mapselector.cc	(original)
+++ hugo/trunk/gui/mapselector.cc	Mon Oct 24 12:15:40 2005
@@ -1,6 +1,6 @@
 #include "mapselector.h"
 
-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)
+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),set_new_map(false),node_to_update(INVALID),edge_to_update(INVALID)
 {
   update_list();
 
@@ -36,7 +36,7 @@
 
   newbut->signal_pressed().connect
     (
-     sigc::mem_fun(nmw, &NewMapWin::show)
+     sigc::mem_fun(*this, &MapSelector::new_but_pressed)
      );
 
   add(*label);
@@ -47,6 +47,12 @@
   add(*newbut);
 }
 
+void MapSelector::new_but_pressed()
+{
+  set_new_map=true;
+  nmw.showByPreChoose(itisedge);
+}
+
 void MapSelector::update_list()
 {
   cbt.clear();
@@ -211,4 +217,9 @@
 void MapSelector::append_text(Glib::ustring text)
 {
   cbt.append_text(text);
+  if(set_new_map)
+    {
+      set_active_text(text);
+      set_new_map=false;
+    }
 }

Modified: hugo/trunk/gui/mapselector.h
==============================================================================
--- hugo/trunk/gui/mapselector.h	(original)
+++ hugo/trunk/gui/mapselector.h	Mon Oct 24 12:15:40 2005
@@ -26,6 +26,8 @@
 
   bool default_state;
 
+  bool set_new_map;
+
   Gtk::ComboBoxText cbt;
 
   Gtk::Button * newbut, * defbut;
@@ -50,6 +52,8 @@
   ///to change the visible values of that attribute.
   virtual void comboChanged();
 
+  virtual void new_but_pressed();
+
   virtual void reset();
 
   virtual void update(Node node);

Modified: hugo/trunk/gui/new_map_win.cc
==============================================================================
--- hugo/trunk/gui/new_map_win.cc	(original)
+++ hugo/trunk/gui/new_map_win.cc	Mon Oct 24 12:15:40 2005
@@ -60,6 +60,21 @@
 
 }
 
+void NewMapWin::showByPreChoose(bool itisedge)
+{
+  if(itisedge)
+    {
+      edge.set_active();
+    }
+  else
+    {
+      node.set_active();
+    }
+  node.hide();
+  edge.hide();
+  show();
+}
+
 void NewMapWin::buttonPressed()
 {
   bool valid_double=true;
@@ -102,6 +117,8 @@
 	{
 	  name.set_text("");
 	  default_value.set_text("0");
+	  edge.show();
+	  node.show();
 	  hide();
 	}
     }

Modified: hugo/trunk/gui/new_map_win.h
==============================================================================
--- hugo/trunk/gui/new_map_win.h	(original)
+++ hugo/trunk/gui/new_map_win.h	Mon Oct 24 12:15:40 2005
@@ -32,6 +32,8 @@
   //tells it the attributes.(name, default value)
   virtual void buttonPressed();
 
+  virtual void showByPreChoose(bool);
+
   virtual bool closeIfEscapeIsPressed(GdkEventKey*);
 
   Gtk::Entry name, default_value;



More information about the Lemon-commits mailing list