CHANGED: #1471 Implemented property querying for for CDBViewQuantity.

--HG--
branch : gsoc2012-gui-editor
This commit is contained in:
dfighter1985 2012-08-02 20:42:12 +02:00
parent d67ffd246b
commit 0b3be8e93d
3 changed files with 55 additions and 0 deletions

View file

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

View file

@ -36,6 +36,31 @@ namespace NLGUI
}
std::string CDBViewQuantity::getProperty( const std::string &name ) const
{
if( name == "value" )
{
if( _Number.getNodePtr() != NULL )
return _Number.getNodePtr()->getFullName();
else
return "";
}
else
if( name == "valuemax" )
{
if( _NumberMax.getNodePtr() != NULL )
return _NumberMax.getNodePtr()->getFullName();
else
return "";
}
else
if( name == "emptytext" )
{
return _EmptyText.toString();
}
else
return CViewText::getProperty( name );
}
// ***************************************************************************
bool CDBViewQuantity::parse (xmlNodePtr cur, CInterfaceGroup * parentGroup)

View file

@ -0,0 +1,29 @@
<widget>
<header>
<name>DBViewQuantity</name>
<guiname>CDBViewQuantity</guiname>
<ancestor>ViewText</ancestor>
<description></description>
<abstract>false</abstract>
<icon></icon>
</header>
<properties>
<property>
<name>value</name>
<type>string</type>
<default></default>
</property>
<property>
<name>valuemax</name>
<type>string</type>
<default></default>
</property>
<property>
<name>emptytext</name>
<type>string</type>
<default></default>
</property>
</properties>
</widget>