CHANGED: #1471 Implemented property querying for CGroupList.

--HG--
branch : gsoc2012-gui-editor
hg/feature/sse2
dfighter1985 12 years ago
parent 70d5759713
commit 02a6417039

@ -108,6 +108,8 @@ namespace NLGUI
return &_Templ;
}
std::string getProperty( const std::string &name ) const;
/**
* parse the element and initalize it
* \paral cur : pointer to the node describing this element
@ -194,6 +196,8 @@ namespace NLGUI
protected:
std::string _HardText;
uint32 _TextId;
//max number of elements
sint32 _MaxElements;

@ -50,6 +50,7 @@ namespace NLGUI
_OverColor = CRGBA(255, 255, 255, 32);
_OverElt = -1;
_IsGroupList = true;
_TextId = 0;
}
// ----------------------------------------------------------------------------
@ -190,6 +191,86 @@ namespace NLGUI
}
}
std::string CGroupList::getProperty( const std::string &name ) const
{
if( name == "maxelements" )
{
return toString( _MaxElements );
}
else
if( name == "addelt" )
{
switch( _AddElt )
{
case Top:
return "T";
break;
case Left:
return "L";
break;
case Right:
return "R";
break;
}
return "B";
}
else
if( name == "align" )
{
switch( _Align )
{
case Top:
return "T";
break;
case Left:
return "L";
break;
case Right:
return "R";
break;
}
return "B";
}
else
if( name == "space" )
{
return toString( _Space );
}
else
if( name == "over" )
{
return toString( _Over );
}
else
if( name == "dynamic_display_size" )
{
return toString( _DynamicDisplaySize );
}
else
if( name == "col_over" )
{
return toString( _OverColor );
}
else
if( name == "hardtext" )
{
return _HardText;
}
else
if( name == "textid" )
{
return toString( _TextId );
}
else
return CInterfaceGroup::getProperty( name );
}
// ----------------------------------------------------------------------------
bool CGroupList::parse (xmlNodePtr cur, CInterfaceGroup * parentGroup)
{

@ -0,0 +1,61 @@
<widget>
<header>
<name>GroupList</name>
<guiname>CGroupList</guiname>
<ancestor>InterfaceGroup</ancestor>
<description></description>
<abstract>false</abstract>
<icon></icon>
</header>
<properties>
<property>
<name>maxelements</name>
<type>int</type>
<default>1024</default>
</property>
<property>
<name>addelt</name>
<type>string</type>
<default>B</default>
</property>
<property>
<name>align</name>
<type>string</type>
<default>L</default>
</property>
<property>
<name>space</name>
<type>int</type>
<default>0</default>
</property>
<property>
<name>over</name>
<type>bool</type>
<default>false</default>
</property>
<property>
<name>dynamic_display_size</name>
<type>bool</type>
<default>false</default>
</property>
<property>
<name>col_over</name>
<type>string</type>
<default>255 255 255 32</default>
</property>
<property>
<name>hardtext</name>
<type>string</type>
<default></default>
</property>
<property>
<name>textid</name>
<type>int</type>
<default>0</default>
</property>
</properties>
</widget>
Loading…
Cancel
Save