From d0f94ade1511ce9e9605f8639886b3d6133123b5 Mon Sep 17 00:00:00 2001 From: dfighter1985 Date: Tue, 14 Aug 2012 19:29:20 +0200 Subject: [PATCH] CHANGED: #1471 CDBGroupSelectNumber fields can now be serialized. --HG-- branch : gsoc2012-gui-editor --- .../include/nel/gui/dbgroup_select_number.h | 1 + code/nel/src/gui/dbgroup_select_number.cpp | 21 +++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/code/nel/include/nel/gui/dbgroup_select_number.h b/code/nel/include/nel/gui/dbgroup_select_number.h index 5de916c47..7dc53b6ed 100644 --- a/code/nel/include/nel/gui/dbgroup_select_number.h +++ b/code/nel/include/nel/gui/dbgroup_select_number.h @@ -46,6 +46,7 @@ namespace NLGUI std::string getProperty( const std::string &name ) const; void setProperty( const std::string &name, const std::string &value ); + xmlNodePtr serialize( xmlNodePtr parentNode, const char *type ) const; /// 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 b7dd9d738..8153e6df1 100644 --- a/code/nel/src/gui/dbgroup_select_number.cpp +++ b/code/nel/src/gui/dbgroup_select_number.cpp @@ -125,6 +125,27 @@ namespace NLGUI CInterfaceGroup::setProperty( name, value ); } + xmlNodePtr CDBGroupSelectNumber::serialize( xmlNodePtr parentNode, const char *type ) const + { + xmlNodePtr node = CInterfaceGroup::serialize( parentNode, type ); + if( node == NULL ) + return NULL; + + xmlSetProp( node, BAD_CAST "type", BAD_CAST "select_number" ); + + if( _Number.getNodePtr() != NULL ) + xmlSetProp( node, BAD_CAST "value", BAD_CAST _Number.getNodePtr()->getFullName().c_str() ); + else + xmlSetProp( node, BAD_CAST "value", BAD_CAST "" ); + + xmlSetProp( node, BAD_CAST "loop", BAD_CAST toString( _LoopMode ).c_str() ); + xmlSetProp( node, BAD_CAST "min", BAD_CAST toString( _MinValue ).c_str() ); + xmlSetProp( node, BAD_CAST "max", BAD_CAST toString( _MaxValue ).c_str() ); + xmlSetProp( node, BAD_CAST "delta", BAD_CAST toString( _DeltaMultiplier ).c_str() ); + + return node; + } + // *************************************************************************** bool CDBGroupSelectNumber::parse (xmlNodePtr cur, CInterfaceGroup *parentGroup) {