Kbase P38502: How to close a smart window when another is run on the push
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  9/23/2003 |
|
Status: Unverified
GOAL:
How to close a smart window when another is run on the push of a button on the original?
FACT(s) (Environment):
Windows
FACT(s) (Environment):
Progress 9.x
FIX:
There are two ways to do this depending on our application·s requirements:
1. To simply 'hide' SmartWindowA when we run 'SmartWindowB'. This means that when we exit from SmartWindowB we return to SmartWindowA.
2. Destroy 'SmartWindowA' completely. This means that when we exit from SmartWindowB we actually exit the application.
To do the ·hide· method:
1. Define a variable in the main definition section of SmartWindowA to store the CURRENT-WINDOW handle.
DEFINE VARIABLE hSmartWindowA AS HANDLE NO-UNDO.
2. Include the following code in the SmartWindowA button·s CHOOSE trigger:
DO:
hSmartWindowA = CURRENT-WINDOW.
hSmartWindowA:VISIBLE = FALSE.
RUN SmartWindowB.w.
hSmartWindowA:VISIBLE = TRUE.
END.
To do the ·destroy· method:
1. Define a variables in the main definition section of SmartWindowA to store the THIS-PROCEDURE handle:
DEFINE VARIABLE hSmartWindowA AS HANDLE NO-UNDO.
2. Include the following code in the SmartWindowA button·s CHOOSE trigger:
DO:
hSmartWindowA = THIS-PROCEDURE.
RUN SmartWindowB.w (INPUT hSmartWindowA2).
END.
3. Define a HANDLE INPUT PARAMETER variables in the main definition section of SmartWindowB to store SmartWindowA·s procedure handle:
DEFINE INPUT PARAMETER hSmartWindowA AS HANDLE NO-UNDO.
4. Add the following code before the RUN SUPER statement in a local initializeObject override in hSmartWindowB:
RUN destroyobject IN hSmartWindowA2.