Events are implemented and maintained with metadata.
You can query a class (or an event within a class) to view the event
metadata, and you can create your own metadata list to add or change
an event. For example, to list the metadata for the
click
event, execute code similar to the following:
init:
dcl num rc;
dcl list metadata;
dcl object obj;
obj=loadclass('sashelp.classes.listbox_c.class');
rc=obj._getEvent('click',metadata);
call putlist(metadata,'',3);
return;
The following event metadata is returned:
(NAME='click'
STATE='S'
DESCRIPTION='Occurs on a click'
CLASS=4415
EXECUTE='System'
METHOD=''
ENABLED='Yes'
CLASS=4415
)
The event metadata list
contains the following named items:
is the name of the
event. Event names may be up to 256 characters long.
is the current state
of each event. Valid values are I | N | S (corresponding to Inherited,
New, or System). This is a read-only metadata item.
describes how the event
is sent. Events can be sent automatically either before or after a
method. They can also be programmed manually with SCL. Valid values
are: A | B | M (corresponding to After, Before, Manual). New events
default to 'After'.
The Class Editor and
the
Properties window display Execute metadata
in the Send column of the table.
is the name of the
method that triggers the event (if Execute=A | B). A method name must
be specified for new events if they are to be sent automatically.
The field remains blank if the event is sent manually (if Execute=M).
indicates whether an
event is enabled or disabled. Valid values are Y | N.
is a descriptive summary
of the event's purpose. For inherited and system events, the description
is forwarded from the parent class. The maximum length is 256 characters.