From 17103b9cb80b32a2c0dd8259170db2cf96b13ce5 Mon Sep 17 00:00:00 2001 From: dfighter1985 Date: Sun, 5 Aug 2012 20:48:31 +0200 Subject: [PATCH] CHANGED: #1471 Implemented property setting for CGroupMenu. --HG-- branch : gsoc2012-gui-editor --- code/nel/include/nel/gui/group_menu.h | 1 + code/nel/src/gui/group_menu.cpp | 118 ++++++++++++++++++++++++++ 2 files changed, 119 insertions(+) diff --git a/code/nel/include/nel/gui/group_menu.h b/code/nel/include/nel/gui/group_menu.h index 6d489cb4e..61c026446 100644 --- a/code/nel/include/nel/gui/group_menu.h +++ b/code/nel/include/nel/gui/group_menu.h @@ -297,6 +297,7 @@ namespace NLGUI TCaseMode getCaseMode() { return _CaseMode; } 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); diff --git a/code/nel/src/gui/group_menu.cpp b/code/nel/src/gui/group_menu.cpp index 7256ac148..3d7f645b0 100644 --- a/code/nel/src/gui/group_menu.cpp +++ b/code/nel/src/gui/group_menu.cpp @@ -1999,6 +1999,124 @@ namespace NLGUI 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) {