From 7efbd2ff7e3780b987499a7c91c4e44bbf60cf17 Mon Sep 17 00:00:00 2001 From: dfighter1985 Date: Tue, 31 Jul 2012 05:19:24 +0200 Subject: [PATCH] CHANGED: #1471 Implemented property querying for CGroupFrame. --HG-- branch : gsoc2012-gui-editor --- code/nel/include/nel/gui/group_frame.h | 4 +++ code/nel/src/gui/group_frame.cpp | 23 ++++++++++++++++ .../plugins/gui_editor/widgets/GroupFrame.xml | 27 +++++++++++++++++++ 3 files changed, 54 insertions(+) create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/GroupFrame.xml diff --git a/code/nel/include/nel/gui/group_frame.h b/code/nel/include/nel/gui/group_frame.h index 220acb5cd..5a979741a 100644 --- a/code/nel/include/nel/gui/group_frame.h +++ b/code/nel/include/nel/gui/group_frame.h @@ -40,6 +40,8 @@ namespace NLGUI /// Constructor CGroupFrame(const TCtorParam ¶m); + std::string getProperty( const std::string &name ) const; + virtual bool parse (xmlNodePtr cur, CInterfaceGroup *parentGroup); virtual void draw (); @@ -65,6 +67,8 @@ namespace NLGUI uint8 _DispType; + std::string _Options; + // Fields Defined in the XML => must not herit them from extends="" bool _DisplayFrameDefined : 1; bool _ColorDefined : 1; diff --git a/code/nel/src/gui/group_frame.cpp b/code/nel/src/gui/group_frame.cpp index 9f8e7ab1d..8a8b64093 100644 --- a/code/nel/src/gui/group_frame.cpp +++ b/code/nel/src/gui/group_frame.cpp @@ -44,6 +44,26 @@ namespace NLGUI _DispTypeDefined= false; } + std::string CGroupFrame::getProperty( const std::string &name ) const + { + if( name == "display" ) + { + return toString( _DisplayFrame ); + } + else + if( name == "color" ) + { + return toString( _Color ); + } + else + if( name == "options" ) + { + return _Options; + } + else + return CInterfaceGroup::getProperty( name ); + } + // *************************************************************************** bool CGroupFrame::parse (xmlNodePtr cur, CInterfaceGroup *parentGroup) { @@ -78,7 +98,10 @@ namespace NLGUI CInterfaceOptions *pIO = NULL; if (ptr) + { + _Options = std::string( ptr ); pIO = CWidgetManager::getInstance()->getOptions(ptr); + } // The first type in display type struct is the default display type if (_DispTypes.size() == 0) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/GroupFrame.xml b/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/GroupFrame.xml new file mode 100644 index 000000000..1f8e8365d --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/GroupFrame.xml @@ -0,0 +1,27 @@ + +
+ GroupFrame + CGroupFrame + InterfaceGroup + + true + +
+ + + display + bool + true + + + color + string + 255 255 255 255 + + + options + string + + + +