SetGadgetShape - client or gadget coords?

BlitzMax Forums/BlitzMax Programming/SetGadgetShape - client or gadget coords?

Fabian.(Posted 2006) [#1]
Are the parameters for the SetGadgetShape function discribing the gadget rect or the client rect?
I tried it out and it seems like its depending on how the window was created.
In this example the parameters for SetGadgetShape are client coords:
Strict

Local Window:TGadget = CreateWindow ( "" , 0 , 0 , 0 , 0 , Desktop ( ) , WINDOW_TITLEBAR | WINDOW_CLIENTCOORDS )
SetGadgetShape Window , 300 , 300 , 300 , 300
While True
  WaitEvent
Wend
And here they're gadget coords:
Strict

Local Window:TGadget = CreateWindow ( "" , 0 , 0 , 0 , 0 , Desktop ( ) , WINDOW_TITLEBAR )
SetGadgetShape Window , 300 , 300 , 300 , 300
While True
  WaitEvent
Wend
Isn't this a bug?
I think they should always be gadget coords whatever the window was created.
If anyone wants to set them as client coords there should be a function like SetClientShape.

How do you think?


Dreamora(Posted 2006) [#2]
I think this is the correct behavior because thats what WINDOW_CLIENTCOORDS flag is for according the description.


taxlerendiosk(Posted 2006) [#3]
SetMinWindowSize is always in gadget coords though, surely that's a bug?


Fabian.(Posted 2006) [#4]
I mean GadgetWidth, GadgetHeight, GadgetX and GadgetY always work with gadget coords while ClientWidth and ClientHeight always work with client coords. So I'd think the best way to be able to do both, set client shape and gadget shape is to have two functions, SetGadgetShape to set the gadget shape and SetClientShape to set the client shape.

But when SetGadgetShape works like it is now sometimes with client coords and sometimes with gadget coords, how else can I set the gadget shape?


Dreamora(Posted 2006) [#5]
It allways works the same way which you define yourself with the creation of the parent window ...


Fabian.(Posted 2006) [#6]
So, there's no opposite to GadgetWidth, GadgetHeight, GadgetX and GadgetY?

And:
Shouldn't the documentation be updated?
Now it is:
Constant            | Meaning
--------------------|--------------------------
WINDOW_CLIENTCOORDS | The dimensions specified
                    | relate to the client area
                    | not the window frame
This sounds like only the dimensions specified are client coords, but not like also dimensions which will later be specified are client coords.

And:
Does anyone know how to set a gadget's shape(, not the client shape)?