Consultor Eletrônico



Kbase P39054: How to run a Smart Window from a regular window and ensure that the  Smart Window is closed on the c
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   01/11/2007
Status: Verified

GOAL:

How to run a Smart Window from a regular window and ensure that the Smart Window is closed on the close of the parent regular window?

GOAL:

How to run a Smart Window from a regular window?

FACT(s) (Environment):

Windows
Progress 9.x
OpenEdge 10.x

FIX:

1) In the Definitions section of the parent regular window define a handle variable hSmartWindow to store the handle of the child SmartWindow:


DEFINE VARIABLE hSmartWindow AS HANDLE NO-UNDO.
2) In the needed location within the parent regular window, write code to start the child smart window only if the smart window is not running. If it is running and hidden, just bring it to view:


DO:
IF NOT VALID-HANDLE(hSmartWindow) THEN
DO:
RUN SmartWindow PERSISTENT SET hSmartWindow.
RUN initializeObject IN hSmartWindow.
END.
ELSE
RUN viewObject IN hSmartWindow.
END.
3) In the WINDOW-CLOSE window trigger procedure of the parent check to see if the child smart window is running and if yes close it by inserting the statement:


IF VALID-HANDLE(hSmartWindow) THEN
RUN destroyObject IN hSmartWindow.
before the 'APPLY "CLOSE":U TO THIS-PROCEDURE.' statement.