CHANGED: #1471 Implemented property querying for CGroupTable.

This commit is contained in:
dfighter1985 2012-07-30 22:50:35 +02:00
parent 027c767d7f
commit b4c6213e54
3 changed files with 78 additions and 0 deletions

View file

@ -146,6 +146,8 @@ namespace NLGUI
bool ContinuousUpdate; bool ContinuousUpdate;
std::string getProperties( const std::string &name ) const;
protected: protected:
/// \from CInterfaceElement /// \from CInterfaceElement

View file

@ -1074,6 +1074,39 @@ namespace NLGUI
CInterfaceGroup::draw (); CInterfaceGroup::draw ();
} }
std::string CGroupTable::getProperties( const std::string &name ) const
{
if( name == "border" )
{
return toString( Border );
}
else
if( name == "cellpadding" )
{
return toString( CellPadding );
}
else
if( name == "cellspacing" )
{
return toString( CellSpacing );
}
else
if( name == "bgcolor" )
{
return toString( BgColor );
}
else
if( name == "width" )
{
if( ForceWidthMin != 0 )
return toString( ForceWidthMin );
else
return toString( TableRatio * 100.0f );
}
else
return CInterfaceGroup::getProperty( name );
}
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
bool CGroupTable::parse (xmlNodePtr cur, CInterfaceGroup * parentGroup) bool CGroupTable::parse (xmlNodePtr cur, CInterfaceGroup * parentGroup)
{ {

View file

@ -0,0 +1,43 @@
<widget>
<header>
<name>GroupTable</name>
<guiname>CGroupTable</guiname>
<ancestor>InterfaceGroup</ancestor>
<description></description>
<abstract>false</abstract>
<icon></icon>
</header>
<properties>
<property>
<name>border</name>
<type>int</type>
<default>0</default>
</property>
<property>
<name>cellpadding</name>
<type>int</type>
<default>0</default>
</property>
<property>
<name>cellspacing</name>
<type>int</type>
<default>0</default>
</property>
<property>
<name>bgcolor</name>
<type>string</type>
<default>0 0 0 255</default>
</property>
<property>
<name>width</name>
<type>string</type>
<default>0</default>
</property>
<property>
<name>continuous_update</name>
<type>bool</type>
<default>false</default>
</property>
</properties>
</widget>