From 0b3be8e93df4c730a5e0910920beb56d43fa7da1 Mon Sep 17 00:00:00 2001 From: dfighter1985 Date: Thu, 2 Aug 2012 20:42:12 +0200 Subject: [PATCH] CHANGED: #1471 Implemented property querying for for CDBViewQuantity. --HG-- branch : gsoc2012-gui-editor --- code/nel/include/nel/gui/dbview_quantity.h | 1 + code/nel/src/gui/dbview_quantity.cpp | 25 ++++++++++++++++ .../gui_editor/widgets/DBViewQuantity.xml | 29 +++++++++++++++++++ 3 files changed, 55 insertions(+) create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/DBViewQuantity.xml diff --git a/code/nel/include/nel/gui/dbview_quantity.h b/code/nel/include/nel/gui/dbview_quantity.h index da6c2e933..cc6b58ec4 100644 --- a/code/nel/include/nel/gui/dbview_quantity.h +++ b/code/nel/include/nel/gui/dbview_quantity.h @@ -39,6 +39,7 @@ namespace NLGUI /// Constructor CDBViewQuantity(const TCtorParam ¶m); + std::string getProperty( const std::string &name ) const; virtual bool parse (xmlNodePtr cur, CInterfaceGroup * parentGroup); virtual void draw (); diff --git a/code/nel/src/gui/dbview_quantity.cpp b/code/nel/src/gui/dbview_quantity.cpp index 8291d5cc2..eeb334787 100644 --- a/code/nel/src/gui/dbview_quantity.cpp +++ b/code/nel/src/gui/dbview_quantity.cpp @@ -36,6 +36,31 @@ namespace NLGUI } + std::string CDBViewQuantity::getProperty( const std::string &name ) const + { + if( name == "value" ) + { + if( _Number.getNodePtr() != NULL ) + return _Number.getNodePtr()->getFullName(); + else + return ""; + } + else + if( name == "valuemax" ) + { + if( _NumberMax.getNodePtr() != NULL ) + return _NumberMax.getNodePtr()->getFullName(); + else + return ""; + } + else + if( name == "emptytext" ) + { + return _EmptyText.toString(); + } + else + return CViewText::getProperty( name ); + } // *************************************************************************** bool CDBViewQuantity::parse (xmlNodePtr cur, CInterfaceGroup * parentGroup) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/DBViewQuantity.xml b/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/DBViewQuantity.xml new file mode 100644 index 000000000..f6909f82e --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/DBViewQuantity.xml @@ -0,0 +1,29 @@ + +
+ DBViewQuantity + CDBViewQuantity + ViewText + + false + +
+ + + value + string + + + + valuemax + string + + + + emptytext + string + + + + + +