From a0f0ef0ac86b2a998145b670eb6547a7432b5429 Mon Sep 17 00:00:00 2001 From: dfighter1985 Date: Sat, 4 Aug 2012 01:56:11 +0200 Subject: [PATCH] CHANGED: #1471 Implemented property setting for CDBViewDigit. --- code/nel/include/nel/gui/dbview_digit.h | 1 + code/nel/src/gui/dbview_digit.cpp | 36 +++++++++++++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/code/nel/include/nel/gui/dbview_digit.h b/code/nel/include/nel/gui/dbview_digit.h index ce4d27f04..14adf2cba 100644 --- a/code/nel/include/nel/gui/dbview_digit.h +++ b/code/nel/include/nel/gui/dbview_digit.h @@ -39,6 +39,7 @@ namespace NLGUI CDBViewDigit(const TCtorParam ¶m); std::string getProperty( const std::string &name ) const; + void setProperty( const std::string &name, const std::string &value ); virtual bool parse (xmlNodePtr cur, CInterfaceGroup * parentGroup); virtual void draw (); virtual void updateCoords(); diff --git a/code/nel/src/gui/dbview_digit.cpp b/code/nel/src/gui/dbview_digit.cpp index ac040cd3d..e511d5953 100644 --- a/code/nel/src/gui/dbview_digit.cpp +++ b/code/nel/src/gui/dbview_digit.cpp @@ -67,6 +67,42 @@ namespace NLGUI } + void CDBViewDigit::setProperty( const std::string &name, const std::string &value ) + { + if( name == "value" ) + { + _Number.link( value.c_str() ); + return; + } + else + if( name == "numdigit" ) + { + sint32 i; + if( fromString( value, i ) ) + _NumDigit = i; + return; + } + else + if( name == "wspace" ) + { + sint32 i; + if( fromString( value, i ) ) + _WSpace = i; + return; + } + else + if( name == "color" ) + { + CRGBA c; + if( fromString( value, c ) ) + _Color = c; + return; + } + else + CViewBase::setProperty( name, value ); + } + + // *************************************************************************** bool CDBViewDigit::parse (xmlNodePtr cur, CInterfaceGroup * parentGroup) {