From 50dd85e0d657c4e9727fa2d57bf8b6b728a2a9ab Mon Sep 17 00:00:00 2001 From: dfighter1985 Date: Wed, 1 Aug 2012 05:51:35 +0200 Subject: [PATCH] CHANGED: #1471 Implemented property querying for CGroupList. --- code/nel/include/nel/gui/group_list.h | 4 + code/nel/src/gui/group_list.cpp | 81 +++++++++++++++++++ .../plugins/gui_editor/widgets/GroupList.xml | 61 ++++++++++++++ 3 files changed, 146 insertions(+) create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/GroupList.xml diff --git a/code/nel/include/nel/gui/group_list.h b/code/nel/include/nel/gui/group_list.h index f7a2263e2..3e08b1a07 100644 --- a/code/nel/include/nel/gui/group_list.h +++ b/code/nel/include/nel/gui/group_list.h @@ -108,6 +108,8 @@ namespace NLGUI return &_Templ; } + std::string getProperty( const std::string &name ) const; + /** * parse the element and initalize it * \paral cur : pointer to the node describing this element @@ -194,6 +196,8 @@ namespace NLGUI protected: + std::string _HardText; + uint32 _TextId; //max number of elements sint32 _MaxElements; diff --git a/code/nel/src/gui/group_list.cpp b/code/nel/src/gui/group_list.cpp index 78860c5b6..4a163a9a9 100644 --- a/code/nel/src/gui/group_list.cpp +++ b/code/nel/src/gui/group_list.cpp @@ -50,6 +50,7 @@ namespace NLGUI _OverColor = CRGBA(255, 255, 255, 32); _OverElt = -1; _IsGroupList = true; + _TextId = 0; } // ---------------------------------------------------------------------------- @@ -190,6 +191,86 @@ namespace NLGUI } } + std::string CGroupList::getProperty( const std::string &name ) const + { + if( name == "maxelements" ) + { + return toString( _MaxElements ); + } + else + if( name == "addelt" ) + { + switch( _AddElt ) + { + case Top: + return "T"; + break; + + case Left: + return "L"; + break; + + case Right: + return "R"; + break; + } + + return "B"; + } + else + if( name == "align" ) + { + switch( _Align ) + { + case Top: + return "T"; + break; + + case Left: + return "L"; + break; + + case Right: + return "R"; + break; + } + + return "B"; + } + else + if( name == "space" ) + { + return toString( _Space ); + } + else + if( name == "over" ) + { + return toString( _Over ); + } + else + if( name == "dynamic_display_size" ) + { + return toString( _DynamicDisplaySize ); + } + else + if( name == "col_over" ) + { + return toString( _OverColor ); + } + else + if( name == "hardtext" ) + { + return _HardText; + } + else + if( name == "textid" ) + { + return toString( _TextId ); + } + else + return CInterfaceGroup::getProperty( name ); + } + // ---------------------------------------------------------------------------- bool CGroupList::parse (xmlNodePtr cur, CInterfaceGroup * parentGroup) { diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/GroupList.xml b/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/GroupList.xml new file mode 100644 index 000000000..08ab32ee0 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/GroupList.xml @@ -0,0 +1,61 @@ + +
+ GroupList + CGroupList + InterfaceGroup + + false + +
+ + + maxelements + int + 1024 + + + addelt + string + B + + + align + string + L + + + space + int + 0 + + + over + bool + false + + + dynamic_display_size + bool + false + + + col_over + string + 255 255 255 32 + + + hardtext + string + + + + textid + int + 0 + + + + + + +