Momentary Button
Component Palette Icon:
Momentary buttons are used to set a value for either a fixed amount of time, or however long the button remains held down, whichever is longer. Once the button is released, or the minimum time expires, the value is reset.
The momentary button uses its Control Value property to affect the underlying data. Typically, this property uses a bidirectional tag binding to an OPC tag. When pressed, it will write its On Value toControl Value. When released, it will either write Off Value to Control Value immediately, or wait until On Time has elapsed (since the pressed event).
The button's Indicator Value, which is typically bound to the same OPC tag as Control Value, is used to draw an "active" indication border around the button. This gives the operator positive feedback that the value has written successfully. It also lets an operator at one terminal know if an operator at a different terminal is using the button currently.
Note that you may want to use the Oneshot Button instead of the Momentary Button if you simply need to send a signal to a PLC, and the PLC is able to reset the value. This lets the PLC reset the value, avoiding the potential for the bit to be left high. This is possible with the Momentary Button if, for example, the power to the client was cut while the button was held down.
Name |
Description |
Property Type |
Scripting |
Category |
Antialias |
Draw with antialias on? Makes text smoother |
boolean |
.antialias |
Appearance |
Background 3D? |
Should this button have a 3d type background, or a flat color one? |
boolean |
.background3D |
Appearance |
Background Color |
|
Color |
.buttonBG |
Appearance |
Border |
The border surrounding this component. |
Border |
.innerBorder |
Common |
Control Value |
Bind this to the tag that you want to control. (Typically, this is bound to the same location as <i>Indicator Value</i>) |
int |
.controlValue |
Data |
Cursor |
The mouse cursor to use when hovering over this component. |
int |
.cursorCode |
Common |
Data Quality |
The data quality code for any tag bindings on this component. |
int |
.dataQuality |
Data |
Disabled Image Path |
The relative path of the image to be displayed when this component is not enabled. |
String |
.disabledPath |
Appearance |
Enabled |
If disabled, a component cannot be used. |
boolean |
.componentEnabled |
Common |
Fill Area? |
Controls whether or not this button's internal area is filled |
boolean |
.contentAreaFilled |
Appearance |
Font |
Font of text of this component |
Font |
.font |
Appearance |
Foreground Color |
The foreground color of the component. |
Color |
.foreground |
Appearance |
Horizontal Alignment |
The horizontal alignment of the button's contents (text and/or image) |
int |
.horizontalAlignment |
Layout |
Horizontal Text Position |
The horizontal position of the button's text relative to its image |
int |
.horizontalTextPosition |
Layout |
Icon-Text Spacing |
The space (in pixels) between the icon (if any) and the text (if any) |
int |
.iconTextGap |
Appearance |
Image Path |
The relative path of the image. |
String |
.path |
Appearance |
Indicator Value |
Bind this to the tag that indicates the current state of the control value. (Typically, this is bound to the same location as <i>Control Value</i>) |
int |
.indicatorValue |
Data |
Indicator Width |
The width of the indication border that shows whether or not the indicator value is currently set. |
int |
.indicatorWidth |
Appearance |
Max Hold Time |
The maximum amount of time to keep the control value at the "On Value" |
int |
.maxOnTime |
Behavior |
Min Hold Time |
The minimum amount of time to keep the control value at the "On Value" |
int |
.onTime |
Behavior |
Mnemonic |
A single letter that will activate the button using 'ALT-<i>mnemonic</i>'. |
String |
.mnemonicChar |
Behavior |
Mouseover Text |
The text that is displayed in the tooltip which pops up on mouseover of this component. |
String |
.toolTipText |
Common |
Name |
The name of this component. |
String |
.name |
Common |
Off Color |
The color of the indicator border when the indicator value is off |
Color |
.offColor |
Appearance |
Off Value |
The value that will be written to the Control Value on mouse-up |
int |
.offValue |
Behavior |
On Color |
The color of the indicator border when the indicator value is on. |
Color |
.onColor |
Appearance |
On Value |
The value that will be written to the Control Value on mouse-down. |
int |
.onValue |
Behavior |
Rollover? |
If true, the button may indicate that the mouse is hovering over it. |
boolean |
.rolloverEnabled |
Appearance |
Styles |
Contains the component's styles |
Dataset |
.styles |
Appearance |
Text |
Text of this component |
String |
.text |
Appearance |
Vertical Alignment |
The vertical alignment of the button's contents (text and/or image) |
int |
.verticalAlignment |
Layout |
Vertical Text Position |
The vertical position of the button's text relative to its image |
int |
.verticalTextPosition |
Layout |
Visible |
If disabled, the component will be hidden. |
boolean |
.visible |
Common |
This component does not have scripting functions associated with it.
This component does not have extension functions associated with it.
action
actionPerformed
This event is fired when the 'action' of the component occurs. This means when somebody selects the radio button.
.source |
The component that fired this event |
focus
focusGained
This event occurs when a component that can receive input, such as a text box, receives the input focus. This usually occurs when a user clicks on the component or tabs over to it.
.source |
The component that fired this event. |
.oppositeComponent |
The other component involved in this focus change. That is, the component that lost focus in order for this one to gain it, or vise versa. |
focusLost
This event occurs when a component that had the input focus lost it to another component.
.source |
The component that fired this event |
.oppositeComponent |
The other component involved in this focus change. That is, the component that lost focus in order for this one to gain it, or vise versa. |
key
keyPressed
An integer that indicates whether the state was changed to "Selected" (on) or "Deselected" (off). Compare this to the event object's constants to determine what the new state is.
.source |
The component that fired this event. |
.keyCode |
The key code for this event. Used with the keyPressed and keyReleased events. See below for the key code constants. |
.keyChar |
The character that was typed. Used with the keyTyped event. |
.keyLocation |
Returns the location of the key that originated this key event. Some keys occur more than once on a keyboard, e.g. the left and right shift keys. Additionally, some keys occur on the numeric keypad. This provides a way of distinguishing such keys. See the KEY_LOCATION constants, the keyTyped event always has a location of KEY_LOCATION_UNKNOWN. |
.altDown |
True (1) if the Alt key was held down during this event, false (0) otherwise. |
.controlDown |
True (1) if the Control key was held down during this event, false (0) otherwise. |
.shiftDown |
True (1) if the Shift key was held down during this event, false (0) otherwise. |
keyReleased
Fires when a key is released and the source component has the input focus. Works for all characters, including non-printable ones, such as SHIFT and F3.
.source |
The component that fired this event. |
.keyCode |
The key code for this event. Used with the keyPressed and keyReleased events. See below for the key code constants. |
.keyChar |
The character that was typed. Used with the keyTyped event. |
.keyLocation |
Returns the location of the key that originated this key event. Some keys occur more than once on a keyboard, e.g. the left and right shift keys. Additionally, some keys occur on the numeric keypad. This provides a way of distinguishing such keys. See the KEY_LOCATION constants in the documentation, the keyTyped event always has a location of KEY_LOCATION_UNKNOWN. |
.altDown |
True (1) if the Alt key was held down during this event, false (0) otherwise. |
.controlDown |
True (1) if the Control key was held down during this event, false (0) otherwise. |
.shiftDown |
True (1) if the Shift key was held down during this event, false (0) otherwise. |
keyTyped
Fires when a key is pressed and then released when source component has the input focus. Only works for characters that can be printed on the screen.
.source |
The component that fired this event. |
.keyCode |
The key code for this event. Used with the keyPressed and keyReleased events. See below for the key code constants. |
.keyChar |
The character that was typed. Used with the keyTyped event. |
.keyLocation |
Returns the location of the key that originated this key event. Some keys occur more than once on a keyboard, e.g. the left and right shift keys. Additionally, some keys occur on the numeric keypad. This provides a way of distinguishing such keys. See the KEY_LOCATION constants in the documentation, the keyTyped event always has a location of KEY_LOCATION_UNKNOWN. |
.altDown |
True (1) if the Alt key was held down during this event, false (0) otherwise. |
.controlDown |
True (1) if the Control key was held down during this event, false (0) otherwise. |
.shiftDown |
True (1) if the Shift key was held down during this event, false (0) otherwise. |
mouse
mouseClicked
This event signifies a mouse click on the source component. A mouse click the combination of a mouse press and a mouse release, both of which must have occurred over the source component. Note that this event fires after the pressed and released events have fired.
.source |
The component that fired this event. |
.button |
The code for the button that caused this event to fire. |
.clickCount |
The number of mouse clicks associated with this event. |
.x |
The x-coordinate (with respect to the source component) of this mouse event. |
.y |
The y-coordinate (with respect to the source component) of this mouse event. |
.popupTrigger |
Returns True (1) if this mouse event is a popup trigger. What constitutes a popup trigger is operating system dependent, which is why this abstraction exists. |
.altDown |
True (1) if the Alt key was held down during this event, false (0) otherwise. |
.controlDown |
True (1) if the Control key was held down during this event, false (0) otherwise. |
.shiftDown |
True (1) if the Shift key was held down during this event, false (0) otherwise. |
mouseEntered
This event fires when the mouse enters the space over the source component.
.source |
The component that fired this event. |
.button |
The code for the button that caused this event to fire. |
.clickCount |
The number of mouse clicks associated with this event. |
.x |
The x-coordinate (with respect to the source component) of this mouse event. |
.y |
The y-coordinate (with respect to the source component) of this mouse event. |
.popupTrigger |
Returns True (1) if this mouse event is a popup trigger. What constitutes a popup trigger is operating system dependent, which is why this abstraction exists. |
.altDown |
True (1) if the Alt key was held down during this event, false (0) otherwise. |
.controlDown |
True (1) if the Control key was held down during this event, false (0) otherwise. |
.shiftDown |
True (1) if the Shift key was held down during this event, false (0) otherwise. |
mouseExited
This event fires when the mouse leaves the space over the source component.
.source |
The component that fired this event. |
.button |
The code for the button that caused this event to fire. |
.clickCount |
The number of mouse clicks associated with this event. |
.x |
The x-coordinate (with respect to the source component) of this mouse event. |
.y |
The y-coordinate (with respect to the source component) of this mouse event. |
.popupTrigger |
Returns True (1) if this mouse event is a popup trigger. What constitutes a popup trigger is operating system dependent, which is why this abstraction exists. |
.altDown |
True (1) if the Alt key was held down during this event, false (0) otherwise. |
.controlDown |
True (1) if the Control key was held down during this event, false (0) otherwise. |
.shiftDown |
True (1) if the Shift key was held down during this event, false (0) otherwise. |
mousePressed
This event fires when a mouse button is pressed down on the source component.
.source |
The component that fired this event. |
.button |
The code for the button that caused this event to fire. |
.clickCount |
The number of mouse clicks associated with this event. |
.x |
The x-coordinate (with respect to the source component) of this mouse event. |
.y |
The y-coordinate (with respect to the source component) of this mouse event. |
.popupTrigger |
Returns True (1) if this mouse event is a popup trigger. What constitutes a popup trigger is operating system dependent, which is why this abstraction exists. |
.altDown |
True (1) if the Alt key was held down during this event, false (0) otherwise. |
.controlDown |
True (1) if the Control key was held down during this event, false (0) otherwise. |
.shiftDown |
True (1) if the Shift key was held down during this event, false (0) otherwise. |
mouseReleased
This event fires when a mouse button is released, if that mouse button's press happened over this component.
.source |
The component that fired this event. |
.button |
The code for the button that caused this event to fire. |
.clickCount |
The number of mouse clicks associated with this event. |
.x |
The x-coordinate (with respect to the source component) of this mouse event. |
.y |
The y-coordinate (with respect to the source component) of this mouse event. |
.popupTrigger |
Returns True (1) if this mouse event is a popup trigger. What constitutes a popup trigger is operating system dependent, which is why this abstraction exists. |
.altDown |
True (1) if the Alt key was held down during this event, false (0) otherwise. |
.controlDown |
True (1) if the Control key was held down during this event, false (0) otherwise. |
.shiftDown |
True (1) if the Shift key was held down during this event, false (0) otherwise. |
mouseMotion
mouseDragged
Fires when the mouse moves over a component after a button has been pushed.
.source |
The component that fired this event. |
.button |
The code for the button that caused this event to fire. |
.clickCount |
The number of mouse clicks associated with this event. |
.x |
The x-coordinate (with respect to the source component) of this mouse event. |
.y |
The y-coordinate (with respect to the source component) of this mouse event. |
.popupTrigger |
Returns True (1) if this mouse event is a popup trigger. What constitutes a popup trigger is operating system dependent, which is why this abstraction exists. |
.altDown |
True (1) if the Alt key was held down during this event, false (0) otherwise. |
.controlDown |
True (1) if the Control key was held down during this event, false (0) otherwise. |
.shiftDown |
True (1) if the Shift key was held down during this event, false (0) otherwise. |
mouseMoved
Fires when the mouse moves over a component, but no buttons are pushed.
.source |
The component that fired this event. |
.button |
The code for the button that caused this event to fire. |
.clickCount |
The number of mouse clicks associated with this event. |
.x |
The x-coordinate (with respect to the source component) of this mouse event. |
.y |
The y-coordinate (with respect to the source component) of this mouse event. |
.popupTrigger |
Returns True (1) if this mouse event is a popup trigger. What constitutes a popup trigger is operating system dependent, which is why this abstraction exists. |
.altDown |
True (1) if the Alt key was held down during this event, false (0) otherwise. |
.controlDown |
True (1) if the Control key was held down during this event, false (0) otherwise. |
.shiftDown |
True (1) if the Shift key was held down during this event, false (0) otherwise. |
propertyChange
propertyChange
Fires whenever a bindable property of the source component changes. This works for standard and custom (dynamic) properties.
.source |
The component that fired this event. |
.newValue |
The new value that this property changed to. |
.oldValue |
The value that this property was before it changed. |
.propertyName |
The name of the property that changed. NOTE: remember to always filter out these events for the property that you are looking for! Components often have many properties that change. |