Consultor Eletrônico



Kbase P105191: How to construct a name and handle lists for all button widgets on a window?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   09/06/2005
Status: Unverified

GOAL:

How to construct a name and handle lists for all button widgets on a window?

FIX:

The following code will generates comma separated list of all BUTTON widgets names and their handles' string representations:
DO:
DEFINE VARIABLE cNameList AS CHARACTER NO-UNDO.
DEFINE VARIABLE cHandleList AS CHARACTER NO-UNDO.
DEFINE VARIABLE h AS HANDLE NO-UNDO.

ASSIGN
h = FRAME {&FRAME-NAME}:FIRST-CHILD
h = h:FIRST-CHILD.
DO WHILE VALID-HANDLE(h):
IF h:TYPE = 'BUTTON' THEN
ASSIGN
cNameList = cNameList + ',' + h:NAME
cHandleList = cHandleList + ',' + STRING(h).
h = h:NEXT-SIBLING.
END.
MESSAGE
"Button Widgets Name List:" "~t" LEFT-TRIM(cNameList, ',') "~n"
"Button Widgets Handel List:" "~t" LEFT-TRIM(cHandleList, ',')
VIEW-AS ALERT-BOX INFO BUTTONS OK.
END.