[Stackoverflow] [Progress OpenEdge ABL] Some questions on event handling in Progress-4GL

Status
Not open for further replies.
D

Dominique

Guest
I have been asked to implement an event handler on a fill-in field in a *.w file (in case of F5, something should be done).

I started doing the following:

Code:
ON F5 OF particular_fill-in_Field
DO:
    ...
END.

This did not work, and later I realised there already was the following present in the source code:

Inside include-file:

Code:
&GLOBAL-DEFINE SEARCH-KEYBOARD "F5":u
&GLOBAL-DEFINE SEARCH-MOUSE MOUSE-SELECT-DBLCLICK

Inside *.w file:

Code:
ON {&SEARCH-KEYBOARD},{&SEARCH-MOUSE} OF particular_fill-in_Field
DO: 
...
END.

While checking the progress website, I found following URL, explaining the ON-statement:

Code:
ON CHOOSE OF b_next, b_prev DO:
  IF SELF:LABEL = "Next" THEN
  ...

This leaves me with some questions:

  1. When I added my ON F5 line, there were two event handlers for the F5 (SEARCH-KEYBOARD) event. Why did this even compile and as it compiled, why did it take the already existing line of code and not the one I added?
  2. The example on the URL shows how to handle the same event on different widgets (you can use the SELF object to know which widget launches the event handler), but what about different events on one widget (like in my case, ON {&SEARCH-KEYBOARD},{&SEARCH-MOUSE} OF ...), can I know which event has been triggered, SEARCH-KEYBOARD or SEARCH-MOUSE?

Continue reading...
 
Status
Not open for further replies.
Top