Consultor Eletrônico



Kbase P85033: How to walk all the menu Items of a menu-bar?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   21/06/2004
Status: Unverified

GOAL:

How to walk all the menu Items of a menu-bar?

FIX:

You can use the following code:

/* in a trigger or in the portion of code you want to include this functionality*/


DO:
DEFINE VARIABLE myHandle AS HANDLE NO-UNDO.
myHandle = {&WINDOW-NAME}:MENU-BAR:FIRST-CHILD.

RUN walkMenu (myHandle).
END.

PROCEDURE walkMenu.
DEFINE INPUT PARAMETER inputHandle AS HANDLE NO-UNDO.

DO WHILE VALID-HANDLE (inputHandle ) WITH FRAME {&FRAME-NAME}:

/* here the action you want to perform like: */
MESSAGE inputHandle:LABEL
VIEW-AS ALERT-BOX INFO BUTTONS OK.


IF CAN-QUERY (inputHandle, "FIRST-CHILD") THEN
/*apply recorsevely for the child*/
IF VALID-HANDLE (inputHandle:FIRST-CHILD) THEN
RUN walkMenu (inputHandle:FIRST-CHILD).
inputHandle = inputHandle :NEXT-SIBLING.
END.
END.