Previous Next

LIST-EVENTS function
Returns a comma-separated list of the valid events for a specified object or widget.
Note:
Syntax 
 
LIST-EVENTS ( handle [ , platform ] )
handle
A handle to a valid object or widget. The function returns a list of the events that are valid for that object or widget.
platform
A character-string value that specifies a display type. Valid values are GUI and TTY. Some events are valid only on certain platforms. If you omit the platform parameter, the AVM uses the platform for the current session.
Example 
The following example uses the LIST-EVENTS function to populate a selection list with all the valid events for a widget. When you run this procedure, type ? at any time to see a list of valid events for the widget that currently has focus.
 
DEFINE VARIABLE inv-price   NO-UNDO LIKE item.price.
DEFINE VARIABLE inv-value   NO-UNDO LIKE item.price.
DEFINE VARIABLE report-type AS INTEGER   NO-UNDO INITIAL 1.
 
DEFINE VARIABLE event-list  AS CHARACTER NO-UNDO
  VIEW-AS SELECTION-LIST INNER-CHARS 20 INNER-LINES 5 SCROLLBAR-VERTICAL.
 
DEFINE BUTTON ok-butt     LABEL "OK" AUTO-GO.
DEFINE BUTTON cancel-butt LABEL "CANCEL" AUTO-ENDKEY.
      
FORM
  inv-price LABEL "Price" AT ROW 1.25 COLUMN 2
  report-type LABEL "Report Sorted ..." AT ROW 2.25 COLUMN 2 
    VIEW-AS RADIO-SET RADIO-BUTTONS 
    "By Catalog Page", 1, "By Inventory Value", 2 SKIP
  ok-butt cancel-butt
  WITH FRAME select-frame SIDE-LABELS.
 
FORM event-list
  WITH FRAME list-frame NO-LABELS TITLE "Events" WIDTH 30.
 
ON ? ANYWHERE DO:
  FRAME list-frame:TITLE = "Events for " + FOCUS:TYPE. 
  event-list:LIST-ITEMS IN FRAME list-frame = LIST-EVENTS(FOCUS).
  DISPLAY event-list WITH FRAME list-frame.
  ENABLE event-list WITH FRAME list-frame.
  RETURN NO-APPLY.  
END.
 
ENABLE ALL WITH FRAME select-frame.
WAIT-FOR WINDOW-CLOSE OF CURRENT-WINDOW.
See also 
LAST-EVENT system handle, LIST-QUERY-ATTRS function, LIST-SET-ATTRS function, LIST-WIDGETS function, VALID-EVENT function

Previous Next
© 2013 Progress Software Corporation and/or its subsidiaries or affiliates.