From d99ce0a5e9d844735f143961b3368962a9d0ad12 Mon Sep 17 00:00:00 2001 From: dfighter1985 Date: Thu, 2 Aug 2012 19:46:00 +0200 Subject: [PATCH] CHANGED: #1471 Implemented property querying for for CViewTextIDFormated. --HG-- branch : gsoc2012-gui-editor --- .../include/nel/gui/view_text_id_formated.h | 2 ++ code/nel/src/gui/view_text_id_formated.cpp | 10 ++++++++++ .../gui_editor/widgets/ViewTextIDFormated.xml | 19 +++++++++++++++++++ 3 files changed, 31 insertions(+) create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/ViewTextIDFormated.xml diff --git a/code/nel/include/nel/gui/view_text_id_formated.h b/code/nel/include/nel/gui/view_text_id_formated.h index 11fa19aa3..89fa54e54 100644 --- a/code/nel/include/nel/gui/view_text_id_formated.h +++ b/code/nel/include/nel/gui/view_text_id_formated.h @@ -38,6 +38,8 @@ namespace NLGUI public: CViewTextIDFormated(const TCtorParam ¶m) : CViewTextID(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_id_formated.cpp b/code/nel/src/gui/view_text_id_formated.cpp index 991db0344..7d36f7649 100644 --- a/code/nel/src/gui/view_text_id_formated.cpp +++ b/code/nel/src/gui/view_text_id_formated.cpp @@ -26,6 +26,16 @@ NLMISC_REGISTER_OBJECT(CViewBase, CViewTextIDFormated, std::string, "text_id_for namespace NLGUI { + std::string CViewTextIDFormated::getProperty( const std::string &name ) const + { + if( name == "format" ) + { + return getFormatString().toString(); + } + else + return CViewTextID::getProperty( name ); + } + // ********************************************************************************* bool CViewTextIDFormated::parse(xmlNodePtr cur,CInterfaceGroup * parentGroup) { diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/ViewTextIDFormated.xml b/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/ViewTextIDFormated.xml new file mode 100644 index 000000000..a8b5cfe05 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/ViewTextIDFormated.xml @@ -0,0 +1,19 @@ + +
+ ViewTextIDFormated + CViewTextIDFormated + ViewTextID + + false + +
+ + + format + string + + + + + +