CHANGED: #1471 Implemented property querying for CCtrlTabButton.

This commit is contained in:
dfighter1985 2012-07-30 05:17:33 +02:00
parent ea8ed3fcf5
commit c89b3a26cc
4 changed files with 39 additions and 14 deletions

View file

@ -152,6 +152,8 @@ namespace NLGUI
CCtrlTabButton(const TCtorParam &param);
std::string getProperty( const std::string &name ) const;
virtual bool parse (xmlNodePtr cur, CInterfaceGroup *parentGroup);
virtual void setActive(bool state);

View file

@ -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)
{

View file

@ -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;
}

View file

@ -0,0 +1,17 @@
<widget>
<header>
<name>CtrlTabButton</name>
<guiname>CCtrlTabButton</guiname>
<ancestor>CtrlTextButton</ancestor>
<description></description>
<abstract>false</abstract>
<icon></icon>
</header>
<properties>
<property>
<name>group</name>
<type>string</type>
<default></default>
</property>
</properties>
</widget>