Previous Next

Event tables
The tables in this section describe user interface events, the user actions that generate the events, and widgets that have default behavior for the events. The term field‑level widgets refers to any widgets that can be part of a field group in a frame: fill‑ins, sliders, selection lists, toggle boxes, radio sets, editors, rectangles, images, text, buttons, combo boxes, and browse widgets. Frames, dialog boxes, windows, menus (including menu bars and pop‑up menus), sub‑menus, and menu items can also receive events. Note that there is frequently a distinction made between a browse widget and a single cell in an updateable browse. For the most part, a browse cell behaves as a fill‑in widget.
The event tables in this section describe the following kinds of events:
*
*
*
*
*
*
*
Keyboard events
ABL makes all keyboard actions available as events that you can specify by either key label or key function. You can write triggers for these keyboard events, and associate these triggers with any field‑level widget that receives input focus. For a complete list of key label and key function names, and information on how to use them, see the chapter on handling user input in OpenEdge Development: Programming Interfaces.
Keyboard events have default effects depending on the widget that receives the event. For example, the “A” key label event displays an uppercase “A” in a fill‑in or editor widget, but has no default effect when applied to a button. ABL organizes some key function events into several classes that have default effects on selected groups of widgets. ABL also provides special keyboard events to write default triggers on classes of keys. You can use these default events to write a trigger for all keys in a particular class for which you have not defined a key label or key function event trigger.
Main classes of key function events
ABL supports three main classes of key function events:
*
Universal key function events — Apply to all user‑interface widgets except menus, submenus, and menu items
*
Navigation key function events — Apply to those field‑level widgets that can receive focus
*
Field editing key function events — Apply to fill‑ins and browse cells
Table 114 describes universal key function events.
 
BELL
END-ERROR
ENDKEY
ERROR
GO
HELP
Table 115 describes navigation key function events.
 
BACK-TAB
CURSOR-DOWN
DOWN
CURSOR-LEFT
LEFT
CURSOR-RIGHT
RIGHT
CURSOR-UP
UP
NEXT-FRAME
PREV-FRAME
TAB
Table 116 describes field editing key function events.
 
BACKSPACE
CLEAR
DELETE-CHARACTER
RECALL
RETURN
Default keyboard events
ABL provides two keyboard events that you can use to write default triggers. Table 117 describes these events.
 
ANY-KEY
ANY-PRINTABLE
Mouse events
ABL supports two types of mouse events—portable and three‑button events. You can use portable mouse events to associate triggers with logical actions of any mouse. You can use the three‑button mouse events to associate triggers with specific physical actions of a three‑button mouse.
The following tables reference portable mouse buttons for portable mouse events and physical mouse buttons for three‑button mouse events. For more information on the mapping between portable and physical mouse buttons and how the AVM processes mouse events, see the chapter on handling user input in OpenEdge Development: Programming Interfaces.
Portable mouse events
Table 118 lists the mouse events that apply to all mice, no matter how the buttons are configured.
 
MOUSE-SELECT-DOWN
MOUSE-SELECT-UP
MOUSE-SELECT-CLICK
MOUSE-SELECT-DBLCLICK
MOUSE-MENU-DOWN
MOUSE-MENU-UP
MOUSE-MENU-CLICK
MOUSE-MENU-DBLCLICK
MOUSE-EXTEND-DOWN
MOUSE-EXTEND-UP
MOUSE-EXTEND-CLICK
MOUSE-EXTEND-DBLCLICK
MOUSE-MOVE-DOWN
MOUSE-MOVE-UP
MOUSE-MOVE-CLICK
MOUSE-MOVE-DBLCLICK
Three‑button mouse events
Table 119 lists the mouse events associated with physical mouse buttons.
 
