Resize

The VARPG Code for a resizing event

      *
      * Declare display size System attributes
     D%DSPHEIGHT       S              4  0
     D%DSPWIDTH        S              4  0

      * Declare %NewHeight, and %NewWidth event attributes. These will
      * contain the width and height of the window after it is has been
      * resized.
     D%NEWHEIGHT       S              4  0
     D%NEWWIDTH        S              4  0
      * The new mode of a window: ( 2 = minimized)
     D%NewMode         S              1  0

      *-------------------------------------------------------------------=
      *   Sample to resize a window                           Sub Routine =
      *-------------------------------------------------------------------=
     C     ResizeSr      BEGSR
      * Do not do if the new mode is "Minimized":
     C                   If        %NewMode = 2
     C                   Else
      * Set Container:
     C                   Eval      %SetAtr('Main':'Container':'Width') =
     C                             (%NewWidth * .5) - 12
     C                   Eval      %SetAtr('Main':'Container':'Left') = 4
     C                   Eval      %SetAtr('Main':'Container':'Height') =
     C                             (%NewHeight * .5) - 10
     C                   Eval      %SetAtr('Main':'Container':'Top') = 4
      * Set Calendar:
     C                   Eval      %SetAtr('Main':'Calendar':'Width') =
     C                             (%NewWidth * .5) - 12
     C                   Eval      %SetAtr('Main':'Calendar':'Left') =
     C                             (%NewWidth * .5)
     C                   Eval      %SetAtr('Main':'Calendar':'Height') =
     C                             (%NewHeight * .5) - 10
     C                   Eval      %SetAtr('Main':'Calendar':'Top') = 4
      * Set MultiEdit:
     C                   Eval      %SetAtr('Main':'MLEEdit':'Width') =
     C                             %NewWidth - 16
     C                   Eval      %SetAtr('Main':'MLEEdit':'Left') = 4
     C                   Eval      %SetAtr('Main':'MLEEdit':'Height') =
     C                             (%NewHeight * .5) -40
     C                   Eval      %SetAtr('Main':'MLEEdit':'Top') =
     C                             (%NewHeight * .5)

     C                   EndIf
     C                   ENDSR
      *-------------------------------------------------------------------=
      *    Set on last record:                                            =
      *-------------------------------------------------------------------=
     C     MAIN          BEGACT    DESTROY       MAIN
     C                   Eval      *InLR = *On
     C                   ENDACT
      *-------------------------------------------------------------------=
      *    Resizing a Window                                              =
      *-------------------------------------------------------------------=
     C     MAIN          BEGACT    RESIZE        MAIN
     C                   Exsr      ResizeSr
     C                   ENDACT
      *-------------------------------------------------------------------=
      *    Set Initial size at 50% (1/4) of the screen size:              =
      *-------------------------------------------------------------------=
     C     MAIN          BEGACT    CREATE        MAIN
     C                   Eval      %SetAtr('Main':'Main':'Height') =
     C                             %DSPHEIGHT * .5
     C                   Eval      %SetAtr('Main':'Main':'Width') =
     C                             %DSPWidth * .5
      *
     C                   ENDACT
      *-------------------------------------------------------------------=