From 87e5b794aee50ff87f73e291d8a30cb9bd587f7b Mon Sep 17 00:00:00 2001 From: dfighter1985 Date: Tue, 7 Aug 2012 01:54:36 +0200 Subject: [PATCH] CHANGED: Implemented property setting for CDBGroupComboBox. --- code/nel/include/nel/gui/dbgroup_combo_box.h | 3 ++ code/nel/src/gui/dbgroup_combo_box.cpp | 36 ++++++++++++++++++++ 2 files changed, 39 insertions(+) diff --git a/code/nel/include/nel/gui/dbgroup_combo_box.h b/code/nel/include/nel/gui/dbgroup_combo_box.h index e7a808f13..586e1ccd3 100644 --- a/code/nel/include/nel/gui/dbgroup_combo_box.h +++ b/code/nel/include/nel/gui/dbgroup_combo_box.h @@ -44,6 +44,9 @@ namespace NLGUI CDBGroupComboBox(const TCtorParam ¶m); ~CDBGroupComboBox(); + std::string getProperty( const std::string &name ) const; + void setProperty( const std::string &name, const std::string &value ); + /// CInterfaceGroup Interface virtual bool parse (xmlNodePtr cur, CInterfaceGroup *parentGroup); virtual void updateCoords (); diff --git a/code/nel/src/gui/dbgroup_combo_box.cpp b/code/nel/src/gui/dbgroup_combo_box.cpp index 5191e1f68..1748db7df 100644 --- a/code/nel/src/gui/dbgroup_combo_box.cpp +++ b/code/nel/src/gui/dbgroup_combo_box.cpp @@ -74,6 +74,42 @@ namespace NLGUI return width; } + std::string CDBGroupComboBox::getProperty( const std::string &name ) const + { + if( name == "linked_to_db" ) + { + return toString( _LinkedToDB ); + } + else + if( name == "value" ) + { + if( _Selection.getNodePtr() != NULL ) + return _Selection.getNodePtr()->getFullName(); + else + return ""; + } + else + return CInterfaceGroup::getProperty( name ); + } + + void CDBGroupComboBox::setProperty( const std::string &name, const std::string &value ) + { + if( name == "linked_to_db" ) + { + bool b; + if( fromString( value, b ) ) + _LinkedToDB = b; + return; + } + else + if( name == "value" ) + { + _Selection.link( value.c_str() ); + return; + } + else + CInterfaceGroup::setProperty( name, value ); + } // *************************************************************************** bool CDBGroupComboBox::parse (xmlNodePtr cur, CInterfaceGroup *parentGroup)