CHANGED: #1471 CViewTextIDFormated fields can now be serialized.

This commit is contained in:
dfighter1985 2012-08-12 01:32:21 +02:00
parent 0985fd8acd
commit 09458f2452
2 changed files with 13 additions and 0 deletions

View file

@ -41,6 +41,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;
virtual bool parse(xmlNodePtr cur, CInterfaceGroup * parentGroup); virtual bool parse(xmlNodePtr cur, CInterfaceGroup * parentGroup);
virtual void checkCoords(); virtual void checkCoords();
const ucstring &getFormatString() const { return _FormatString; } const ucstring &getFormatString() const { return _FormatString; }

View file

@ -48,6 +48,18 @@ namespace NLGUI
CViewTextID::setProperty( name, value ); CViewTextID::setProperty( name, value );
} }
xmlNodePtr CViewTextIDFormated::serialize( xmlNodePtr parentNode, const char *type ) const
{
xmlNodePtr node = CViewTextID::serialize( parentNode, type );
if( node == NULL )
return NULL;
xmlSetProp( node, BAD_CAST "type", BAD_CAST "text_id_formated" );
xmlSetProp( node, BAD_CAST "format", BAD_CAST getFormatString().c_str() );
return node;
}
// ********************************************************************************* // *********************************************************************************
bool CViewTextIDFormated::parse(xmlNodePtr cur,CInterfaceGroup * parentGroup) bool CViewTextIDFormated::parse(xmlNodePtr cur,CInterfaceGroup * parentGroup)
{ {