From c89b3a26cc0f35518c717068ea6fd0f17494b407 Mon Sep 17 00:00:00 2001 From: dfighter1985 Date: Mon, 30 Jul 2012 05:17:33 +0200 Subject: [PATCH] CHANGED: #1471 Implemented property querying for CCtrlTabButton. --- code/nel/include/nel/gui/group_tab.h | 2 ++ code/nel/src/gui/group_tab.cpp | 8 ++++++ .../gui_editor/widget_properties_parser.cpp | 26 +++++++++---------- .../gui_editor/widgets/CtrlTabButton.xml | 17 ++++++++++++ 4 files changed, 39 insertions(+), 14 deletions(-) create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/CtrlTabButton.xml diff --git a/code/nel/include/nel/gui/group_tab.h b/code/nel/include/nel/gui/group_tab.h index 1836ed797..d59fdd65d 100644 --- a/code/nel/include/nel/gui/group_tab.h +++ b/code/nel/include/nel/gui/group_tab.h @@ -152,6 +152,8 @@ namespace NLGUI CCtrlTabButton(const TCtorParam ¶m); + std::string getProperty( const std::string &name ) const; + virtual bool parse (xmlNodePtr cur, CInterfaceGroup *parentGroup); virtual void setActive(bool state); diff --git a/code/nel/src/gui/group_tab.cpp b/code/nel/src/gui/group_tab.cpp index a286d661f..54199a0cb 100644 --- a/code/nel/src/gui/group_tab.cpp +++ b/code/nel/src/gui/group_tab.cpp @@ -729,6 +729,14 @@ namespace NLGUI _BlinkState = false; } + std::string CCtrlTabButton::getProperty( const std::string &name ) const + { + if( name == "group" ) + return _AssociatedGroup; + else + return CCtrlTextButton::getProperty( name ); + } + // *************************************************************************** bool CCtrlTabButton::parse (xmlNodePtr cur, CInterfaceGroup *parentGroup) { diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widget_properties_parser.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widget_properties_parser.cpp index dc2b016c7..5569c3ecb 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widget_properties_parser.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widget_properties_parser.cpp @@ -243,27 +243,25 @@ namespace GUIEditor std::vector< SPropEntry > &props = info->props; - std::map< std::string, SWidgetInfo >::iterator itr2 = - widgetInfo->find( info->ancestor ); - if( itr2 == widgetInfo->end() ) - return; - SWidgetInfo *info2 = &(itr2->second); + SWidgetInfo *info2 = info; do { + if( info2->ancestor.empty() ) + break; + + std::map< std::string, SWidgetInfo >::iterator itr2 = + widgetInfo->find( info2->ancestor ); + if( itr2 == widgetInfo->end() ) + break; + + info2 = &( itr2->second ); + for( std::vector< SPropEntry >::iterator propItr = info2->props.begin(); propItr != info2->props.end(); ++propItr ) props.push_back( *propItr ); - if( !info2->resolved && !info2->ancestor.empty() ) - { - itr2 = widgetInfo->find( info2->ancestor ); - if( itr2 != widgetInfo->end() ) - info2 = &(itr2->second); - else - info2 = NULL; - } } - while( ( info2 != NULL ) && !info2->resolved && !info2->ancestor.empty() ); + while( !info2->resolved ); info->resolved = true; } diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/CtrlTabButton.xml b/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/CtrlTabButton.xml new file mode 100644 index 000000000..401b30286 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widgets/CtrlTabButton.xml @@ -0,0 +1,17 @@ + +
+ CtrlTabButton + CCtrlTabButton + CtrlTextButton + + false + +
+ + + group + string + + + +