From 66f722e9d8bd575460d32697a8d789c35b33a8ea Mon Sep 17 00:00:00 2001 From: dfighter1985 Date: Thu, 2 Aug 2012 19:33:03 +0200 Subject: [PATCH] CHANGED: #1471 Implemented property querying for for CViewTextFormated. --- code/nel/include/nel/gui/view_text_formated.h | 1 + code/nel/src/gui/view_text_formated.cpp | 10 ++++++++++ .../gui_editor/widgets/ViewTextFormated.xml | 19 +++++++++++++++++++ 3 files changed, 30 insertions(+) create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/ViewTextFormated.xml diff --git a/code/nel/include/nel/gui/view_text_formated.h b/code/nel/include/nel/gui/view_text_formated.h index 884923d51..0e5d0d616 100644 --- a/code/nel/include/nel/gui/view_text_formated.h +++ b/code/nel/include/nel/gui/view_text_formated.h @@ -46,6 +46,7 @@ namespace NLGUI CViewTextFormated (const TCtorParam ¶m) : CViewText(param) {} + std::string getProperty( const std::string &name ) const; virtual bool parse(xmlNodePtr cur, CInterfaceGroup * parentGroup); virtual void checkCoords(); const ucstring &getFormatString() const { return _FormatString; } diff --git a/code/nel/src/gui/view_text_formated.cpp b/code/nel/src/gui/view_text_formated.cpp index 2de8f440f..6fdc3e5d1 100644 --- a/code/nel/src/gui/view_text_formated.cpp +++ b/code/nel/src/gui/view_text_formated.cpp @@ -25,6 +25,16 @@ namespace NLGUI CViewTextFormated::IViewTextFormatter *CViewTextFormated::textFormatter = NULL; + std::string CViewTextFormated::getProperty( const std::string &name ) const + { + if( name == "format" ) + { + return getFormatString().toString(); + } + else + return CViewText::getProperty( name ); + } + // **************************************************************************** bool CViewTextFormated::parse(xmlNodePtr cur,CInterfaceGroup * parentGroup) { diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/ViewTextFormated.xml b/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/ViewTextFormated.xml new file mode 100644 index 000000000..f564864a5 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/ViewTextFormated.xml @@ -0,0 +1,19 @@ + +
+ ViewTextFormated + CViewTextFormated + ViewText + + false + +
+ + + format + string + + + + + +