From 9a0e7661ca3dd3522879f17b2303d76d476ca625 Mon Sep 17 00:00:00 2001 From: dfighter1985 Date: Thu, 2 Aug 2012 19:41:49 +0200 Subject: [PATCH] CHANGED: #1471 Implemented property querying for for CViewTextID. --- code/nel/include/nel/gui/view_text_id.h | 1 + code/nel/src/gui/view_text_id.cpp | 23 +++++++++++++++ .../plugins/gui_editor/widgets/ViewTextID.xml | 29 +++++++++++++++++++ 3 files changed, 53 insertions(+) create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/ViewTextID.xml diff --git a/code/nel/include/nel/gui/view_text_id.h b/code/nel/include/nel/gui/view_text_id.h index 5dd0808af..3404d992a 100644 --- a/code/nel/include/nel/gui/view_text_id.h +++ b/code/nel/include/nel/gui/view_text_id.h @@ -91,6 +91,7 @@ namespace NLGUI ~CViewTextID(); + std::string getProperty( const std::string &name ) const; virtual bool parse(xmlNodePtr cur, CInterfaceGroup * parentGroup); virtual void checkCoords(); diff --git a/code/nel/src/gui/view_text_id.cpp b/code/nel/src/gui/view_text_id.cpp index e487051a3..e6452b187 100644 --- a/code/nel/src/gui/view_text_id.cpp +++ b/code/nel/src/gui/view_text_id.cpp @@ -46,6 +46,29 @@ namespace NLGUI { } + std::string CViewTextID::getProperty( const std::string &name ) const + { + if( name == "textid" ) + { + if( _DBTextId.getNodePtr() != NULL ) + return _DBTextId.getNodePtr()->getFullName(); + else + return NLMISC::toString( _TextId ); + } + else + if( name == "dynamic_string" ) + { + return NLMISC::toString( _DynamicString ); + } + else + if( name == "format_taged" ) + { + return NLMISC::toString( _IsTextFormatTaged ); + } + else + return CViewText::getProperty( name ); + } + // *************************************************************************** bool CViewTextID::parse(xmlNodePtr cur, CInterfaceGroup * parentGroup) { diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/ViewTextID.xml b/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/ViewTextID.xml new file mode 100644 index 000000000..9a874334b --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/ViewTextID.xml @@ -0,0 +1,29 @@ + +
+ ViewTextID + CViewTextID + ViewText + + false + +
+ + + text_id + string + + + + dynamic_string + bool + true + + + format_taged + bool + false + + + + +