Consultor Eletrônico



Kbase 16143: Why You Can't Define a Popup Menu Within a "Popup" Trigger
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   5/10/1998
Why You Can't Define a Popup Menu Within a "Popup" Trigger

Due to the way in which Progress filters the messages coming in from
MS-Windows, you cannot use the RIGHT-MOUSE-DOWN or RIGHT-MOUSE-CLICK
events to dynamically define the popup menu which should be displayed
as the result of the RIGHT-MOUSE-DOWN or RIGHT-MOUSE-CLICK event.

What will happen when if you attempt to do this is that the first
RIGHT-MOUSE-<xxx> event will execute your trigger (which will define
the popup menu) but it will not popup the menu. This is because by
the time we have received the "low level" MS-Windows events which
correspond to our RIGHT-MOUSE-<xxx> events, it is too late to define
the popup menu.

The next RIGHT-MOUSE-<xxx> event will popup the menu defined during
the previous invocation of the trigger, but it will not popup the
new popup menu which was defined/redefine in the trigger.

In essence, your popup menus will always be "one menu behind".

This strategy would work if it was possible to predict when a user
would click the mouse button, as in a BEFORE-RIGHT-MOUSE-<xxx> event,
but unfortunately it is not possible to implement such an event.

Progress Software Technical Support Note # 16143