From 034231af0fecb9b1bb8869a11a3056c371f265d1 Mon Sep 17 00:00:00 2001 From: dfighter1985 Date: Sun, 5 Aug 2012 20:09:57 +0200 Subject: [PATCH] CHANGED: #1471 Implemented property setting for CGgroupTable. --- code/nel/include/nel/gui/group_table.h | 1 + code/nel/src/gui/group_table.cpp | 43 ++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) diff --git a/code/nel/include/nel/gui/group_table.h b/code/nel/include/nel/gui/group_table.h index 23fed8edf..0368eea50 100644 --- a/code/nel/include/nel/gui/group_table.h +++ b/code/nel/include/nel/gui/group_table.h @@ -148,6 +148,7 @@ namespace NLGUI bool ContinuousUpdate; std::string getProperties( const std::string &name ) const; + void setProperty( const std::string &name, const std::string &value ); protected: diff --git a/code/nel/src/gui/group_table.cpp b/code/nel/src/gui/group_table.cpp index ad340c571..a5e6e9805 100644 --- a/code/nel/src/gui/group_table.cpp +++ b/code/nel/src/gui/group_table.cpp @@ -1202,6 +1202,49 @@ namespace NLGUI return CInterfaceGroup::getProperty( name ); } + void CGroupTable::setProperty( const std::string &name, const std::string &value ) + { + if( name == "border" ) + { + sint32 i; + if( fromString( value, i ) ) + Border = i; + return; + } + else + if( name == "cellpadding" ) + { + sint32 i; + if( fromString( value, i ) ) + CellPadding = i; + return; + } + else + if( name == "cellspacing" ) + { + sint32 i; + if( fromString( value, i ) ) + CellSpacing = i; + return; + } + else + if( name == "bgcolor" ) + { + CRGBA c; + if( fromString( value, c ) ) + BgColor = c; + return; + } + else + if( name == "width" ) + { + convertPixelsOrRatio( value.c_str(), ForceWidthMin, TableRatio ); + return; + } + else + CInterfaceGroup::setProperty( name, value ); + } + // ------------------------------------------------------------------------------------------------ bool CGroupTable::parse (xmlNodePtr cur, CInterfaceGroup * parentGroup) {