From c554c90fbe6db929b2251f4d80bc87f8861a03c0 Mon Sep 17 00:00:00 2001 From: dfighter1985 Date: Wed, 15 Aug 2012 16:35:21 +0200 Subject: [PATCH] CHANGED: #1471 Widgets can now be flagged as non-serializable, in which case they won't be serialized. --HG-- branch : gsoc2012-gui-editor --- code/nel/include/nel/gui/interface_element.h | 6 ++++++ code/nel/src/gui/interface_group.cpp | 9 +++++++++ 2 files changed, 15 insertions(+) diff --git a/code/nel/include/nel/gui/interface_element.h b/code/nel/include/nel/gui/interface_element.h index 54d2a1ada..bc23637a6 100644 --- a/code/nel/include/nel/gui/interface_element.h +++ b/code/nel/include/nel/gui/interface_element.h @@ -107,6 +107,8 @@ namespace NLGUI _AvoidResizeParent= false; editorSelected = false; + + serializable = true; } // dtor @@ -477,6 +479,9 @@ namespace NLGUI void setPosParent( const std::string &id ); void setSizeParent( const std::string &id ); + + void setSerializable( bool b ){ serializable = b; } + bool IsSerializable() const{ return serializable; } protected: @@ -539,6 +544,7 @@ namespace NLGUI private: //void snapSize(); + bool serializable; typedef NLMISC::CSmartPtr TLinkSmartPtr; typedef std::vector TLinkVect; diff --git a/code/nel/src/gui/interface_group.cpp b/code/nel/src/gui/interface_group.cpp index 96eea2aa8..762ca8e89 100644 --- a/code/nel/src/gui/interface_group.cpp +++ b/code/nel/src/gui/interface_group.cpp @@ -721,6 +721,9 @@ namespace NLGUI std::vector< CInterfaceGroup* >::const_iterator itr; for( itr = _ChildrenGroups.begin(); itr != _ChildrenGroups.end(); ++itr ) { + if( !(*itr)->IsSerializable() ) + continue; + (*itr)->serialize( parentNode, "group" ); } @@ -732,6 +735,9 @@ namespace NLGUI std::vector< CCtrlBase* >::const_iterator itr; for( itr = _Controls.begin(); itr != _Controls.end(); ++itr ) { + if( !(*itr)->IsSerializable() ) + continue; + (*itr)->serialize( parentNode, "ctrl" ); } @@ -743,6 +749,9 @@ namespace NLGUI std::vector< CViewBase* >::const_iterator itr; for( itr = _Views.begin(); itr != _Views.end(); ++itr ) { + if( !(*itr)->IsSerializable() ) + continue; + (*itr)->serialize( parentNode, "view" ); }