Update cookies preferences
Promotic

onModeChange - event of the PmgObject object

Description:
The event is triggered when the Pmg object mode changes. This may be such change that should cause some Pmg object visual reaction. The following attributes of Pmg object are now being observed:
- visibility
- forbidden control
- focus
- hovering mouse cursor over the Pmg object.
Parameters:
pMe(Object) Reference to the PmgObject object where the event rises.
pEvent(Object) Reference to an object describing detailed information about the specific event.
pEvent.NewValue - (Long) [for reading] New value with Pmg object state. The states of observed attributes are stored as individual bits. The value with set bit is stored in hexadecimal (JavaScript).
0x0001 (bit 0) - The bit indicates that the Pmg object is not visible. See Visible property.
0x0002 (bit 1) - The bit indicates that some parent of the Pmg object is not visible.
0x0010 (bit 4) - The bit indicates that the Pmg object is disabled. See Enabled property.
0x0020 (bit 5) - The bit indicates that some parent of the Pmg object is disabled.
0x0100 (bit 8) - The bit indicates that the Pmg object has the focus (for keyboard control). See Focus property.
0x1000 (bit 12) - The bit indicates that the mouse cursor is hovering over the Pmg object. See MouseOn property.
0x2000 (bit 13) - The bit indicates that the mouse cursor is hovering over some embedded Pmg object.
Note:
In the PmgRoot object, this event is triggered only for the value pEvent.NewValue = 0x0010 (i.e. if this object is disabled or enabled).

This event is also functional in Web panels.

This event can be used for creating active Pmg objects that react to mouse movement, or keyboard input by changing their graphic appearance. This can be used, for example, in the PmgCanvas object, where this can be used to design single state or multi state buttons. In this event, for example, the color can be changed based on the mouse cursor hovering over the item, the object is enabled/disabled, the object has focus, etc.
See also:
- Pm.GetBit (method)
Example:
Change background color of the PmgBox object based on the fact that the object or its parents are enabled/disabled (0x30 = object 0x0010 + parent 0x0020).
JavaScriptVBScriptSelect and copy to clipboard

pMe.ColorItem = (pEvent.NewValue & 0x30) ? "#808080" : "#c0c0c0";

History:
Pm8.03.00: Created
PROMOTIC 9.0.31 SCADA system documentation MICROSYS, spol. s r.o.

Send page remarkContact responsible person
© MICROSYS, spol. s r.o.