From 1d0e897b55af27e3cf951476f8daef57f5c0f8e1 Mon Sep 17 00:00:00 2001 From: dfighter1985 Date: Thu, 2 Aug 2012 06:25:41 +0200 Subject: [PATCH] CHANGED: #1471 Implemented property querying for CDBViewDigit. --HG-- branch : gsoc2012-gui-editor --- code/nel/include/nel/gui/dbview_digit.h | 1 + code/nel/src/gui/dbview_digit.cpp | 29 +++++++++++++++++ .../gui_editor/widgets/DBViewDigit.xml | 32 +++++++++++++++++++ 3 files changed, 62 insertions(+) create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/DBViewDigit.xml diff --git a/code/nel/include/nel/gui/dbview_digit.h b/code/nel/include/nel/gui/dbview_digit.h index 05a5db6b2..ce4d27f04 100644 --- a/code/nel/include/nel/gui/dbview_digit.h +++ b/code/nel/include/nel/gui/dbview_digit.h @@ -38,6 +38,7 @@ namespace NLGUI /// Constructor CDBViewDigit(const TCtorParam ¶m); + std::string getProperty( const std::string &name ) const; virtual bool parse (xmlNodePtr cur, CInterfaceGroup * parentGroup); virtual void draw (); virtual void updateCoords(); diff --git a/code/nel/src/gui/dbview_digit.cpp b/code/nel/src/gui/dbview_digit.cpp index f8affb858..ac040cd3d 100644 --- a/code/nel/src/gui/dbview_digit.cpp +++ b/code/nel/src/gui/dbview_digit.cpp @@ -38,6 +38,35 @@ namespace NLGUI } + std::string CDBViewDigit::getProperty( const std::string &name ) const + { + if( name == "value" ) + { + if( _Number.getNodePtr() != NULL ) + return _Number.getNodePtr()->getFullName(); + else + return ""; + } + else + if( name == "numdigit" ) + { + return toString( _NumDigit ); + } + else + if( name == "wspace" ) + { + return toString( _WSpace ); + } + else + if( name == "color" ) + { + return toString( _Color ); + } + else + return CViewBase::getProperty( name ); + } + + // *************************************************************************** bool CDBViewDigit::parse (xmlNodePtr cur, CInterfaceGroup * parentGroup) { diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/DBViewDigit.xml b/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/DBViewDigit.xml new file mode 100644 index 000000000..c83a9722f --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/DBViewDigit.xml @@ -0,0 +1,32 @@ + +
+ DBViewDigit + CDBViewDigit + CtrlBase + + false + +
+ + + value + string + + + + numdigit + int + 2 + + + wspace + int + -1 + + + color + string + 255 255 255 255 + + +