CHANGED: #1471 Implemented property querying for CDBViewDigit.

This commit is contained in:
dfighter1985 2012-08-02 06:25:41 +02:00
parent 9fa9ebbeb9
commit 23085a00b7
3 changed files with 62 additions and 0 deletions

View file

@ -38,6 +38,7 @@ namespace NLGUI
/// Constructor /// Constructor
CDBViewDigit(const TCtorParam &param); CDBViewDigit(const TCtorParam &param);
std::string getProperty( const std::string &name ) const;
virtual bool parse (xmlNodePtr cur, CInterfaceGroup * parentGroup); virtual bool parse (xmlNodePtr cur, CInterfaceGroup * parentGroup);
virtual void draw (); virtual void draw ();
virtual void updateCoords(); virtual void updateCoords();

View file

@ -38,6 +38,35 @@ namespace NLGUI
} }
std::string CDBViewDigit::getProperty( const std::string &name ) const
{
if( name == "value" )
{
if( _Number.getNodePtr() != NULL )
return _Number.getNodePtr()->getFullName();
else
return "";
}
else
if( name == "numdigit" )
{
return toString( _NumDigit );
}
else
if( name == "wspace" )
{
return toString( _WSpace );
}
else
if( name == "color" )
{
return toString( _Color );
}
else
return CViewBase::getProperty( name );
}
// *************************************************************************** // ***************************************************************************
bool CDBViewDigit::parse (xmlNodePtr cur, CInterfaceGroup * parentGroup) bool CDBViewDigit::parse (xmlNodePtr cur, CInterfaceGroup * parentGroup)
{ {

View file

@ -0,0 +1,32 @@
<widget>
<header>
<name>DBViewDigit</name>
<guiname>CDBViewDigit</guiname>
<ancestor>CtrlBase</ancestor>
<description></description>
<abstract>false</abstract>
<icon></icon>
</header>
<properties>
<property>
<name>value</name>
<type>string</type>
<default></default>
</property>
<property>
<name>numdigit</name>
<type>int</type>
<default>2</default>
</property>
<property>
<name>wspace</name>
<type>int</type>
<default>-1</default>
</property>
<property>
<name>color</name>
<type>string</type>
<default>255 255 255 255</default>
</property>
</properties>
</widget>