From fe1721f00f898db5efe4ad5185b7e03e2cac307e Mon Sep 17 00:00:00 2001 From: dfighter1985 Date: Sat, 4 Aug 2012 08:03:48 +0200 Subject: [PATCH] CHANGED: #1471 Implemented property setting for CViewTextID. --- code/nel/include/nel/gui/view_text_id.h | 1 + code/nel/src/gui/view_text_id.cpp | 37 +++++++++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/code/nel/include/nel/gui/view_text_id.h b/code/nel/include/nel/gui/view_text_id.h index 3404d992a..e12ba4351 100644 --- a/code/nel/include/nel/gui/view_text_id.h +++ b/code/nel/include/nel/gui/view_text_id.h @@ -92,6 +92,7 @@ namespace NLGUI ~CViewTextID(); 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 checkCoords(); diff --git a/code/nel/src/gui/view_text_id.cpp b/code/nel/src/gui/view_text_id.cpp index e6452b187..520c266e0 100644 --- a/code/nel/src/gui/view_text_id.cpp +++ b/code/nel/src/gui/view_text_id.cpp @@ -69,6 +69,43 @@ namespace NLGUI return CViewText::getProperty( name ); } + void CViewTextID::setProperty( const std::string &name, const std::string &value ) + { + if( name == "textid" ) + { + uint32 i; + if( NLMISC::fromString( value, i ) ) + { + _TextId = i; + _IsDBLink = false; + } + else + { + _DBTextId.link( value.c_str() ); + _IsDBLink = true; + } + return; + } + else + if( name == "dynamic_string" ) + { + bool b; + if( NLMISC::fromString( value, b ) ) + _DynamicString = b; + return; + } + else + if( name == "format_taged" ) + { + bool b; + if( NLMISC::fromString( value, b ) ) + _IsTextFormatTaged = b; + return; + } + else + CViewText::setProperty( name, value ); + } + // *************************************************************************** bool CViewTextID::parse(xmlNodePtr cur, CInterfaceGroup * parentGroup) {