[Lemon-commits] [lemon_svn] hegyi: r2099 - hugo/trunk/gui
Lemon SVN
svn at lemon.cs.elte.hu
Mon Nov 6 20:50:08 CET 2006
Author: hegyi
Date: Wed Jul 27 13:02:51 2005
New Revision: 2099
Modified:
hugo/trunk/gui/graph_displayer_canvas-edge.cc
Log:
Documentation was added to GUI.
Modified: hugo/trunk/gui/graph_displayer_canvas-edge.cc
==============================================================================
--- hugo/trunk/gui/graph_displayer_canvas-edge.cc (original)
+++ hugo/trunk/gui/graph_displayer_canvas-edge.cc Wed Jul 27 13:02:51 2005
@@ -119,34 +119,38 @@
{
edgemap_to_edit=mapname;
double number=(*(mapstorage.edgemap_storage)[mapname])[i];
- int length=1;
- //if number is smaller than one, length would be negative, or invalid
- if(number>=1)
- {
- length=(int)(floor(log(number)/log(10)))+1;
- }
- int maxpos=(int)(pow(10,length-1));
- int strl=length+1+RANGE;
- char * str=new char[strl];
- str[length]='.';
- str[strl]='\0';
+// int length=1;
+// //if number is smaller than one, length would be negative, or invalid
+// if(number>=1)
+// {
+// length=(int)(floor(log(number)/log(10)))+1;
+// }
+// int maxpos=(int)(pow(10,length-1));
+// int strl=length+1+RANGE;
+// char * str=new char[strl];
+// str[length]='.';
+// str[strl]='\0';
- for(int j=0;j<strl;j++)
- {
- if(j!=length)
- {
- if((number-(int)number)>ALMOST_ONE)
- {
- number=round(number);
- }
- int digit=(int)(number/maxpos);
- str[j]=(digit+'0');
- number-=digit*maxpos;
- number*=10;
- }
- }
-
- edgetextmap[i]->property_text().set_value(str);
+// for(int j=0;j<strl;j++)
+// {
+// if(j!=length)
+// {
+// if((number-(int)number)>ALMOST_ONE)
+// {
+// number=round(number);
+// }
+// int digit=(int)(number/maxpos);
+// str[j]=(digit+'0');
+// number-=digit*maxpos;
+// number*=10;
+// }
+// }
+// edgetextmap[i]->property_text().set_value(str);
+
+ std::ostringstream ostr;
+ ostr << number;
+
+ edgetextmap[i]->property_text().set_value(ostr.str());
}
else
{
More information about the Lemon-commits
mailing list