Consultor Eletrônico



Kbase 17785: Steps to create a window that maximize and minimize other
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   10/20/1999
Steps to create a window that maximize and minimize other

INTRODUCTION:
=============

This knowledgebase entry describes how to create a window that
maximize, minimize and restore other one.

WHY YOU NEED TO KNOW THIS:
===========================

This is an example of usage of the WINDOW-STATE attribute.


PROCEDURAL APPROACH:
====================

Do the following steps from the UIB and use regular windows.
The procedure to do the same with Smart Windows does not differ
very much from this one.

Do the following steps:

1) Create a window, close and save it as WINDOW-2.W.

2) Create another window, add a button and a radio-set to this one.

3) Add the following definitions into the definition section:

DEF VAR hproc AS HANDLE.
DEF VAR hwin AS HANDLE.

4) Add a CHOOSE trigger for the button with the following code:

IF NOT VALID-HANDLE(hproc) THEN DO:
RUN window-2.w PERSISTENT SET hproc.
hwin = hproc:CURRENT-WINDOW.
END.

5) Change the labels of the radio-set to Maximize, Minimize and
Restore, please notice that these correspond to 1, 2 and 3.

6) Add a VALUE-CHANGED trigger to the radio-set with the following
code:
IF VALID-HANDLE(hwin) THEN DO:
ASSIGN {&SELF-NAME}.
hwin:WINDOW-STATE = {&SELF-NAME}.
END.

7) Run WINDOW-1.W, run the program and play with the radio-set:
Minimize the window, restore the window,
maximize the window, restore the window.


EAG 03/19/98

Progress Software Technical Support Note # 17785