mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-11-25 16:46:17 +00:00
CHANGED: #1471 CViewTextFormated and CViewTextID fields can now be serialized.
This commit is contained in:
parent
ebadfe84a1
commit
0985fd8acd
13 changed files with 46 additions and 22 deletions
|
@ -48,6 +48,7 @@ namespace NLGUI
|
|||
{}
|
||||
std::string getProperty( const std::string &name ) const;
|
||||
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 void checkCoords();
|
||||
const ucstring &getFormatString() const { return _FormatString; }
|
||||
|
|
|
@ -93,6 +93,7 @@ namespace NLGUI
|
|||
|
||||
std::string getProperty( const std::string &name ) const;
|
||||
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 void checkCoords();
|
||||
|
||||
|
|
|
@ -396,9 +396,7 @@ namespace NLGUI
|
|||
if( node == NULL )
|
||||
return NULL;
|
||||
|
||||
if( xmlGetProp( node, BAD_CAST "type" ) == NULL )
|
||||
xmlSetProp( node, BAD_CAST "type", BAD_CAST "button" );
|
||||
|
||||
xmlNewProp( node, BAD_CAST "button_type", BAD_CAST getTypeString().c_str() );
|
||||
xmlNewProp( node, BAD_CAST "pushed", BAD_CAST toString( _Pushed ).c_str() );
|
||||
xmlNewProp( node, BAD_CAST "over_when_pushed", BAD_CAST toString( _OverWhenPushed ).c_str() );
|
||||
|
|
|
@ -153,7 +153,6 @@ namespace NLGUI
|
|||
if( node == NULL )
|
||||
return NULL;
|
||||
|
||||
if( xmlGetProp( node, BAD_CAST "type" ) == NULL )
|
||||
xmlSetProp( node, BAD_CAST "type", BAD_CAST "button" );
|
||||
|
||||
xmlNewProp( node, BAD_CAST "tx_normal",
|
||||
|
|
|
@ -156,7 +156,6 @@ namespace NLGUI
|
|||
if( node == NULL )
|
||||
return NULL;
|
||||
|
||||
if( xmlGetProp( node, BAD_CAST "type" ) == NULL )
|
||||
xmlSetProp( node, BAD_CAST "type", BAD_CAST "colpick" );
|
||||
|
||||
xmlSetProp( node, BAD_CAST "texture",
|
||||
|
|
|
@ -398,9 +398,7 @@ namespace NLGUI
|
|||
if( node == NULL )
|
||||
return NULL;
|
||||
|
||||
if( xmlGetProp( node, BAD_CAST "type" ) == NULL )
|
||||
xmlSetProp( node, BAD_CAST "type", BAD_CAST "scroll" );
|
||||
|
||||
xmlSetProp( node, BAD_CAST "tx_bottomleft", BAD_CAST getTextureBottomOrLeft().c_str() );
|
||||
xmlSetProp( node, BAD_CAST "tx_middle", BAD_CAST getTextureMiddle().c_str() );
|
||||
xmlSetProp( node, BAD_CAST "tx_topright", BAD_CAST getTextureTopOrRight().c_str() );
|
||||
|
|
|
@ -386,7 +386,6 @@ namespace NLGUI
|
|||
if( node == NULL )
|
||||
return NULL;
|
||||
|
||||
if( xmlGetProp( node, BAD_CAST "type" ) == NULL )
|
||||
xmlSetProp( node, BAD_CAST "type", BAD_CAST "text_button" );
|
||||
|
||||
std::string tex;
|
||||
|
|
|
@ -51,7 +51,6 @@ namespace NLGUI
|
|||
if( node == NULL )
|
||||
return NULL;
|
||||
|
||||
if( xmlGetProp( node, BAD_CAST "type" ) == NULL )
|
||||
xmlSetProp( node, BAD_CAST "type", BAD_CAST "tooltip" );
|
||||
|
||||
return node;
|
||||
|
|
|
@ -109,7 +109,6 @@ namespace NLGUI
|
|||
if( node == NULL )
|
||||
return NULL;
|
||||
|
||||
if( xmlGetProp( node, BAD_CAST "type" ) == NULL )
|
||||
xmlSetProp( node, BAD_CAST "type", BAD_CAST "digit" );
|
||||
|
||||
if( _Number.getNodePtr() != NULL )
|
||||
|
|
|
@ -798,9 +798,7 @@ namespace NLGUI
|
|||
if( node == NULL )
|
||||
return NULL;
|
||||
|
||||
if( xmlGetProp( node, BAD_CAST "type" ) == NULL )
|
||||
xmlSetProp( node, BAD_CAST "type", BAD_CAST "tab" );
|
||||
|
||||
xmlNewProp( node, BAD_CAST "group", BAD_CAST _AssociatedGroup.c_str() );
|
||||
|
||||
return node;
|
||||
|
|
|
@ -501,9 +501,7 @@ namespace NLGUI
|
|||
if( node == NULL )
|
||||
return NULL;
|
||||
|
||||
if( xmlGetProp( node, BAD_CAST "type" ) == NULL )
|
||||
xmlSetProp( node, BAD_CAST "type", BAD_CAST "text" );
|
||||
|
||||
xmlSetProp( node, BAD_CAST "color", BAD_CAST toString( _Color ).c_str() );
|
||||
xmlSetProp( node, BAD_CAST "global_color", BAD_CAST toString( _ModulateGlobalColor ).c_str() );
|
||||
xmlSetProp( node, BAD_CAST "fontsize",
|
||||
|
|
|
@ -46,6 +46,18 @@ namespace NLGUI
|
|||
CViewText::setProperty( name, value );
|
||||
}
|
||||
|
||||
xmlNodePtr CViewTextFormated::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_formated" );
|
||||
xmlSetProp( node, BAD_CAST "format", BAD_CAST getFormatString().c_str() );
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// ****************************************************************************
|
||||
bool CViewTextFormated::parse(xmlNodePtr cur,CInterfaceGroup * parentGroup)
|
||||
{
|
||||
|
|
|
@ -106,6 +106,29 @@ namespace NLGUI
|
|||
CViewText::setProperty( name, value );
|
||||
}
|
||||
|
||||
|
||||
xmlNodePtr CViewTextID::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_id" );
|
||||
|
||||
if( _DBTextId.getNodePtr() != NULL )
|
||||
xmlSetProp( node, BAD_CAST "textid", BAD_CAST _DBTextId.getNodePtr()->getFullName().c_str() );
|
||||
else
|
||||
xmlSetProp( node, BAD_CAST "textid", BAD_CAST "" );
|
||||
|
||||
xmlSetProp( node, BAD_CAST "dynamic_string",
|
||||
BAD_CAST NLMISC::toString( _DynamicString ).c_str() );
|
||||
|
||||
xmlSetProp( node, BAD_CAST "format_taged",
|
||||
BAD_CAST NLMISC::toString( _IsTextFormatTaged ).c_str() );
|
||||
|
||||
return node;
|
||||
}
|
||||
|
||||
// ***************************************************************************
|
||||
bool CViewTextID::parse(xmlNodePtr cur, CInterfaceGroup * parentGroup)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue