CHANGED: #1471 Implemented property querying for CCtrlButton.

--HG--
branch : gsoc2012-gui-editor
hg/feature/sse2
dfighter1985 12 years ago
parent 9694f1a9ab
commit 0afe418b1c

@ -30,7 +30,41 @@ namespace NLGUI
{
std::string CCtrlButton::getProperty( const std::string &name ) const
{
return CCtrlBaseButton::getProperty( name );
if( name == "tx_normal" )
{
return CViewRenderer::getInstance()->getTextureNameFromId( _TextureIdNormal );
}
else
if( name == "tx_pushed" )
{
return CViewRenderer::getInstance()->getTextureNameFromId( _TextureIdPushed );
}
else
if( name == "tx_over" )
{
return CViewRenderer::getInstance()->getTextureNameFromId( _TextureIdOver );
}
else
if( name == "scale" )
{
return toString( _Scale );
}
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
return CCtrlBaseButton::getProperty( name );
}
// ----------------------------------------------------------------------------

@ -0,0 +1,57 @@
<widget>
<header>
<name>CtrlBase</name>
<guiname>CCtrlBase</guiname>
<ancestor>InterfaceElement</ancestor>
<description></description>
<abstract>true</abstract>
<icon></icon>
</header>
<properties>
<property>
<name>tooltip</name>
<type>string</type>
<default></default>
</property>
<property>
<name>tooltip_i18n</name>
<type>string</type>
<default></default>
</property>
<property>
<name>on_tooltip</name>
<type>string</type>
<default></default>
</property>
<property>
<name>on_tooltip_params</name>
<type>string</type>
<default></default>
</property>
<property>
<name>tooltip_parent</name>
<type>string</type>
<default></default>
</property>
<property>
<name>tooltip_special_parent</name>
<type>string</type>
<default></default>
</property>
<property>
<name>tooltip_posref</name>
<type>string</type>
<default>auto</default>
</property>
<property>
<name>tooltip_posref_alt</name>
<type>string</type>
<default>auto</default>
</property>
<property>
<name>instant_help</name>
<type>bool</type>
<default></default>
</property>
</properties>
</widget>

@ -0,0 +1,149 @@
<widget>
<header>
<name>CtrlBaseButton</name>
<guiname>CCtrlBaseButton</guiname>
<ancestor>CtrlBase</ancestor>
<description></description>
<abstract>true</abstract>
<icon></icon>
</header>
<properties>
<property>
<name>button_type</name>
<type>string</type>
<default>toggle_button</default>
</property>
<property>
<name>pushed</name>
<type>bool</type>
<default>false</default>
</property>
<property>
<name>over_when_pushed</name>
<type>bool</type>
<default>true</default>
</property>
<property>
<name>clicked_when_pushed</name>
<type>bool</type>
<default>false</default>
</property>
<property>
<name>color</name>
<type>string</type>
<default>255 255 255 255</default>
</property>
<property>
<name>col_pushed</name>
<type>string</type>
<default>255 255 255 255</default>
</property>
<property>
<name>col_over</name>
<type>string</type>
<default>255 255 255 255</default>
</property>
<property>
<name>global_color_normal</name>
<type>bool</type>
<default>true</default>
</property>
<property>
<name>global_color_pushed</name>
<type>bool</type>
<default>true</default>
</property>
<property>
<name>global_color_over</name>
<type>bool</type>
<default>true</default>
</property>
<property>
<name>onover</name>
<type>string</type>
<default></default>
</property>
<property>
<name>params_over</name>
<type>string</type>
<default></default>
</property>
<property>
<name>onclick_l</name>
<type>string</type>
<default></default>
</property>
<property>
<name>params_l</name>
<type>string</type>
<default></default>
</property>
<property>
<name>ondblclick_l</name>
<type>string</type>
<default></default>
</property>
<property>
<name>params_dblclick_l</name>
<type>string</type>
<default></default>
</property>
<property>
<name>onclick_r</name>
<type>string</type>
<default></default>
</property>
<property>
<name>params_r</name>
<type>string</type>
<default></default>
</property>
<property>
<name>onlongclick_l</name>
<type>string</type>
<default></default>
</property>
<property>
<name>params_longclick_l</name>
<type>string</type>
<default></default>
</property>
<property>
<name>onclock_tick</name>
<type>string</type>
<default></default>
</property>
<property>
<name>params_clock_tick</name>
<type>string</type>
<default></default>
</property>
<property>
<name>menu_l</name>
<type>string</type>
<default></default>
</property>
<property>
<name>menu_r</name>
<type>string</type>
<default></default>
</property>
<property>
<name>menu_b</name>
<type>string</type>
<default></default>
</property>
<property>
<name>frozen</name>
<type>bool</type>
<default>false</default>
</property>
<property>
<name>frozen_half_tone</name>
<type>bool</type>
<default></default>
</property>
</properties>
</widget>

@ -0,0 +1,37 @@
<widget>
<header>
<name>CtrlButton</name>
<guiname>CCtrlButton</guiname>
<ancestor>CtrlBaseButton</ancestor>
<description></description>
<abstract>false</abstract>
<icon></icon>
</header>
<properties>
<property>
<name>tx_normal</name>
<type>string</type>
<default></default>
</property>
<property>
<name>tx_pushed</name>
<type>string</type>
<default></default>
</property>
<property>
<name>tx_over</name>
<type>string</type>
<default></default>
</property>
<property>
<name>scale</name>
<type>bool</type>
<default>false</default>
</property>
<property>
<name>align</name>
<type>string</type>
<default></default>
</property>
</properties>
</widget>
Loading…
Cancel
Save