|
From: andrew7 <bd...@us...> - 2006-11-30 01:05:11
|
Update of /cvsroot/smartwin/SmartWin/tests/WidgetGraph In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv423/tests/WidgetGraph Modified Files: Main.cpp WidgetGraph.h Log Message: Unicode Index: Main.cpp =================================================================== RCS file: /cvsroot/smartwin/SmartWin/tests/WidgetGraph/Main.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- Main.cpp 20 Apr 2006 05:03:40 -0000 1.9 +++ Main.cpp 30 Nov 2006 01:05:08 -0000 1.10 @@ -20,6 +20,7 @@ void simpleXYData() { + this->setText( _T( "WidgetGraph short sample" ) ); this->setBounds( 0, 0, 250, 200 ); this->setText( _T( "WidgetGraph test of X - Y data graph" ) ); short xdata[] = @@ -50,6 +51,7 @@ void socialSecurity() { + this->setText( _T( "WidgetGraph int sample" ) ); this->setBounds( 0, 200, 500, 200 ); // Assets at end of year @@ -84,6 +86,7 @@ void doubleXYData() { + this->setText( _T( "WidgetGraph double sample" ) ); this->setBounds( 250, 0, 250, 200 ); this->setText( _T( "WidgetGraph test of double X - Y data graph" ) ); double xdata[] = @@ -123,10 +126,6 @@ if ( typeid( double ) == typeid( mytype ) ) doubleXYData(); if ( typeid( int ) == typeid( mytype ) ) histogram(); - SmartUtil::tstring title( _T( "WidgetGraph sample for type " ) ); - title += typeid( mytype ).name(); - this->setText( title ); - layout(); onSized( & WidgetGraphTest::isResized ); } Index: WidgetGraph.h =================================================================== RCS file: /cvsroot/smartwin/SmartWin/tests/WidgetGraph/WidgetGraph.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- WidgetGraph.h 5 May 2006 17:14:42 -0000 1.7 +++ WidgetGraph.h 30 Nov 2006 01:05:08 -0000 1.8 @@ -50,8 +50,6 @@ void setYData( const SmartUtil::tstring & inYAxisTitle, NumIter beg, NumIter end ) { setData( itsY, inYAxisTitle, beg, end ); -// itsY.setData( beg, end ); -// calcStrSizes( itsY ); } private: @@ -334,6 +332,8 @@ if ( 0 == itsY.size() ) { + if ( 0 == itsX.size() ) return; // No data at all. + // Draw histogram of X only data. drawHistogram( canvas, rc, graphRect ); } @@ -352,7 +352,7 @@ Point getNumericSize( Numeric n, SmartUtil::tstring & str ) { - std::stringstream ss; + SmartUtil::tstringstream ss; ss << n; str = ss.str(); return this->getTextSize( str ); @@ -366,7 +366,8 @@ void chooseProperties( const SmartWin::MouseEventResult & mouse ) { - InDialog myInDialog( this, "Graph parameters" ); + SmartUtil::tstring title= _T("Graph parameters"); + InDialog myInDialog( this, title ); myInDialog .add( _T( "Axis present?" ), & axisPresent ) .add( _T( "Point color ..." ), & itsPointColor ) |