CHANGED: #1471 CGroupTable fields can now be serialized.

--HG--
branch : gsoc2012-gui-editor
This commit is contained in:
dfighter1985 2012-08-13 01:58:39 +02:00
parent 11a3e03253
commit d1cf73e368
2 changed files with 22 additions and 0 deletions

View file

@ -150,6 +150,7 @@ namespace NLGUI
std::string getProperties( const std::string &name ) const;
void setProperty( const std::string &name, const std::string &value );
xmlNodePtr serialize( xmlNodePtr parentNode, const char *type ) const;
protected:

View file

@ -1306,6 +1306,27 @@ namespace NLGUI
CInterfaceGroup::setProperty( name, value );
}
xmlNodePtr CGroupTable::serialize( xmlNodePtr parentNode, const char *type ) const
{
xmlNodePtr node = CInterfaceGroup::serialize( parentNode, type );
if( node == NULL )
return NULL;
xmlSetProp( node, BAD_CAST "type", BAD_CAST "table" );
xmlSetProp( node, BAD_CAST "border", BAD_CAST toString( Border ).c_str() );
xmlSetProp( node, BAD_CAST "cellpadding", BAD_CAST toString( CellPadding ).c_str() );
xmlSetProp( node, BAD_CAST "cellspacing", BAD_CAST toString( CellSpacing ).c_str() );
xmlSetProp( node, BAD_CAST "bgcolor", BAD_CAST toString( BgColor ).c_str() );
if( ForceWidthMin != 0 )
xmlSetProp( node, BAD_CAST "width", BAD_CAST toString( ForceWidthMin ).c_str() );
else
xmlSetProp( node, BAD_CAST "width", BAD_CAST toString( TableRatio * 100.0f ).c_str() );
return node;
}
// ------------------------------------------------------------------------------------------------
bool CGroupTable::parse (xmlNodePtr cur, CInterfaceGroup * parentGroup)
{