CHANGED: #1471 Serialize text options for Buttons with text too.

--HG--
branch : gsoc2012-gui-editor
This commit is contained in:
dfighter1985 2012-08-18 02:46:19 +02:00
parent 152aacc41e
commit caa024b0be
3 changed files with 19 additions and 6 deletions

View file

@ -57,6 +57,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 );
bool setTextProperty( const std::string &name, const std::string &value ); bool setTextProperty( const std::string &name, const std::string &value );
bool serializeTextOptions( xmlNodePtr node ) const;
xmlNodePtr serialize( xmlNodePtr parentNode, const char *type ) const; xmlNodePtr serialize( xmlNodePtr parentNode, const char *type ) const;
void parseTextOptions (xmlNodePtr cur); void parseTextOptions (xmlNodePtr cur);
bool parse (xmlNodePtr cur, CInterfaceGroup * parentGroup); bool parse (xmlNodePtr cur, CInterfaceGroup * parentGroup);

View file

@ -444,6 +444,9 @@ namespace NLGUI
xmlNewProp( node, BAD_CAST "force_text_over", BAD_CAST toString( _ForceTextOver ).c_str() ); xmlNewProp( node, BAD_CAST "force_text_over", BAD_CAST toString( _ForceTextOver ).c_str() );
xmlNewProp( node, BAD_CAST "text_header_color", BAD_CAST toString( _TextHeaderColor ).c_str() ); xmlNewProp( node, BAD_CAST "text_header_color", BAD_CAST toString( _TextHeaderColor ).c_str() );
if( _ViewText != NULL )
_ViewText->serializeTextOptions( node );
return node; return node;
} }

View file

@ -495,13 +495,8 @@ namespace NLGUI
} }
xmlNodePtr CViewText::serialize( xmlNodePtr parentNode, const char *type ) const bool CViewText::serializeTextOptions( xmlNodePtr node ) const
{ {
xmlNodePtr node = CViewBase::serialize( parentNode, type );
if( node == NULL )
return NULL;
xmlSetProp( node, BAD_CAST "type", BAD_CAST "text" );
xmlSetProp( node, BAD_CAST "color", BAD_CAST toString( _Color ).c_str() ); 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 "global_color", BAD_CAST toString( _ModulateGlobalColor ).c_str() );
xmlSetProp( node, BAD_CAST "fontsize", xmlSetProp( node, BAD_CAST "fontsize",
@ -544,6 +539,20 @@ namespace NLGUI
xmlSetProp( node, BAD_CAST "clamp_right", BAD_CAST toString( _ClampRight ).c_str() ); xmlSetProp( node, BAD_CAST "clamp_right", BAD_CAST toString( _ClampRight ).c_str() );
xmlSetProp( node, BAD_CAST "auto_clamp_offset", BAD_CAST toString( _AutoClampOffset ).c_str() ); xmlSetProp( node, BAD_CAST "auto_clamp_offset", BAD_CAST toString( _AutoClampOffset ).c_str() );
xmlSetProp( node, BAD_CAST "continuous_update", BAD_CAST toString( _ContinuousUpdate ).c_str() ); xmlSetProp( node, BAD_CAST "continuous_update", BAD_CAST toString( _ContinuousUpdate ).c_str() );
return true;
}
xmlNodePtr CViewText::serialize( xmlNodePtr parentNode, const char *type ) const
{
xmlNodePtr node = CViewBase::serialize( parentNode, type );
if( node == NULL )
return NULL;
xmlSetProp( node, BAD_CAST "type", BAD_CAST "text" );
serializeTextOptions( node );
std::string hs = _Text.toString(); std::string hs = _Text.toString();