mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-11-30 07:35:59 +00:00
CHANGED: #1471 CDBViewQuantity fields can now be serialized.
--HG-- branch : gsoc2012-gui-editor
This commit is contained in:
parent
1d4119c918
commit
81ba2dbcff
2 changed files with 25 additions and 0 deletions
|
@ -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 draw ();
|
virtual void draw ();
|
||||||
|
|
||||||
|
|
|
@ -86,6 +86,30 @@ namespace NLGUI
|
||||||
CViewText::setProperty( name, value );
|
CViewText::setProperty( name, value );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
xmlNodePtr CDBViewQuantity::serialize( xmlNodePtr parentNode, const char *type ) const
|
||||||
|
{
|
||||||
|
xmlNodePtr node = CViewText::serialize( parentNode, type );
|
||||||
|
if( node == NULL )
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
xmlSetProp( node, BAD_CAST "type", BAD_CAST "text_quantity" );
|
||||||
|
|
||||||
|
if( _Number.getNodePtr() != NULL )
|
||||||
|
xmlSetProp( node, BAD_CAST "value", BAD_CAST _Number.getNodePtr()->getFullName().c_str() );
|
||||||
|
else
|
||||||
|
xmlSetProp( node, BAD_CAST "value", BAD_CAST "" );
|
||||||
|
|
||||||
|
if( _NumberMax.getNodePtr() != NULL )
|
||||||
|
xmlSetProp( node, BAD_CAST "valuemax", BAD_CAST _NumberMax.getNodePtr()->getFullName().c_str() );
|
||||||
|
else
|
||||||
|
xmlSetProp( node, BAD_CAST "valuemax", BAD_CAST "" );
|
||||||
|
|
||||||
|
xmlSetProp( node, BAD_CAST "emptytext", BAD_CAST _EmptyText.toString().c_str() );
|
||||||
|
|
||||||
|
return node;
|
||||||
|
}
|
||||||
|
|
||||||
// ***************************************************************************
|
// ***************************************************************************
|
||||||
bool CDBViewQuantity::parse (xmlNodePtr cur, CInterfaceGroup * parentGroup)
|
bool CDBViewQuantity::parse (xmlNodePtr cur, CInterfaceGroup * parentGroup)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue