Move two windows (MaxGui)

BlitzMax Forums/BlitzMax Beginners Area/Move two windows (MaxGui)

wedoe(Posted 2006) [#1]
Is it possible to move a hidden window so it follows
the parent window and appears at the same place above
the parent each time ?


ImaginaryHuman(Posted 2006) [#2]
Use an event hook to trap the WINDOWMOVE event and when the window moves, use SetGadgetShape() to move the hidden window to the other window's location. But you will have to go without CLIENTCOORDS in your window definition because GadgetX() and GadgetY() on the window object will return the top left of the window title bar itself, not the canvas, so setting the new window to those coords will make your second canvas align to the top left of the other window's title bar. At least, this is what I found.

Beyond that, you will also find that you can process normal events while a window is in the process of being moved. If you have TIMERTICK events they will trickle through to the event hook even while you're still holding down the mouse on the title bar. From the TIMERTICK you can update or move your other window every frame.


wedoe(Posted 2006) [#3]
Thanks a lot :o)


ImaginaryHuman(Posted 2006) [#4]
I meant to say you will have to go WITHOUT CLIENTCOORDS, I originally said with.

This proves that I go back and read my own posts. ;-)


wedoe(Posted 2006) [#5]
Haven't had time to test it yet so good you checked, thanks again :o)