GadgetX() and GadgetY() with CLIENTCOORDS

BlitzMax Forums/BlitzMax Programming/GadgetX() and GadgetY() with CLIENTCOORDS

ImaginaryHuman(Posted 2006) [#1]
Let's say I have a window that I opened with WINDOW_CLIENTCOORDS. Then I added a canvas which covers the whole client area. Shouldn't calls to GadgetX(window) and GadgetY(window) return the topleft coordinates, relative to the screen edge, of the canvas, and not the window?

Otherwise, when you do this:


SetGadgetShape window,GadgetX(window),GadgetY(window),CanvasWidth(window),CanvasHeight(window)


the window jumps `up` by the height of the title bar. The above code should not move the window or change its size at all. But GadgetX() and GadgetY() are returning the top left corner of the window border itself, not the gadget, yet trying to set the window's shape with SetGadgetShape() is taking into account that you asked for CLIENTCOORDS and is thus pushing the titlebar outside of what it thinks is the client area.

??????

Or is there some other way that I can a) read the window position and b) use that position in SetGadgetShape so that the top left of the window doesn't actually move? Does it mean I have to take out WINDOW_CLIENTCOORDS and try working based on ClientWidth(window) and ClientHeight(window) to get the size of the canvas, rather than being able to specify the exact canvas size?

Here is the original program in question - the SetGadgetShape() in the MOUSEMOVE event is where the problem is.



ImaginaryHuman(Posted 2006) [#2]
Bump