Drag Window


mit besten Grüssen/kind regards

Hans Bertol
ÖAF Gräf & Stift AG Wien
Tel +43-1-86631-129
Fax +43-1-86631-109
mailto:Hans_Bertol@mn.man.de

A moveable Window moves with drag 'n drop
     H DEBUG CURSYM('S') DECEDIT('0,') DATEDIT(*YMD.) DATFMT(*EUR)
     H COPYRIGHT('(C) ÖAF Gräf & Stift AG Wien 1992, 2001.')
     H OPTION(*SRCSTMT : *NODEBUGIO)   AUT(*CHANGE)

     FMOUSED    CF   E             WORKSTN

     d*  Maximal = screensize  -  windowsize
     d MaxCol          s              3  0 Inz(38)
     d MaxRow          s              3  0 Inz(16)

     c                   eval      Zeile3 = 'Just click with the mouse'
     c                   eval      Zeile4 = ' somewhere on the screen'

     C                   EVAL      R0 = 5
     C                   EVAL      C0 = 20

     C                   Do        *HiVal

     c                   eval      Zeile5 = Zeile4
     c                   eval      Zeile4 = Zeile3
     c                   eval      Zeile3 = Zeile2
     c                   eval      Zeile2 = Zeile1

     C                   EVAL      Zeile1 = %editc(R0:'J') +
     C                                      %editc(C0:'J') + '|' +
     C                                      %editc(R1:'J') +
     C                                      %editc(C1:'J') + '|' +
     C                                      %editc(R2:'J') +
     C                                      %editc(C2:'J') + '|' + *in24            

     C                   EXFMT     KundenPrs
     C   03              Leave

     c                   if        *in24
     c*    Calculate the new window position
     C                   EVAL      R0 = R1 - 1
     C                   EVAL      C0 = C1 - 1
     c*    Check if the window  position fits into the screen
     c                   if        R0 < 1
     c                   eval      R0 = 1
     c                   endif
     c                   if        R0 > MaxRow
     c                   eval      R0 = MaxRow
     c                   endif
     c                   if        C0 < 2
     c                   eval      C0 = 2
     c                   endif
     c                   if        C0 > MaxCol
     c                   eval      C0 = MaxCol
     c                   endif
     c                   endif
     c                   enddo


     C     ENDPGM        TAG
     C                   SETON                                        LR









The DDS for the Moveable Window

     A*%%TS  SD  20010201  130606  UA3HB       REL-V4R4M0  5769-PW1
     A*%%EC
     A                                      DSPSIZ(24 80 *DS3)
     A                                      PRINT
     A                                      CA03(03)
     A          R DUMMY                     ASSUME
     A                                  2  2'XXX'
     A          R KUNDENPRS
     A*%%TS  SD  20010201  130606  UA3HB       REL-V4R4M0  5769-PW1
     A                                      CA24(24)
     A                                      RTNCSRLOC(*MOUSE &R1 &C1 &R2 &C2)
     A                                      WINDOW(&R0 &C0 6 38 *NOMSGLIN *NORS-        
     A                                      TCSR)
     A                                      WDWTITLE((*TEXT +
     A                                      'Test The Mouse - F3 to end'))
     A                                      MOUBTN(*ULP  CA24)
     A  24                                  RMVWDW
     A            R0             2S 0P
     A            C0             3S 0P
     A            R1             3S 0H
     A            C1             3S 0H
     A            R2             3S 0H
     A            C2             3S 0H
     A            ZEILE1        38A  O  1  1DSPATR(HI)
     A            ZEILE2        38A  O  2  1DSPATR(HI)
     A            ZEILE3        38A  O  3  1DSPATR(HI)
     A            ZEILE4        38A  O  4  1DSPATR(HI)
     A            ZEILE5        38A  O  5  1DSPATR(HI)
     A            ZEILE6        38A  O  6  1DSPATR(HI)


e-mail to Hans Bertol