From 42b4eae629a7c3faa02843be8236496699f04a72 Mon Sep 17 00:00:00 2001 From: dfighter1985 Date: Tue, 14 Aug 2012 00:59:29 +0200 Subject: [PATCH] CHANGED: #1471 CGroupWheel fields can now we serialized. --HG-- branch : gsoc2012-gui-editor --- code/nel/include/nel/gui/group_wheel.h | 1 + code/nel/src/gui/group_wheel.cpp | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/code/nel/include/nel/gui/group_wheel.h b/code/nel/include/nel/gui/group_wheel.h index 8cb077ee4..f751285a7 100644 --- a/code/nel/include/nel/gui/group_wheel.h +++ b/code/nel/include/nel/gui/group_wheel.h @@ -33,6 +33,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; /// Coming from CInterfaceElement virtual bool parse(xmlNodePtr cur, CInterfaceGroup * parentGroup); diff --git a/code/nel/src/gui/group_wheel.cpp b/code/nel/src/gui/group_wheel.cpp index 6a9818ea2..c26567e2b 100644 --- a/code/nel/src/gui/group_wheel.cpp +++ b/code/nel/src/gui/group_wheel.cpp @@ -86,6 +86,28 @@ namespace NLGUI CInterfaceGroup::setProperty( name, value ); } + + xmlNodePtr CInterfaceGroupWheel::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 "group_wheel" ); + + xmlSetProp( node, BAD_CAST "on_wheel_up", + BAD_CAST CAHManager::getInstance()->getActionHandlerName( _AHWheelUp ).c_str() ); + + xmlSetProp( node, BAD_CAST "on_wheel_up_params", BAD_CAST _AHWheelUpParams.toString().c_str() ); + + xmlSetProp( node, BAD_CAST "on_wheel_down", + BAD_CAST CAHManager::getInstance()->getActionHandlerName( _AHWheelDown ).c_str() ); + + xmlSetProp( node, BAD_CAST "on_wheel_down_params", BAD_CAST _AHWheelDownParams.toString().c_str() ); + + return node; + } + // ***************************************************************************************************************** bool CInterfaceGroupWheel::parse(xmlNodePtr cur, CInterfaceGroup * parentGroup) {