Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- FreshWin (c) Fresh Technologies - <b>wmove() window function</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
  WMOVE()                                                    Window Function
 Purpose..: Move a window around the screen
-------------------------------------------------------------------------------
 Syntax...: wMove( [<uWin>], [<nRow>[, <nCol>]]) --> NIL

 Arguments: [<uWin>] = the string identifier of the window
                       OR the reference to the window structure
                       returned as an array by wNew() or wArray().
                       If not passed, the function will operate on
                       the window in focus.

                       If the window sent is hidden, it is first
                       promoted to the top of the display. If the window
                       has been previously iconized ( MINIMIZED ), the
                       icon is moved around.

            [<nRow>] = the absolute row to which to move the window.
                       Because there is no default row number, leaving
                       out the row (and column) number will allow you
                       to move the window around the screen.

            [<nCol>] = the absolute column to which to move the window.
                       Because there is no default column number, leaving
                       out the column (and row) number will allow you
                       to move the window around the screen.

 Returns..: NIL

 Remark...: wMove(), used with neither the row or column parameters,
            moves a window around the screen using any of the
            four arrow keys or the mouse, if the proper
            window definition choice is made when using wNew(). If you
            use a mouse, place the cursor on the top edge of the
            window, click the mouse button and move it to the desired
            location. Release the button to stop. The window will move to
            the edges of the screen. To complete the move, press Enter.
            If the window is re-opened later, it will open where it was
            closed. Anything on display in the window will move with it.
            If GETs are read with READ MOUSE IN WINDOW,
            if MENU..TO IN WINDOW is used or wAttach() with
            a TBrowse object, these items will move as well.

            When moving a window, the window will be highlighted by
            the character ".", a dot, to let the user know that they are
            in MOVING mode. Of course, if it is the window icon to
            be moved, no re-framing is done.

            If you put in the row and column parameters, wMove() will
            move the window to those co-ordinates. They represent the
            upper left corner position of the window. The function can
            be used on either an open window (in which case it will move)
            or an unopened one (the window corners will be changed and,
            when opened, it will be displayed at the new location).

            As stated above, the function can be used with a mouse.
            The mouse cursor must be positioned on the top line
            of the window. The window can then be dragged by the mouse.

 Source...: WMOVE.PRG
-------------------------------------------------------------------------------
 Example..: . The example moves the window, which has the
              upper left corner at 12, 43, to place that
              corner at row 4 and column 21.

            wNew     ( "SunUp", 12, 43, 21, 76, cSUNUP_1, WS_CUA )
            wTitle   ( "SunUp", " Sun Box ", "W+/B" )
            wFrame   ( "SunUp", B_THICK, "GR+/B" )
            wHowOpen ( "SunUp", B_EXPLODEDN( 60 ) )
            wHowClose( "SunUp", B_IMPLODEUP( 60 ) )
            wShadow  ( "SunUp", B_SHADOW() )
            ...
            wMove( "SunUp", 4, 21 )

            . The example uses wMove() in conjunction with
              others to move the window to half its' width left and down
              if F8 is pressed.

            wOpen( "Next" )
            ...
            if lastkey() == K_F8
               wMove( "Next" )
               keyboard replicate( chr(K_LEFT), wWidth( "Next" ) / 2)
               keyboard replicate( chr(K_DOWN), wWidth( "Next" ) / 2)
            endif

See Also: wReSize() wShift() wZoom()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson