Moving Business

BlitzMax Forums/BlitzMax Beginners Area/Moving Business

dw817(Posted 2016) [#1]
This should be a relatively easy question for you veterans to answer. I would like to be able to move a window, or as the case might be, a frame generated by Graphics().
Graphics 512,256
MoveGraphics 50,50
WaitKey
MoveGraphics 100,100
WaitKey
Is there an easy way to do this ? How would you do it ?


Chapman7(Posted 2016) [#2]
Not sure if this is what you are after...




Derron(Posted 2016) [#3]
There is "SetOrigin" if you want to offset all things drawn to your graphics context.


If you want to move the entire application window - maybe MaxGUI offers something "cross platform".


bye
Ron


dw817(Posted 2016) [#4]
Hi Chapman & Derron:

Thanks, but no. I want the entire frame to be moveable, for instance, in GFABasic it is

MoveW#(windno),x,y

Where X & Y coordinates re-position the display frame you have opened with 0,0 being the absolute top-left corner of your monitor.

Yeah, I was thinking MaxGUI earlier could handle this; trying to avoid that route. I can look there tho, good place to go.

Currently when you use Graphics() it always centers the frame despite its size. No way to shift it to any other location - with perhaps the exception of MaxGUI.


Chapman7(Posted 2016) [#5]
I would use MaxGUI. If your app is windows only you can use this http://www.blitzbasic.com/Community/posts.php?topic=66129


Nurgle(Posted 2016) [#6]
How about this!


dw817(Posted 2016) [#7]
Thanks Chapman and Nurgle. Nurgle, your sample code is perfect. Now I just need to set down to look at it proper.

Curiously SetWindowPos() is a command internal to BlitzMAX, not requiring any additional library or MOD loading. Yet, it does not appear in the standard command set.

In any case, well done - exactly the solution I was looking for !

Bonus, it appears you have created a nice and flawless borderless window - also without requiring usage of external MODs and achieved in no more than 4-lines of code.

Outstanding ! :D

Nurgle, do you have a website showing other BlitzMAX source codes you have done for other applications I might be able to learn from ?

And/or is there a unique HELP file for BlitzMAX that lists these 'non-listed' commands and functions ?


Henri(Posted 2016) [#8]
Hi,

those are Windows native functions and wont work in X systems.

-Henri


Brucey(Posted 2016) [#9]
SetWindowPos() is a Win32 API function.

Documentation for Win32 stuff like this, can be found here : https://msdn.microsoft.com/en-us/library/windows/desktop/ms633545(v=vs.85).aspx


dw817(Posted 2016) [#10]
Hi Henri & Brucey:

* I was wondering ! I have a comprehensive help file from GFA on all windows functions. Is one reason I chose it years ago.

So - apparently all functions here:

https://msdn.microsoft.com/en-us/library/windows/desktop/ff468925%28v=vs.85%29.aspx

Can be accessed in BlitzMAX ?

Nurgle, at line # 67 you have:

MouseXSpeed() ; MouseYSpeed() 'update window position

As these are used to retrieve values, are they doing anything here ? REMMING them out the program runs the same.


Nurgle(Posted 2016) [#11]
I not the author of the example Zeke is.


dw817(Posted 2016) [#12]
Oh, you're right, Nurgle. In any case, that's some pretty nifty code. I thank you for showing it to me. :)


Brucey(Posted 2016) [#13]
Can be accessed in BlitzMAX ?

Functions are exposed through the Pub.Win32 module, although the ones listed there don't actually cover the full set available in the Win32 APIs.