CHANGED: #1471 Implemented property querying for CViewBitmap.

This commit is contained in:
dfighter1985 2012-08-02 07:20:38 +02:00
parent efa4a4d14e
commit 55c8a44ed4
3 changed files with 152 additions and 0 deletions

View file

@ -58,6 +58,8 @@ namespace NLGUI
_TxtHeight = -1; _TxtHeight = -1;
} }
std::string getProperty( const std::string &name ) const;
/** /**
* parse an xml node and initialize the base view mambers. Must call CViewBase::parse * parse an xml node and initialize the base view mambers. Must call CViewBase::parse
* \param cur : pointer to the xml node to be parsed * \param cur : pointer to the xml node to be parsed

View file

@ -33,6 +33,83 @@ REGISTER_UI_CLASS(CViewBitmap)
namespace NLGUI namespace NLGUI
{ {
std::string CViewBitmap::getProperty( const std::string &name ) const
{
if( name == "color" )
{
return toString( _Color );
}
else
if( name == "txtoffsetx" )
{
return toString( _TxtOffsetX );
}
else
if( name == "txtoffsety" )
{
return toString( _TxtOffsetY );
}
else
if( name == "txtwidth" )
{
return toString( _TxtWidth );
}
else
if( name == "txtheight" )
{
return toString( _TxtHeight );
}
else
if( name == "texture" )
{
return getTexture();
}
else
if( name == "scale" )
{
return toString( _Scale );
}
else
if( name == "rot" )
{
return toString( _Rot );
}
else
if( name == "flip" )
{
return toString( _Flip );
}
else
if( name == "tile" )
{
return toString( _Tile );
}
else
if( name == "align" )
{
std::string align;
if( ( _Align & 1 ) != 0 )
align += "R";
else
align += "L";
if( ( _Align & 2 ) != 0 )
align += "T";
else
align += "B";
return align;
}
else
if( name == "inherit_gc_alpha" )
{
return toString( _InheritGCAlpha );
}
else
return CViewBase::getProperty( name );
}
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
bool CViewBitmap::parse(xmlNodePtr cur, CInterfaceGroup * parentGroup) bool CViewBitmap::parse(xmlNodePtr cur, CInterfaceGroup * parentGroup)

View file

@ -0,0 +1,73 @@
<widget>
<header>
<name>ViewBitmap</name>
<guiname>CViewBitmap</guiname>
<ancestor>CtrlBase</ancestor>
<description></description>
<abstract>false</abstract>
<icon></icon>
</header>
<properties>
<property>
<name>color</name>
<type>string</type>
<default>255 255 255 255</default>
</property>
<property>
<name>txtoffsetx</name>
<type>int</type>
<default>0</default>
</property>
<property>
<name>txtoffsety</name>
<type>int</type>
<default>0</default>
</property>
<property>
<name>txtwidth</name>
<type>int</type>
<default>-1</default>
</property>
<property>
<name>txtheight</name>
<type>int</type>
<default>-1</default>
</property>
<property>
<name>texture</name>
<type>string</type>
<default></default>
</property>
<property>
<name>scale</name>
<type>bool</type>
<default>false</default>
</property>
<property>
<name>rot</name>
<type>int</type>
<default>0</default>
</property>
<property>
<name>flip</name>
<type>bool</type>
<default>false</default>
</property>
<property>
<name>tile</name>
<type>bool</type>
<default>false</default>
</property>
<property>
<name>align</name>
<type>string</type>
<default></default>
</property>
<property>
<name>inherit_gc_alpha</name>
<type>bool</type>
<default>false</default>
</property>
</properties>
</widget>