From 900fccaa2e7bd574aab02a1f7d32c66e71af21f2 Mon Sep 17 00:00:00 2001 From: dfighter1985 Date: Tue, 7 Aug 2012 02:29:23 +0200 Subject: [PATCH] CHANGED: Implemented property setting for CDBGroupSelectNumber. --HG-- branch : gsoc2012-gui-editor --- .../include/nel/gui/dbgroup_select_number.h | 1 + code/nel/src/gui/dbgroup_select_number.cpp | 43 +++++++++++++++++++ 2 files changed, 44 insertions(+) diff --git a/code/nel/include/nel/gui/dbgroup_select_number.h b/code/nel/include/nel/gui/dbgroup_select_number.h index 4a88fa134..5de916c47 100644 --- a/code/nel/include/nel/gui/dbgroup_select_number.h +++ b/code/nel/include/nel/gui/dbgroup_select_number.h @@ -45,6 +45,7 @@ namespace NLGUI ~CDBGroupSelectNumber(); std::string getProperty( const std::string &name ) const; + void setProperty( const std::string &name, const std::string &value ); /// CInterfaceGroup Interface virtual bool parse (xmlNodePtr cur, CInterfaceGroup *parentGroup); diff --git a/code/nel/src/gui/dbgroup_select_number.cpp b/code/nel/src/gui/dbgroup_select_number.cpp index f56883fce..b7dd9d738 100644 --- a/code/nel/src/gui/dbgroup_select_number.cpp +++ b/code/nel/src/gui/dbgroup_select_number.cpp @@ -82,6 +82,49 @@ namespace NLGUI return CInterfaceGroup::getProperty( name ); } + void CDBGroupSelectNumber::setProperty( const std::string &name, const std::string &value ) + { + if( name == "value" ) + { + _Number.link( value.c_str() ); + return; + } + else + if( name == "loop" ) + { + bool b; + if( fromString( value, b ) ) + _LoopMode = b; + return; + } + else + if( name == "min" ) + { + sint i; + if( fromString( value, i ) ) + _MinValue = i; + return; + } + else + if( name == "max" ) + { + sint i; + if( fromString( value, i ) ) + _MaxValue = i; + return; + } + else + if( name == "delta" ) + { + sint i; + if( fromString( value, i ) ) + _DeltaMultiplier = i; + return; + } + else + CInterfaceGroup::setProperty( name, value ); + } + // *************************************************************************** bool CDBGroupSelectNumber::parse (xmlNodePtr cur, CInterfaceGroup *parentGroup) {