Difference between revisions of "Button (MenuMate)"

Jump to navigation Jump to search
425 bytes added ,  11:30, 30 November 2008
imported>Speedo
imported>Speedo
Line 49: Line 49:


==counterbutton==
==counterbutton==
A button which modifies a variable by a certain amount when clicked.  Uses text and may use a script as described for [[Button_(MenuMate)#button|button]].  As with togglebutton, you may include '''[STATE]''' in the format string - it will be replaced with the value of the target variable.
A button which modifies a variable by a certain amount when clicked.  Uses text and may use a script as described for [[Button_(MenuMate)#button|button]].  As with togglebutton, you may include '''[STATE]''' in the format string - it will be replaced with the current amount by which the button modifies its target variable.


===Makeup===
===Makeup===
The counterbutton takes additional information as attributes of its main element:
The counterbutton takes additional information as attributes of its main element:
*'''targetvar''' - The name of the variable to be modified by the button.
*'''targetvar''' - The name of the variable to be modified by the button.
*'''amountvar''' - The name of the variable with the amount by which the target variable will be modified on each click.
*'''amount''' - The amount by which the target variable will be modified on each click.
*'''invertvar''' - The name of a variable used to invert this button.  When the value of this variable is non-zero, the button modifies the target variable by ''amount * -1''.  Optional.
*'''stateformat''' - Format string used when replacing '''[STATE]''' as described above.  This '''must''' be a "%f" format specifier ("%.2f", "%5.0f", etc).  Optional, defaults to "%.0f".  
*'''minvar''' - The name of a variable holding a minimum allowed value for the target variable.  Optional.
*'''minvar''' - The name of a variable holding a minimum allowed value for the target variable.  Optional.
*'''maxvar''' - The name of a varaible holding a maximum allowed value for the target variable.  Optional.
*'''maxvar''' - The name of a varaible holding a maximum allowed value for the target variable.  Optional.
Line 61: Line 63:


<pre>
<pre>
<counterbutton targetvar="myVariable" amount="10" minvar="minimumValue" maxvar="maximumValue">
<counterbutton targetvar="myVariable" amount="10" invertvar="invertVariable" stateformat="%5.2f" minvar="minimumValue" maxvar="maximumValue">
   <text format="Click to increase myVariable by 10"/>
   <text format="Click to increase myVariable by 10"/>
</counterbutton
</counterbutton
Anonymous user

Navigation menu