Index: graph_displayer_canvas-event.cc
===================================================================
--- graph_displayer_canvas-event.cc	(revision 40)
+++ graph_displayer_canvas-event.cc	(revision 41)
@@ -671,55 +671,76 @@
 	    case GDK_Return:
 	      {
-		Glib::ustring mapvalue = entrywidget.get_text();
-
-		double double_map_fract_value=0;
-		double double_map_value=0;
-		int offset=0;
-		int found_letter=0;
-		//converting text to double
-		for(int i=0;i<(int)(mapvalue.length());i++)
+		bool valid_double=true;
+		int point_num=0;
+		Glib::ustring mapvalue_str = entrywidget.get_text();
+
+		char * mapvalue_ch=new char [mapvalue_str.length()];
+		for(int i=0;i<(int)(mapvalue_str.length());i++)
 		  {
-		    if(((mapvalue[i]<='9')&&(mapvalue[i]>='0'))||(mapvalue[i]=='.'))
+		    if(((mapvalue_str[i]<'0')||(mapvalue_str[i]>'9'))&&(mapvalue_str[i]!='.'))
 		      {
-			if(mapvalue[i]=='.')
-			  {
-			    //for calculating non-integer part of double we step backward from the end
-			    //after each step the number will be divided by ten, and the new value will be added
-			    //to step backward from the end until the point the actual character of the string is the following:
-			    // mapvalue.length()-(i-position_of_point)
-			    //if i was the number of the first character after the decimal point the selected character will be the last
-			    //if i was the number of the last character, the selected character will be the first after the decimal point
-			    offset=mapvalue.length()+i;
-			  }
-			else
-			  {
-			    if(!offset)
-			      {
-				double_map_value=10*double_map_value+mapvalue[i]-'0';
-			      }
-			    else
-			      {
-				double_map_fract_value=double_map_fract_value/10+(double)(mapvalue[offset-i]-'0')/10;
-			      }
-			  }
+			valid_double=false;
 		      }
 		    else
 		      {
-			found_letter++;
-			continue;
+			if(mapvalue_str[i]=='.')
+			  {
+			    point_num++;
+			  }
 		      }
+		    mapvalue_ch[i]=mapvalue_str[i];
 		  }
-
-		if(!found_letter)
+  
+		double mapvalue_d=atof(mapvalue_ch);
+
+// 		double double_map_fract_value=0;
+// 		double double_map_value=0;
+// 		int offset=0;
+// 		int found_letter=0;
+		//converting text to double
+// 		for(int i=0;i<(int)(mapvalue.length());i++)
+// 		  {
+// 		    if(((mapvalue[i]<='9')&&(mapvalue[i]>='0'))||(mapvalue[i]=='.'))
+// 		      {
+// 			if(mapvalue[i]=='.')
+// 			  {
+// 			    //for calculating non-integer part of double we step backward from the end
+// 			    //after each step the number will be divided by ten, and the new value will be added
+// 			    //to step backward from the end until the point the actual character of the string is the following:
+// 			    // mapvalue.length()-(i-position_of_point)
+// 			    //if i was the number of the first character after the decimal point the selected character will be the last
+// 			    //if i was the number of the last character, the selected character will be the first after the decimal point
+// 			    offset=mapvalue.length()+i;
+// 			  }
+// 			else
+// 			  {
+// 			    if(!offset)
+// 			      {
+// 				double_map_value=10*double_map_value+mapvalue[i]-'0';
+// 			      }
+// 			    else
+// 			      {
+// 				double_map_fract_value=double_map_fract_value/10+(double)(mapvalue[offset-i]-'0')/10;
+// 			      }
+// 			  }
+// 		      }
+// 		    else
+// 		      {
+// 			found_letter++;
+// 			continue;
+// 		      }
+// 		  }
+
+		if((point_num<=1)&&(valid_double))
 		  {
 		    switch(actual_tool)
 		      {
 		      case EDGE_MAP_EDIT:
-			edgetextmap[active_edge]->property_text().set_value(mapvalue);
-			(*(mapstorage.edgemap_storage)[edgemap_to_edit])[active_edge]=double_map_value+double_map_fract_value;
+			edgetextmap[active_edge]->property_text().set_value(mapvalue_str);
+			(*(mapstorage.edgemap_storage)[edgemap_to_edit])[active_edge]=mapvalue_d;
 			break;
 		      case NODE_MAP_EDIT:
-			nodetextmap[active_node]->property_text().set_value(mapvalue);
-			(*(mapstorage.nodemap_storage)[nodemap_to_edit])[active_node]=double_map_value+double_map_fract_value;
+			nodetextmap[active_node]->property_text().set_value(mapvalue_str);
+			(*(mapstorage.nodemap_storage)[nodemap_to_edit])[active_node]=mapvalue_d;
 			break;
 		      default:
@@ -804,15 +825,18 @@
 }
 
-void GraphDisplayerCanvas::addNewEdgeMap()
-{
-  Graph::EdgeMap<double> * emptr=new Graph::EdgeMap<double> (g,20);
-  mapstorage.addEdgeMap("NewEdgeMap",emptr);
-  mapwin->registerNewEdgeMap("NewEdgeMap");
-  changeEdgeText("NewEdgeMap");
-}
-
-void GraphDisplayerCanvas::addNewNodeMap()
-{
-  std::cout << "Add New NodeMap is not yet implemented." << std::endl;
-}
-
+void GraphDisplayerCanvas::addNewEdgeMap(double default_value, std::string mapname)
+{
+  Graph::EdgeMap<double> * emptr=new Graph::EdgeMap<double> (g,default_value);
+  mapstorage.addEdgeMap(mapname,emptr);
+  mapwin->registerNewEdgeMap(mapname);
+  changeEdgeText(mapname);
+}
+
+void GraphDisplayerCanvas::addNewNodeMap(double default_value, std::string mapname)
+{
+  Graph::NodeMap<double> * emptr=new Graph::NodeMap<double> (g,default_value);
+  mapstorage.addNodeMap(mapname,emptr);
+  mapwin->registerNewNodeMap(mapname);
+  changeNodeText(mapname);
+}
+
