CHANGED: #1471 Implemented property setting for CGroupMenu.

This commit is contained in:
dfighter1985 2012-08-05 20:48:31 +02:00
parent 3fcf024368
commit 2a99bb57d1
2 changed files with 119 additions and 0 deletions

View file

@ -297,6 +297,7 @@ namespace NLGUI
TCaseMode getCaseMode() { return _CaseMode; } TCaseMode getCaseMode() { return _CaseMode; }
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 );
virtual bool parse (xmlNodePtr cur, CInterfaceGroup *parentGroup); virtual bool parse (xmlNodePtr cur, CInterfaceGroup *parentGroup);

View file

@ -1999,6 +1999,124 @@ namespace NLGUI
return CGroupModal::getProperty( name ); return CGroupModal::getProperty( name );
} }
void CGroupMenu::setProperty( const std::string &name, const std::string &value )
{
if( name == "extends" )
{
_Extends = value;
return;
}
else
if( name == "case_mode" )
{
uint32 cm;
if( fromString( value, cm ) )
_CaseMode = (TCaseMode)cm;
return;
}
else
if( name == "color" )
{
CRGBA c;
if( fromString( value, c ) )
_Color = c;
return;
}
else
if( name == "shadow_color" )
{
CRGBA c;
if( fromString( value, c ) )
_ShadowColor = c;
return;
}
else
if( name == "color_over" )
{
CRGBA c;
if( fromString( value, c ) )
_ColorOver = c;
return;
}
else
if( name == "shadow_color_over" )
{
CRGBA c;
if( fromString( value, c ) )
_ShadowColorOver = c;
return;
}
else
if( name == "highlight_over" )
{
CRGBA c;
if( fromString( value, c ) )
_HighLightOver = c;
return;
}
else
if( name == "color_grayed" )
{
CRGBA c;
if( fromString( value, c ) )
_ColorGrayed = c;
return;
}
else
if( name == "shadow_color_grayed" )
{
CRGBA c;
if( fromString( value, c ) )
_ShadowColorGrayed = c;
return;
}
else
if( name == "space" )
{
uint8 i;
if( fromString( value, i ) )
_Space = i;
return;
}
else
if( name == "fontsize" )
{
sint32 i;
if( fromString( value, i ) )
_FontSize = i;
return;
}
else
if( name == "shadow" )
{
bool b;
if( fromString( value, b ) )
_Shadow = b;
return;
}
else
if( name == "formatted" )
{
bool b;
if( fromString( value, b ) )
_Formatted = b;
return;
}
else
if( name == "max_visible_line" )
{
if( _RootMenu != NULL )
{
sint32 i;
if( fromString( value, i ) )
_RootMenu->setMaxVisibleLine( i );
}
return;
}
else
CGroupModal::setProperty( name, value );
}
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
bool CGroupMenu::parse (xmlNodePtr in, CInterfaceGroup *parentGroup) bool CGroupMenu::parse (xmlNodePtr in, CInterfaceGroup *parentGroup)
{ {