From f7682aa14c7f364d64216822a788641f95c519a7 Mon Sep 17 00:00:00 2001 From: dfighter1985 Date: Sat, 11 Aug 2012 19:32:18 +0200 Subject: [PATCH] CHANGED: #1471 CCtrlTooltip fields can now be serialized. --- code/nel/include/nel/gui/ctrl_tooltip.h | 1 + code/nel/src/gui/ctrl_scroll.cpp | 3 +++ code/nel/src/gui/ctrl_tooltip.cpp | 13 +++++++++++++ 3 files changed, 17 insertions(+) diff --git a/code/nel/include/nel/gui/ctrl_tooltip.h b/code/nel/include/nel/gui/ctrl_tooltip.h index 6c49a194c..e70f55108 100644 --- a/code/nel/include/nel/gui/ctrl_tooltip.h +++ b/code/nel/include/nel/gui/ctrl_tooltip.h @@ -41,6 +41,7 @@ namespace NLGUI virtual bool handleEvent (const NLGUI::CEventDescriptor& eventDesc); virtual void draw(); + xmlNodePtr serialize( xmlNodePtr parentNode, const char *type ) const; virtual bool parse (xmlNodePtr cur, CInterfaceGroup *parentGroup); // Can do nothing with tooltip (but display it :) ) virtual bool isCapturable() const {return false;} diff --git a/code/nel/src/gui/ctrl_scroll.cpp b/code/nel/src/gui/ctrl_scroll.cpp index ac52f4607..d7b3c5274 100644 --- a/code/nel/src/gui/ctrl_scroll.cpp +++ b/code/nel/src/gui/ctrl_scroll.cpp @@ -398,6 +398,9 @@ namespace NLGUI if( node == NULL ) return NULL; + if( xmlGetProp( node, BAD_CAST "type" ) == NULL ) + xmlSetProp( node, BAD_CAST "type", BAD_CAST "scroll" ); + xmlSetProp( node, BAD_CAST "tx_bottomleft", BAD_CAST getTextureBottomOrLeft().c_str() ); xmlSetProp( node, BAD_CAST "tx_middle", BAD_CAST getTextureMiddle().c_str() ); xmlSetProp( node, BAD_CAST "tx_topright", BAD_CAST getTextureTopOrRight().c_str() ); diff --git a/code/nel/src/gui/ctrl_tooltip.cpp b/code/nel/src/gui/ctrl_tooltip.cpp index 0900084a9..7b895dad6 100644 --- a/code/nel/src/gui/ctrl_tooltip.cpp +++ b/code/nel/src/gui/ctrl_tooltip.cpp @@ -44,6 +44,19 @@ namespace NLGUI return false; } + + xmlNodePtr CCtrlToolTip::serialize( xmlNodePtr parentNode, const char *type ) const + { + xmlNodePtr node = CCtrlBase::serialize( parentNode, type ); + if( node == NULL ) + return NULL; + + if( xmlGetProp( node, BAD_CAST "type" ) == NULL ) + xmlSetProp( node, BAD_CAST "type", BAD_CAST "tooltip" ); + + return node; + } + // ---------------------------------------------------------------------------- bool CCtrlToolTip::parse(xmlNodePtr cur, CInterfaceGroup *parentGroup) {