From 75aa4b03e34cbd6a60e4538c69f6694c4788e22e Mon Sep 17 00:00:00 2001 From: dfighter1985 Date: Wed, 1 Aug 2012 18:42:01 +0200 Subject: [PATCH] CHANGED: #1471 Implemented property querying for CDBGroupSelectNumber. --- .../include/nel/gui/dbgroup_select_number.h | 2 + code/nel/src/gui/dbgroup_select_number.cpp | 33 +++++++++++++++++ .../widgets/DBGroupSelectNumber.xml | 37 +++++++++++++++++++ 3 files changed, 72 insertions(+) create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/DBGroupSelectNumber.xml diff --git a/code/nel/include/nel/gui/dbgroup_select_number.h b/code/nel/include/nel/gui/dbgroup_select_number.h index 1e12caaa3..4a88fa134 100644 --- a/code/nel/include/nel/gui/dbgroup_select_number.h +++ b/code/nel/include/nel/gui/dbgroup_select_number.h @@ -44,6 +44,8 @@ namespace NLGUI CDBGroupSelectNumber(const TCtorParam ¶m); ~CDBGroupSelectNumber(); + std::string getProperty( const std::string &name ) const; + /// CInterfaceGroup Interface virtual bool parse (xmlNodePtr cur, CInterfaceGroup *parentGroup); virtual void updateCoords (); diff --git a/code/nel/src/gui/dbgroup_select_number.cpp b/code/nel/src/gui/dbgroup_select_number.cpp index 6b3dccd8c..f56883fce 100644 --- a/code/nel/src/gui/dbgroup_select_number.cpp +++ b/code/nel/src/gui/dbgroup_select_number.cpp @@ -49,6 +49,39 @@ namespace NLGUI { } + std::string CDBGroupSelectNumber::getProperty( const std::string &name ) const + { + if( name == "value" ) + { + if( _Number.getNodePtr() != NULL ) + return _Number.getNodePtr()->getFullName(); + else + return ""; + } + else + if( name == "loop" ) + { + return toString( _LoopMode ); + } + else + if( name == "min" ) + { + return toString( _MinValue ); + } + else + if( name == "max" ) + { + return toString( _MaxValue ); + } + else + if( name == "delta" ) + { + return toString( _DeltaMultiplier ); + } + else + return CInterfaceGroup::getProperty( name ); + } + // *************************************************************************** bool CDBGroupSelectNumber::parse (xmlNodePtr cur, CInterfaceGroup *parentGroup) { diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/DBGroupSelectNumber.xml b/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/DBGroupSelectNumber.xml new file mode 100644 index 000000000..4eb55a199 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/DBGroupSelectNumber.xml @@ -0,0 +1,37 @@ + +
+ DBGroupSelectNumber + CDBGroupSelectNumber + InterfaceGroup + + false + +
+ + + value + string + + + + loop + bool + true + + + min + int + 0 + + + max + int + 9 + + + delta + int + 1 + + +