From 0e365679b7f570508294a1f8bbbe3e5503e9524e Mon Sep 17 00:00:00 2001 From: dfighter1985 Date: Sun, 12 Aug 2012 03:50:55 +0200 Subject: [PATCH] CHANGED: #1471 CViewBitmapCombo fields can now be serialized. --HG-- branch : gsoc2012-gui-editor --- code/nel/include/nel/gui/view_bitmap_combo.h | 1 + code/nel/src/gui/view_bitmap_combo.cpp | 30 ++++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/code/nel/include/nel/gui/view_bitmap_combo.h b/code/nel/include/nel/gui/view_bitmap_combo.h index 4adbd53b7..b120aeae7 100644 --- a/code/nel/include/nel/gui/view_bitmap_combo.h +++ b/code/nel/include/nel/gui/view_bitmap_combo.h @@ -109,6 +109,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; /** diff --git a/code/nel/src/gui/view_bitmap_combo.cpp b/code/nel/src/gui/view_bitmap_combo.cpp index 4e9fa8b19..daa396067 100644 --- a/code/nel/src/gui/view_bitmap_combo.cpp +++ b/code/nel/src/gui/view_bitmap_combo.cpp @@ -257,6 +257,36 @@ namespace NLGUI CViewBase::setProperty( name, value ); } + xmlNodePtr CViewBitmapCombo::serialize( xmlNodePtr parentNode, const char *type ) const + { + xmlNodePtr node = CViewBase::serialize( parentNode, type ); + if( node == NULL ) + return NULL; + + xmlSetProp( node, BAD_CAST "type", BAD_CAST "bitmap_combo" ); + + std::string normal; + std::string over; + std::string pushed; + + getTexList( _Texs, normal ); + getTexList( _TexsOver, over ); + getTexList( _TexsPushed, pushed ); + xmlSetProp( node, BAD_CAST "tx_normal", BAD_CAST normal.c_str() ); + xmlSetProp( node, BAD_CAST "tx_over", BAD_CAST over.c_str() ); + xmlSetProp( node, BAD_CAST "tx_pushed", BAD_CAST pushed.c_str() ); + + getColList( _Col, normal ); + getColList( _ColOver, over ); + getColList( _ColPushed, pushed ); + xmlSetProp( node, BAD_CAST "col_normal", BAD_CAST normal.c_str() ); + xmlSetProp( node, BAD_CAST "col_over", BAD_CAST over.c_str() ); + xmlSetProp( node, BAD_CAST "col_pushed", BAD_CAST pushed.c_str() ); + + + return node; + } + //======================================================================================= bool CViewBitmapCombo::parse(xmlNodePtr cur, CInterfaceGroup * parentGroup) {