From d67ffd246b790cc880a90ce4a860791f44076ffc Mon Sep 17 00:00:00 2001 From: dfighter1985 Date: Thu, 2 Aug 2012 20:25:42 +0200 Subject: [PATCH] CHANGED: #1471 Implemented property querying for for CDBViewNumber. --HG-- branch : gsoc2012-gui-editor --- code/nel/include/nel/gui/dbview_number.h | 1 + code/nel/src/gui/dbview_number.cpp | 42 ++++++++++++++++ .../gui_editor/widgets/DBViewNumber.xml | 48 +++++++++++++++++++ 3 files changed, 91 insertions(+) create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/DBViewNumber.xml diff --git a/code/nel/include/nel/gui/dbview_number.h b/code/nel/include/nel/gui/dbview_number.h index 9f40e97c1..a7fcf612a 100644 --- a/code/nel/include/nel/gui/dbview_number.h +++ b/code/nel/include/nel/gui/dbview_number.h @@ -39,6 +39,7 @@ namespace NLGUI /// Constructor CDBViewNumber(const TCtorParam ¶m); + std::string getProperty( const std::string &name ) const; virtual bool parse (xmlNodePtr cur, CInterfaceGroup * parentGroup); virtual void checkCoords(); virtual void draw (); diff --git a/code/nel/src/gui/dbview_number.cpp b/code/nel/src/gui/dbview_number.cpp index 74df94f42..ca8c4271c 100644 --- a/code/nel/src/gui/dbview_number.cpp +++ b/code/nel/src/gui/dbview_number.cpp @@ -41,6 +41,48 @@ namespace NLGUI _Modulo = 0; } + std::string CDBViewNumber::getProperty( const std::string &name ) const + { + if( name == "value" ) + { + if( _Number.getNodePtr() != NULL ) + return _Number.getNodePtr()->getFullName(); + else + return ""; + } + else + if( name == "positive" ) + { + return toString( _Positive ); + } + else + if( name == "format" ) + { + return toString( _Format ); + } + else + if( name == "divisor" ) + { + return toString( _Divisor ); + } + else + if( name == "modulo" ) + { + return toString( _Modulo ); + } + else + if( name == "suffix" ) + { + return _Suffix.toString(); + } + else + if( name == "prefix" ) + { + return _Prefix.toString(); + } + else + return CViewText::getProperty( name ); + } // *************************************************************************** bool CDBViewNumber::parse (xmlNodePtr cur, CInterfaceGroup * parentGroup) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/DBViewNumber.xml b/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/DBViewNumber.xml new file mode 100644 index 000000000..faf5e4a9e --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/DBViewNumber.xml @@ -0,0 +1,48 @@ + +
+ DBViewNumber + CDBViewNumber + ViewText + + false + +
+ + + value + string + + + + positive + bool + false + + + format + bool + false + + + divisor + int + 1 + + + modulo + int + 0 + + + suffix + string + + + + prefix + string + + + + +