From e0af9e59cc389cb9b40c01782aaf9a44e6e6605a Mon Sep 17 00:00:00 2001 From: dfighter1985 Date: Tue, 31 Jul 2012 06:45:03 +0200 Subject: [PATCH] CHANGED: #1471 Implemented property querying for CGroupMenu. --HG-- branch : gsoc2012-gui-editor --- code/nel/include/nel/gui/group_menu.h | 4 + code/nel/src/gui/group_menu.cpp | 81 ++++++++++++++++++ .../gui_editor/widgets/ControlBase.xml | 57 ------------- .../plugins/gui_editor/widgets/GroupMenu.xml | 84 +++++++++++++++++++ 4 files changed, 169 insertions(+), 57 deletions(-) delete mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/ControlBase.xml create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/GroupMenu.xml diff --git a/code/nel/include/nel/gui/group_menu.h b/code/nel/include/nel/gui/group_menu.h index b9aad97e8..6d489cb4e 100644 --- a/code/nel/include/nel/gui/group_menu.h +++ b/code/nel/include/nel/gui/group_menu.h @@ -296,6 +296,8 @@ namespace NLGUI TCaseMode getCaseMode() { return _CaseMode; } + std::string getProperty( const std::string &name ) const; + virtual bool parse (xmlNodePtr cur, CInterfaceGroup *parentGroup); virtual void draw (); @@ -366,6 +368,8 @@ namespace NLGUI CGroupSubMenu *_RootMenu; + std::string _Extends; + // Text lookup NLMISC::CRGBA _Color; NLMISC::CRGBA _ShadowColor; diff --git a/code/nel/src/gui/group_menu.cpp b/code/nel/src/gui/group_menu.cpp index 603356055..7256ac148 100644 --- a/code/nel/src/gui/group_menu.cpp +++ b/code/nel/src/gui/group_menu.cpp @@ -1920,6 +1920,85 @@ namespace NLGUI { } + std::string CGroupMenu::getProperty( const std::string &name ) const + { + if( name == "extends" ) + { + return _Extends; + } + else + if( name == "case_mode" ) + { + uint32 cm = _CaseMode; + return toString( cm ); + } + else + if( name == "color" ) + { + return toString( _Color ); + } + else + if( name == "shadow_color" ) + { + return toString( _ShadowColor ); + } + else + if( name == "color_over" ) + { + return toString( _ColorOver ); + } + else + if( name == "shadow_color_over" ) + { + return toString( _ShadowColorOver ); + } + else + if( name == "highlight_over" ) + { + return toString( _HighLightOver ); + } + else + if( name == "color_grayed" ) + { + return toString( _ColorGrayed ); + } + else + if( name == "shadow_color_grayed" ) + { + return toString( _ShadowColorGrayed ); + } + else + if( name == "space" ) + { + return toString( _Space ); + } + else + if( name == "fontsize" ) + { + return toString( _FontSize ); + } + else + if( name == "shadow" ) + { + return toString( _Shadow ); + } + else + if( name == "formatted" ) + { + return toString( _Formatted ); + } + else + if( name == "max_visible_line" ) + { + if( _RootMenu == NULL ) + return "0"; + else + return toString( _RootMenu->getMaxVisibleLine() ); + } + else + return CGroupModal::getProperty( name ); + } + // ------------------------------------------------------------------------------------------------ bool CGroupMenu::parse (xmlNodePtr in, CInterfaceGroup *parentGroup) { @@ -1937,6 +2016,8 @@ namespace NLGUI CGroupSubMenu *gmExtended = NULL; if (prop) { + if( editorMode ) + _Extends = std::string( prop ); CGroupMenu *gm = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(prop)); if (!gm) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/ControlBase.xml b/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/ControlBase.xml deleted file mode 100644 index a88932411..000000000 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/ControlBase.xml +++ /dev/null @@ -1,57 +0,0 @@ - -
- CtrlBase - cb - InterfaceElement - - true - -
- - - tooltip - string - - - - tooltip_i18n - string - - - - on_tooltip - string - - - - on_tooltip_params - string - - - - tooltip_parent - string - - - - tooltip_special_parent - string - - - - tooltip_posref - string - auto - - - tooltip_posref_alt - string - auto - - - instant_help - bool - - - -
diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/GroupMenu.xml b/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/GroupMenu.xml new file mode 100644 index 000000000..e0d22dbf9 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/GroupMenu.xml @@ -0,0 +1,84 @@ + +
+ GroupMenu + CGroupMenu + GroupModal + + false + +
+ + + extends + string + + + + color + string + 255 255 255 255 + + + case_mode + int + 2 + + + shadow_color + string + 0 0 0 255 + + + color_over + string + 255 255 255 255 + + + shadow_color_over + string + 0 0 0 255 + + + highlight_over + string + 128 0 0 255 + + + color_grayed + string + 128 128 128 255 + + + shadow_color_grayed + string + 0 0 0 255 + + + space + int + 3 + + + fontsize + int + 12 + + + shadow + bool + false + + + formatted + bool + false + + + max_visible_line + int + 0 + + + + +