The okTriggerButton appears identical to the okPushbutton but connects to a Trigger In endpoint. The trigger is activated when the button is pushed (rather than when the button is released).
You may wish to denote that a particular button is a trigger by surrounding the label with hyphens. In the example below, the button label is “- Reset -” to make the button appear different from an okPushbutton.
|position||POSITION||Position of the top left corner.|
|size||SIZE||Size in pixels.|
|label||TEXT||Label text, shown inside the button.|
|endpoint||HEX BYTE||Endpoint address for the corresponding Wire In.|
|bit||NUMBER||Bit to which this component addresses (0=LSB, 15=MSB).|
<object class="okTriggerButton"> <label>- Trigger -</label> <position>20,110</position> <size>60,20</size> <endpoint>0x40</endpoint> <bit>0</bit> <tooltip>Reset Counter #2</tooltip> </object>Code language: HTML, XML (xml)
This component supports executing a script function when the button is pressed. Unlike with
okPushbutton, there is no event for releasing this button.
If the button has an associated script function, it may avoid specifying the
bit parameters that are normally required. However it can also use both the function and these parameters, in which case the default button action, of activating the corresponding trigger in when it’s pressed, will be taken after executing the script function unless it explicitly calls
event:PreventDefault() as described in the “Default Behaviour” section of FrontPanel Scripting.
All XML components that support Lua scripting also inherit from the Control class. Please refer to the FrontPanel Scripting documentation for more information on this class.