LEFT-MOUSE-DOWN
LEFT-MOUSE-UP
LEFT-MOUSE-CLICK
LEFT-MOUSE-DBLCLICK
RIGHT-MOUSE-DOWN
RIGHT-MOUSE-UP
RIGHT-MOUSE-CLICK
RIGHT-MOUSE-DBLCLICK
MIDDLE-MOUSE-DOWN
MIDDLE-MOUSE-UP
MIDDLE-MOUSE-CLICK
MIDDLE-MOUSE-DBLCLICK
High-level widget events
Table 120 lists high‑level widget events. These are events generated by mouse or keyboard actions that perform high‑level operations on a widget, such as entering a fill‑in, choosing a button, or displaying a menu. Unless noted in the AVM Action column, triggers on these events execute before the AVM applies the event. If the trigger returns NO-APPLY, the AVM does not apply the event. If the trigger executes after the event takes place, NO-APPLY has no effect.
Note:
 
CHOOSE
DEFAULT-ACTION
DROP-FILE-NOTIFY 1,2
END
END-SEARCH1
ENTRY
Note: For a browse widget, ON ENTRY OF browse-name specifies a trigger for the browse widget and ON ENTRY OF column-name IN BROWSE browse-name specifies a trigger for a browse cell. The browse cell is the intersection of the named column and the currently focused row.
HOME
ITERATION-CHANGED
LEAVE
Note: For a browse widget, ON LEAVE OF browse-name specifies a trigger for the browse widget and ON LEAVE OF column-name IN BROWSE browse-name specifies a trigger for a browse cell. The browse cell is the intersection of the named column and the currently focused row.
MENU-DROP
Menu,3 submenu
OFF-END 4
OFF-HOME 
PARENT‑WINDOW‑CLOSE 
ROW-DISPLAY
ROW-ENTRY
ROW-LEAVE
SCROLL-NOTIFY
START-SEARCH1
VALUE-CHANGED
WINDOW-CLOSE
WINDOW-MAXIMIZED1
WINDOW-MINIMIZED
WINDOW-RESIZED
WINDOW-RESTORED

1
Windows only.

2
Graphical interfaces only.

3
Supported only if the Menu POPUP-ONLY attribute is set to TRUE and the menu is set as a popup for some other widget.

4
The OFF-END event can also occur when there are more rows to retrieve in the query on a ProDataSet temp-table buffer. For more information, see the “ProDataSet events” section.

Direct manipulation events
Direct manipulation events are ABL events that directly modify the size, shape, position, and appearance of a widget. These events are generated by mouse actions. Each user interface widget either has direct manipulation enabled or does not. Some types of widgets, such as menus, cannot have direct manipulation enabled. You can enable widgets for direct manipulation by setting the SELECTABLE, MOVABLE, or RESIZABLE attribute to TRUE.
If a widget has direct manipulation enabled, then direct manipulation events take priority over all other events. In other words, while data manipulation is enabled, the widget cannot perform data entry or application control functions. For example, if you set SELECTABLE to TRUE for a button, ABL interprets a MOUSE-SELECT-UP event as a SELECTION event. If you set SELECTABLE to FALSE, ABL interprets the same event as a CHOOSE event.
Direct manipulation events can be broken down into two types: general and frame-only. General direct manipulation events apply to both field-level and frame widgets. Frame-only direct manipulation events apply only to frames.
The following sections list the ABL events associated with direct widget manipulation. The user actions listed for these events assume that you set the appropriate attributes to make each event possible. For example, a widget must be SELECTABLE to receive the SELECTION event.
General direct manipulation events
Table 121 lists the direct manipulation events that apply to field‑level widgets and frames.
 
DESELECTION
Internal: Sets the widget’s SELECTED attribute to FALSE. This setting takes effect after any trigger for the event executes.
Screen: Removes the highlight from the affected widget or widgets.
END-MOVE
Internal: Generates an END-MOVE event for each moved widget.
Screen: Moves each widget to the new x and y coordinates of its drag box.
END-RESIZE
Internal: Generates an END-RESIZE event for the resized widget.
Screen: Resizes the widget to the new x and y coordinates of its resize box.
END-ROW-RESIZE
Internal: Generates an END-ROW-RESIZE event for the resized row.
Screen: Resizes all rows to the new height.
SELECTION
Internal: Sets each widget’s SELECTED attribute to TRUE. This setting takes effect after any trigger for the event executes.
Screen: Highlights the affected widget or widgets.
START-MOVE
Internal: Sends a START-MOVE event to all selected widgets. If the trigger returns a NO-APPLY, the AVM does not generate the subsequent END-MOVE event.
Screen: Draws a drag box around each of the one or more affected widgets, and moves each drag box in the direction of the moving mouse pointer.
START-RESIZE
Internal: Sends a START-RESIZE event to the selected widget. If the trigger returns NO-APPLY, the AVM does not generate the subsequent END-RESIZE event.
Screen: Stretches a resize box around the widget in the direction of the moving mouse pointer.
START-ROW-RESIZE
Internal: Sends a START-ROW-RESIZE event to the browse. If the trigger returns NO-APPLY, the AVM does not generate the subsequent END-ROW-RESIZE event.
Screen: Stretches a resize box around the row in the direction of the moving mouse pointer.
Frame-only direct manipulation events
Table 122 lists the direct manipulation events that apply only to frames.
 
EMPTY-SELECTION
Internal: Sends a DESELECTION event to all selected widgets in the frame and sends the EMPTY-SELECTION event to the frame.
Screen: Removes the highlight around any selected widgets in the frame.
END-BOX-SELECTION
Internal: If the user pressed the mouse SELECT button, the AVM sends a SELECTION event to all widgets surrounded by the select box. If the user pressed a mouse EXTEND button, the AVM sends a SELECTION event to all unselected widgets, and a DESELECTION event to all selected widgets surrounded by the select box.
Screen: Erases the select box, highlights selected widgets, and removes the highlight from deselected widgets.
START-BOX-SELECTION
Internal: Sends a START-BOX-SELECTION event to the frame. If a trigger returns NO-APPLY, the AVM does not generate the subsequent END-BOX-SELECTION event.
Screen: Draws a select box, which initially appears as a dot.
Developer events
ABL provides eleven events, labeled U1 through U10 and CLOSE, that you can invoke on any widget using the APPLY statement. The only function of a developer event is the one provided by your own trigger definition.
Socket events
ABL looks for events to execute in the context of input-blocking or event-processing statements. During this processing if the AVM detects that data is available on a socket or that the remote end closed its socket or it detects that a client has connected to a port that the server has enabled connections to, a socket event is generated.
There are only two socket events, the READ-RESPONSE event, which applies only to socket objects, and the CONNECT event which applies only to server socket objects.
READ-RESPONSE event
AVM Detects — Data is available on a socket or the remote end of a connection has closed its socket; applies only to socket objects.
AVM Action — The AVM invokes the READ-RESPONSE event procedure.
The SET-READ-RESPONSE-PROCEDURE( ) method is used to name the READ-RESPONSE event procedure and to associate it with a socket object. The AVM invokes this procedure whenever it detects that data is available on the socket or that the remote end of the socket has closed its end of the socket. In this procedure, the SELF handle identifies the affected socket object.
To determine if the event procedure was invoked because data is available for reading or because of a disconnect, the application can use one of several methods:
*
*
*
CONNECT event
AVM Detects — A client has connected to a port that the server has enabled connections to; applies only to server socket objects.
AVM Action — The AVM invokes the CONNECT event procedure.
The SET-CONNECT-PROCEDURE( ) method is used to name the CONNECT event procedure and to associate it with a server socket object. The CONNECT event procedure must accept one input parameter of type HANDLE. This is the handle to the implicitly created socket object for this connection. It is via this socket object that the server communicates with the client.
If the SET-CONNECT-PROCEDURE( ) method is not invoked, or if it fails, no connection procedure will be executed when the CONNECT event occurs.
ProDataSet events
ABL provides events you can invoke to execute application-specific code that handles FILL operations on a ProDataSet object or Buffer object, as well as row-level change operations. You can use the SET-CALLBACK-PROCEDURE( ) method to associate an action with these events.
Event procedures must define a single parameter for the ProDataSet object (DATASET or DATASET-HANDLE) as an INPUT parameter BY-REFERENCE. This allows the event procedure to operate on the ProDataSet object using static ABL to reference its buffers and fields, without the ProDataSet object being physically copied. This also means that because the ProDataSet object is not copied, changes made to the ProDataSet object by the event procedure are made to the same copy used by all procedures.
The following sections describe the ProDataSet events:
*
*
*
*
*
FILL events
There are two levels of FILL events: the first level is for a ProDataSet object or one of its member buffer objects; the second level is for individual records created in each temp-table.
Table 123 lists the first-level FILL events.
 
