VX-REXX Window Move event 
Author Message
 VX-REXX Window Move event

On April 23, Kent said:

Quote:
> In VX-REXX, is there a way to know when a window
> has been moved?  I get events for a Resize, but this
> doesn't happen when I simply move the window (not that
> it should, I was just hoping it might, but it doesn't).

> Kent Anderson
> Brigham Young University


I couldn't find one either, but try this.

1) In your project's Init section, add two lines to get the main
    window's Top and Left coordinates. (My test program uses
    Window1 as the main window).

    Init:
       . . . your init statements . . .

        winleftold = VRGet( "Window1", "Left" )
        wintopold = VRGet( "Window1", "Top" )

    return

2) Create a Timer object (lets call it TM_Move) and set
    its Delay property to 100 (100 milliseconds = .1 sec).

3) Add the following code to the Trigger event for your
    timer (TM_Move in my case).  

   TM_Move_Trigger:

       wintop = VRGet( "Window1", "Top" )  /* new coordinates */
       winleft = VRGet( "Window1", "left" )  /* new coordinates */

       if (wintop \= wintopold)|(winleft \= winleftold) then do

           /* set old values to the new ones for later comparison */

           wintopold = wintop
           winleftold = winleft

           /* I put a message dialogue up to tell me the window moved */
           /* but you should add your own event code below */

           id = VRMessage( VRWindow(), "Has moved", "", "None", , ,  )

       end /* if */

   return

4) The Trigger event will only occur if you Enable the Timer object,
    so if you want it to start checking right away, Enable the Timer
    in the Properties Notebook in design mode.  Otherwise, you could
    use VRSet to Enable the Timer when you want to start checking
    for movement.

Hope this helps.

John Norman



Mon, 26 Oct 1998 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Making 2 listboxes move in synch ? VX-REXX

2. VX-REXX spinning on event?

3. VX-REXX problem (change event on an MLE)

4. VX-REXX MLE change event timing problem

5. VX-REXX: LostFocus Event clarification?

6. events in VX-REXX

7. VX-REXX Resize Window and All Objects

8. Converting VxREXX to Object REXX for Windows NT

9. Converting VxREXX to Object REXX for Windows NT

10. Perplexing problem interrupting VX-Rexx secondary window

11. VX-Rexx to Windows 95 ??

12. VX-REXX - Help with Window resizing?

 

 
Powered by phpBB® Forum Software