CHANGED: #1471 Implemented property querying for for CDBViewNumber.

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

View file

@ -39,6 +39,7 @@ namespace NLGUI
/// Constructor /// Constructor
CDBViewNumber(const TCtorParam &param); CDBViewNumber(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 checkCoords(); virtual void checkCoords();
virtual void draw (); virtual void draw ();

View file

@ -41,6 +41,48 @@ namespace NLGUI
_Modulo = 0; _Modulo = 0;
} }
std::string CDBViewNumber::getProperty( const std::string &name ) const
{
if( name == "value" )
{
if( _Number.getNodePtr() != NULL )
return _Number.getNodePtr()->getFullName();
else
return "";
}
else
if( name == "positive" )
{
return toString( _Positive );
}
else
if( name == "format" )
{
return toString( _Format );
}
else
if( name == "divisor" )
{
return toString( _Divisor );
}
else
if( name == "modulo" )
{
return toString( _Modulo );
}
else
if( name == "suffix" )
{
return _Suffix.toString();
}
else
if( name == "prefix" )
{
return _Prefix.toString();
}
else
return CViewText::getProperty( name );
}
// *************************************************************************** // ***************************************************************************
bool CDBViewNumber::parse (xmlNodePtr cur, CInterfaceGroup * parentGroup) bool CDBViewNumber::parse (xmlNodePtr cur, CInterfaceGroup * parentGroup)

View file

@ -0,0 +1,48 @@
<widget>
<header>
<name>DBViewNumber</name>
<guiname>CDBViewNumber</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>positive</name>
<type>bool</type>
<default>false</default>
</property>
<property>
<name>format</name>
<type>bool</type>
<default>false</default>
</property>
<property>
<name>divisor</name>
<type>int</type>
<default>1</default>
</property>
<property>
<name>modulo</name>
<type>int</type>
<default>0</default>
</property>
<property>
<name>suffix</name>
<type>string</type>
<default></default>
</property>
<property>
<name>prefix</name>
<type>string</type>
<default></default>
</property>
</properties>
</widget>