Dialog System

-  How to position a current window at the same x and y coordinates position as my previews window but whereby the two are not parent-child windows and belong to different screensets.

  • Verified Answer

    See Dialog System Help searching 'dsmovsz':

    Dsmovsz Example
    This example moves two windows, win1 and win2, down and to the right.

    @MOVE
    MOVE "movr" DSMOVSZ-FUNCTION(1)
    MOVE 2 DSMOVSZ-HANDLE-COUNT(1)
    MOVE 100 DSMOVSZ-X(1)
    MOVE 200 DSMOVSZ-Y(1)
    MOVE-OBJECT-HANDLE WIN1 DSMOVSZ-WINDOW-HANDLE(1)
    MOVE-OBJECT-HANDLE WIN2 DSMOVSZ-WINDOW-HANDLE(2)
    CLEAR-CALLOUT-PARAMETERS $NULL
    CALLOUT-PARAMETER 1 DSMOVSZ-PARAMETER-BLOCK $NULL
    CALLOUT-PARAMETER 2 DSMOVSZ-HANDLES $NULL
    CALLOUT "dsmovsz" 0 $PARMLIST

    DSMOVSZ-FUNCTION: (partial)
    Mova Move a window or dialog box to an absolute position.
    Movp Move a window or dialog box relative to the position of their parents.
    Movr Move a window or dialog box by a specified distance.

    Qpa Get the current absolute position of a specified window or dialog box.
  • Hi,

    I saw this in the Dialog System sample programs. This example moves windows that are withing the same screenset. I am trying to move a window to the position of a previous windows that belongs to a different screenset.
  • Use DSMOVSZ-FUNCTION 'Qpa' with screenset1 to get the current window position in fields DSMOVESZ-X and DSMOVESZ-Y. Use this fields with screenset2 and DSMOVSZ-FUNCTION 'Mova' to set the position.
  • Hi,

    I will give this a try. However, I think I first need the following code:

    DSMOVSZ-PARAMETER-BLOCK 1
    DSMOVSZ-FUNCTION X 4.0
    DSMOVSZ-RETURN C 2.0
    DSMOVSZ-HANDLE-COUNT C 4.0
    DSMOVSZ-X S 4.0
    DSMOVSZ-Y S 4.0

    The help suggests that I import this data definition from the dsext.dsl object library but can I just simply type it in my data block definition or does it have to be imported from the object library?
  • Here is my code for the first screen set:

    Global Definition:

    SCREENSET-INITIALIZED
    MOVE "qpr" DSMOVSZ-FUNCTION(1)
    CALLOUT "dsmovsz" 0 DSMOVSZ-PARAMETER-BLOCK
    ESC
    RETC
    CLOSED-WINDOW
    SET-FLAG CLOSE-WINDOW-FLAG
    RETC

    Data Block Definition:

    CLOSE-WINDOW-FLAG 9 1.0
    CR-FLAG 9 1.0
    END-FLAG 9 1.0
    DSMOVSZ-PARAMETER-BLOCK 1
    DSMOVSZ-FUNCTION X 4.0
    DSMOVSZ-RETURN C 2.0
    DSMOVSZ-HANDLE-COUNT C 4.0
    DSMOVSZ-X S 4.0
    DSMOVSZ-Y S 4.0

    **********************************************************************
    Here is my code for the second screen set:

    Global definition:

    SCREENSET-INITIALIZED
    SET-COLOR D-LOGON-SIGN-ON "BLACK" "WHITE"
    SET-FOCUS D-LOGON-SIGN-ON
    MOVE "mova" DSMOVSZ-FUNCTION(1)
    CALLOUT "dsmovsz" 0 DSMOVSZ-PARAMETER-BLOCK
    ESC
    RETC
    CLOSED-WINDOW
    SET-FLAG CLOSE-WINDOW-FLAG
    RETC

    Data Block definition:


    CLOSE-WINDOW-FLAG 9 1.0
    END-FLAG 9 1.0
    CR-FLAG 9 1.0
    *****dsmovesz definition*******************
    DSMOVSZ-PARAMETER-BLOCK 1
    DSMOVSZ-FUNCTION X 4.0
    DSMOVSZ-RETURN C 2.0
    DSMOVSZ-HANDLE-COUNT C 4.0
    DSMOVSZ-X S 4.0
    DSMOVSZ-Y S 4.0





    Is this correct?
  • This problem has been resolved. Thanks for the input.