Consultor Eletrônico



Kbase 22050: Find the Handles of All SmartObjects in Every Window Page
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   5/23/2002
SUMMARY:

This Solution lists the ADMII code to obtain the handle, name, number of page, and type of object for all the SmartObjects in all of the pages of a window.

EXPLANATION:

This information is stored by the code in a temp-table and it is similar to what the Procedure Settings tool presents for a SmartWindow object when the option page is selected.

SOLUTION:

/**** TEMP-TABLE DEFINITION --> DEFINITIONS SECTION ****** */
DEFINE TEMP-TABLE tt
FIELD oname as char
FIELD tipo as char
FIELD ohandle as handle
FIELD npage as integer .

/* ******** CODE THAT CAN BE PLACED ON A TRIGGER ***********/

DEFINE VARIABLE i AS INTEGER NO-UNDO.
DEFINE VARIABLE x AS CHAR.

RUN initPages ( INPUT '1,2,3').
x= DYNAMIC-FUNCTION('getPageNTarget':U).

REPEAT i = 1 to num-entries(x):
create tt.
tt.ohandle = widget-handle(entry(1,entry(i,x), "|")).
tt.npage = integer(entry(2,entry(i,x), "|")).
tt.tipo = DYNAMIC-FUNCTION('getObjectType':U in tt.ohandle).
tt.oname = DYNAMIC-FUNCTION('getObjectName':U in tt.ohandle).
END.