EVENTSEND
PLBCMP GUI Only
The EVENTSEND instruction allows sending an event to a specified object. Optional keyword parameter data can be sent when the event is posted or queued. The instruction uses the following format:
|
|
|
|
Where:
label
Optional. A Program Execution Label.
object
Required. A previously defined and created object, pointer to an object, COLLECTION, or the keyword *CLIENT.
event
Required. A previously defined Numeric Variable, Literal, decimal number, or Expression that specifies the event type registered.
keyword
Optional. One of the EVENTINFO keywords from the table below.
dest
Optional. A previously defined Character String Variable, Numeric Variable, or VARIANT that receives the result of the operation.
Flags Affected: OVER (Automation Server Only)
Note the following:
The {object} must have been previously CREATEd.
{event} is a decimal number, a Numeric Variable, an Expression, or a keyword as defined in PLBEQU.INC. The supported values and keywords are:
|
Value |
Keyword |
Event |
|
0 |
$LOAD | |
|
1 |
$ACTIVATE | |
|
2 |
$DEACTIVATE | |
|
3 |
$CHANGE | |
|
4 |
$CLICK | |
|
5 |
$CLOSE | |
|
6 |
$DBLCLICK | |
|
7 |
$DRAGDROP | |
|
8 |
$DRAGOVER | |
|
9 |
$GOTFOCUS | |
|
10 |
$KEYPRESS | |
|
11 |
$LOSTFOCUS | |
|
12 |
$MOVE | |
|
13 |
$MOUSEDOWN | |
|
14 |
$MOUSEUP | |
|
15 |
$MOUSEMOVE | |
|
16 |
$PAINT | |
|
17 |
$RESIZE | |
|
18 |
$TIMER | |
|
19 |
$OLDEVENT | |
|
20 |
$FORMINIT | |
|
21 |
$OBJMOVE | |
|
22 |
$UPDATED | |
|
23 |
$COLCLICK | |
|
24 |
$VALIDATE | |
|
25 |
$ITEMACTIVATE | |
|
26 |
$BUTTONCLICK | |
|
26 |
$ITEMCLICK | |
|
27 |
$MOUSEWHEEL | |
|
28 |
$HSCROLL | |
|
29 |
$VSCROLL | |
|
31 |
$LINKCLICK | |
|
32 |
$SUSPEND |
Any event number used other than a predefined {event} numbers is considered a user-defined event. When using user-defined events, the user is responsible for insuring that an {object} has registered the event or can make use of the event being sent.
When the {object} is specified as *CLIENT, the
{event} value must be a value of one to ten. The event is sent to the
client program that is receiving the events for the PL/B Automation Server program object. The {event}
value in this case must match the UserEvent1 to UserEvent10 defined for the PL/B Automation Server program
object. Each event can have five optional parameters (ARG1 to ARG5) to pass data with the event. ARG1
to ARG5 are the only keywords that send data to a connected client program. It should be noted that the
number of arguments (ARGn) are limited to five when {object} is specified as *CLIENT.
However, it possible that other types of objects may allow a maximum of ten arguments (ARGn). The OVER
flag is affected when the *CLIENT internal object is specified. The OVER flag is set when there are no
client programs connected to the Automation Server that can receive the event.
|
Event Value |
Client Event |
Optional Parameters |
|
1 |
UserEvent1 |
ARG1, ARG2, ARG3, ARG4, and ARG5 |
|
2 |
UserEvent2 |
ARG1, ARG2, ARG3, ARG4, and ARG5 |
|
... |
|
|
|
10 |
UserEvent10 |
ARG1, ARG2, ARG3, ARG4, and ARG5 |
Example:
|
|
|
|
Where:
|
*CLIENT |
Identifies the client program connected to the Automation Server program object. |
|
1 |
Indicates that event number 1 is sent |
|
ARG1=NAME |
Identifies that the data found in NAME variable is sent as ARG1 parameter data for the event. |
|
ARG2=PHONE |
Identifies that the data found in PHONE variable is sent as ARG2 parameter data for the event. |
The optional {keyword} operand defines the type of information that is sent. It must be from the following table:
|
Keyword |
Use |
|
ARGx=<var> |
Sends the specified argument for the event. ARGx may be a value of ARG1 to ARG10 indicating the respective argument. |
|
CHAR=<svar> |
Sends the character that caused the event. |
|
MODIFIER=<nvar> |
Sends the Event Modifier. |
|
RESULT=<nvar> |
Sends the expected result value. |
|
ARG1=<var> |
Argument 1 data that is sent. The {var} variable can be a Numeric Variable, String Variable, or a VARIANT. |
|
ARG2=<var> |
Argument 2 data that is sent. The {var} variable can be a Numeric Variable, String Variable, or a VARIANT. |
|
ARG10=<var> |
Argument 10 data that is sent. The {var} variable can be a Numeric Variable, String Variable, or a VARIANT. |
The Event Modifier is a value accumulated from any combination of the following values:
|
Value |
Modifier |
|
0 |
No modifier provided |
|
1 |
Alt Key |
|
2 |
Ctl Key |
|
4 |
Shift Key |
|
8 |
Left mouse button down |
|
16 |
Right mouse button down |
|
32 |
Double click |
Multiple {keyword=dest} pairs may be specified, separated by commas.
|
|
EVENTSEND |
|
|
|
|
|
| |
|
|
|
MODIFIER=#EventMod: | |
|
|
|
|
When the {object} is specified as *CLASS, the EVENTSEND must be executed from the CLASSMODULE load module which has been created using a CREATE PLBOBJECT instruction. In this case, the EVENTSEND immediately dispatches execution to the PLBOBJECT object event handler routine which has been registered using an EVENTREG instruction for the PLBOBJECT object. When the event handler routine is finished and returns, the program execution continues at the PL/B statement following the EVENTSEND instruction. The 'EVENTSEND *CLASS, ..." instruction is only supported by a Windows Runtime.
Example of 'MyClass.plc':
See Also: CREATE, Object Instructions
![]() |