From 620dee15405a0e81eecfbdb1bc9a91597bebac82 Mon Sep 17 00:00:00 2001 From: dfighter1985 Date: Mon, 13 Aug 2012 22:38:02 +0200 Subject: [PATCH] CHANGED: #1471 CGroupTree fields can now we serialized. --- code/nel/include/nel/gui/group_tree.h | 1 + code/nel/src/gui/group_tree.cpp | 31 +++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/code/nel/include/nel/gui/group_tree.h b/code/nel/include/nel/gui/group_tree.h index df7f66aa5..8f3bff568 100644 --- a/code/nel/include/nel/gui/group_tree.h +++ b/code/nel/include/nel/gui/group_tree.h @@ -209,6 +209,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; virtual bool parse (xmlNodePtr cur, CInterfaceGroup * parentGroup); diff --git a/code/nel/src/gui/group_tree.cpp b/code/nel/src/gui/group_tree.cpp index 5f74f1c13..d1c8236a9 100644 --- a/code/nel/src/gui/group_tree.cpp +++ b/code/nel/src/gui/group_tree.cpp @@ -640,6 +640,37 @@ namespace NLGUI CInterfaceGroup::setProperty( name, value ); } + xmlNodePtr CGroupTree::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 "tree" ); + xmlSetProp( node, BAD_CAST "col_over", BAD_CAST toString( _OverColor ).c_str() ); + xmlSetProp( node, BAD_CAST "col_select", BAD_CAST toString( _SelectedColor ).c_str() ); + xmlSetProp( node, BAD_CAST "col_over_back", BAD_CAST toString( _OverColorBack ).c_str() ); + xmlSetProp( node, BAD_CAST "", BAD_CAST "" ); + xmlSetProp( node, BAD_CAST "fontsize", BAD_CAST toString( _FontSize ).c_str() ); + xmlSetProp( node, BAD_CAST "select_ancestor_on_close", BAD_CAST toString( _SelectAncestorOnClose ).c_str() ); + xmlSetProp( node, BAD_CAST "navigate_one_branch", BAD_CAST toString( _NavigateOneBranch ).c_str() ); + xmlSetProp( node, BAD_CAST "arbo_open_first", BAD_CAST _ArboOpenFirst.c_str() ); + xmlSetProp( node, BAD_CAST "arbo_close_just_one", BAD_CAST _ArboCloseJustOne.c_str() ); + xmlSetProp( node, BAD_CAST "arbo_son_without_son", BAD_CAST _ArboSonWithoutSon.c_str() ); + xmlSetProp( node, BAD_CAST "arbo_son_last", BAD_CAST _ArboSonLast.c_str() ); + xmlSetProp( node, BAD_CAST "arbo_son", BAD_CAST _ArboSon.c_str() ); + xmlSetProp( node, BAD_CAST "arbo_x_extend", BAD_CAST _ArboXExtend.c_str() ); + xmlSetProp( node, BAD_CAST "arbo_level", BAD_CAST _ArboLevel.c_str() ); + xmlSetProp( node, BAD_CAST "rectangle_outline", BAD_CAST toString( _RectangleOutlineMode ).c_str() ); + xmlSetProp( node, BAD_CAST "rectangle_x", BAD_CAST toString( _RectangleX ).c_str() ); + xmlSetProp( node, BAD_CAST "rectangle_y", BAD_CAST toString( _RectangleY ).c_str() ); + xmlSetProp( node, BAD_CAST "rectangle_w", BAD_CAST toString( _RectangleW ).c_str() ); + xmlSetProp( node, BAD_CAST "rectangle_h", BAD_CAST toString( _RectangleH ).c_str() ); + xmlSetProp( node, BAD_CAST "rectangle_drl", BAD_CAST toString( _RectangleDeltaRL ).c_str() ); + + return node; + } + // ---------------------------------------------------------------------------- bool CGroupTree::parse (xmlNodePtr cur, CInterfaceGroup * parentGroup) {