MaxGUI Questions

BlitzMax Forums/BlitzMax Beginners Area/MaxGUI Questions

Matt McFarland(Posted 2006) [#1]
How do I put a window up in the center of a screen? How do I have the computer figure out if it needs to put in a scroll bar if something wont fit in the window? How do I add a splitter? How do I add a canvas that will always be the same size as the window (but would fit in good)


Beaker(Posted 2006) [#2]
1) Use GadgetWidth(Desktop()) and GadgetHeight(Desktop()) to help you position the window.
2) No.
3) Check out the splitter code in the MaxIDE sourcecode.

4) You will need to use SetGadgetShape() on your canvas when the window is resized.
---The WINDOW_CLIENTCOORDS flag of CreateWindow() might be of interest.
---ClientHeight() and ClientWidth() will help.


Matt McFarland(Posted 2006) [#3]
Thanks Beaker, that was quite helpful..

So if I created a paint program, I wouldnt be able to add scroll bars if someone zoomed in? I guess I could activate / deactivate them depending on whats going on. (not making a paint program anyway lol)

-Matt


Beaker(Posted 2006) [#4]
Sorry, I misread your 2nd question.

A window automatically creates scrollbars when needed. You can add your own to panels and stuff tho if you want.


Matt McFarland(Posted 2006) [#5]
I really wish there was something like a VERY VERY simple grid map editor for this.. something that would tend to a field that is larger than the window that you coudl scroll through because I can't figure this out.


Matt McFarland(Posted 2006) [#6]
I mean like VERY simple.. like.. not even a tileset or anything.. just like how do you map an array in the canvas and know where you're at, and move along the map? Is it like in set origin or soemthing? Scrolling through an image didnt really teach me this, because we'd be scrolling through an array or a type list.. I'm really lost here.. could someone explain how this could be done? I'm suffering at the logic part, because I cant see how you put an object inside the canvas that isnt visible because your too far to the right and you have to move the scroll bar to the left to see it or something..