CHANGED: #1471 CDBGroupComboBox fields can now be serialized.

--HG--
branch : gsoc2012-gui-editor
This commit is contained in:
dfighter1985 2012-08-14 18:43:21 +02:00
parent 005afd7aab
commit 8a33e0ea9f
2 changed files with 19 additions and 0 deletions

View file

@ -46,6 +46,7 @@ namespace NLGUI
std::string getProperty( const std::string &name ) const; std::string getProperty( const std::string &name ) const;
void setProperty( const std::string &name, const std::string &value ); void setProperty( const std::string &name, const std::string &value );
xmlNodePtr serialize( xmlNodePtr parentNode, const char *type ) const;
/// CInterfaceGroup Interface /// CInterfaceGroup Interface
virtual bool parse (xmlNodePtr cur, CInterfaceGroup *parentGroup); virtual bool parse (xmlNodePtr cur, CInterfaceGroup *parentGroup);

View file

@ -111,6 +111,24 @@ namespace NLGUI
CInterfaceGroup::setProperty( name, value ); CInterfaceGroup::setProperty( name, value );
} }
xmlNodePtr CDBGroupComboBox::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 "combo_box" );
xmlSetProp( node, BAD_CAST "linked_to_db", BAD_CAST toString( _LinkedToDB ).c_str() );
if( _Selection.getNodePtr() != NULL )
xmlSetProp( node, BAD_CAST "value", BAD_CAST _Selection.getNodePtr()->getFullName().c_str() );
else
xmlSetProp( node, BAD_CAST "value", BAD_CAST "" );
return node;
}
// *************************************************************************** // ***************************************************************************
bool CDBGroupComboBox::parse (xmlNodePtr cur, CInterfaceGroup *parentGroup) bool CDBGroupComboBox::parse (xmlNodePtr cur, CInterfaceGroup *parentGroup)
{ {