AFTER-FILL
BEFORE-FILL
Table 124 lists the second-level FILL events. These events occur once immediately before or after each record is created in a temp-table during a FILL.
 
AFTER-ROW-FILL
BEFORE-ROW-FILL
Row-level events
Row-level events are defined for making local changes to the records in a ProDataSet member buffer object. Table 125 lists the row-level events.
 
Table 125:
ROW-CREATE
ROW-DELETE
ROW-UPDATE
OFF-END event
The OFF-END event occurs when you position a query on a ProDataSet temp-table buffer past the last row. You can use this event to retrieve additional data source rows to add at the bottom of a ProDataSet temp-table (for example, in batches when there are too many data source rows to retrieve at one time).
The OFF-END event can also occur when the user performs a keyboard or mouse action in a browse that scrolls off the end (past the last row) of a browse on a ProDataSet temp-table buffer. For more information about using the OFF-END event with a browse, see the “High-level widget events” section.
Note:
The OFF-END event is similar to the QUERY-OFF-END attribute, which is set to TRUE whenever the associated query object is positioned past the last row. The difference is that you must test the QUERY-OFF-END attribute for this condition at a specific place in your application code, whereas the OFF-END event procedure executes like a trigger whenever the event occurs.
Consider the following restrictions when using the OFF-END event with a query on a ProDataSet temp-table buffer:
*
*
*
*
*
If you use the GET LAST statement or GET-LAST( ) method to get the last record associated with the query, the event handler is called repeatedly until it does not RETURN NO-APPLY (indicating that all records have been retrieved). For this reason, use caution when offering users the GET LAST action.
*
FIND-FAILED event
The FIND-FAILED event occurs when a FIND on a ProDataSet temp-table buffer fails. This can be the result of the FIND statement (but not the FIND NEXT, FIND PREV, or FIND LAST statements, and not the CAN-FIND function), or the FIND-FIRST( ) or FIND-UNIQUE( ) methods (but not on the FIND-LAST( ) method).
You can use this event to adjust the contents of the ProDataSet object. The event handler must be able to determine the action to take based on the context of the ProDataSet object, and must RETURN NO-APPLY to indicate the action was successful. For example, when the event occurs, the event handler could retrieve a missing row or a set of related rows from the server automatically.
SYNCHRONIZE event
The SYNCHRONIZE event occurs when a ProDataSet temp-table buffer is synchronized. That is, when the SYNCHRONIZE( ) method is run on the buffer or a parent buffer, or the buffer is selected in a browse. The event handler is invoked recursively at every level of the ProDataSet object hierarchy just before the recursion to the child levels.
By default, if the query is associated with a browse, the synchronize action of reopening the query automatically refreshes the browse. If the query is not associated with a browse, the synchronize action automatically gets the first row in the query by invoking a GET FIRST operation. If there is a REPOSITION data relation and no browse, the synchronize action gets the next record in the query by invoking a GET NEXT operation. Once these actions attempt to populate the buffer at a particular level, the SYNCHRONIZE event runs before moving recursively to the next lower level.
This event allows you to fetch rows, display buffer values in a frame, or take some other action. The handler procedure can also RETURN NO-APPLY to cancel the cascading of the synchronization to child buffers.
 

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