Page 1 of 1

[Implemented] Commands for true window sizes

Posted: Sat Dec 22, 2012 3:00 pm
by MachineCode
Now that 5.10 is a wishes granted release, how about two commands that return the real physical width and height of our windows (that take border sizes into account), instead of WindowWidth() and WindowHeight() that just return the inner client dimensions? Using these commands we can't position our windows to the edge of the screen, or on top of the taskbar, without further calculations. Surely this is such a straightforward thing to add to the language. ;)

[Edit] Actually, make WindowWidth() and WindowHeight() return the true sizes, and have two new commands called InnerWindowWidth() and InnerWindowHeight(). ;)

Re: Commands for true window sizes

Posted: Sat Dec 22, 2012 3:24 pm
by Tenaja
I second this wish.

(But Fred is unlikely to change the existing commands due to backwards compatibility issues....I'm fine with new commands OuterWindowWidth() etc.)

Re: Commands for true window sizes

Posted: Sat Dec 22, 2012 3:36 pm
by MachineCode
Yes it would break, but only until a quick search/replace in done in your sources. Not that big of a problem.

Re: Commands for true window sizes

Posted: Sat Dec 22, 2012 5:25 pm
by netmaestro
[ ]...instead of WindowWidth() and WindowHeight() that just return the inner client dimensions?
Sorry, I'm confused. Why isn't this ok:

Code: Select all

; PB 5.10 code:
OpenWindow(0,0,0,640,480,"", #PB_Window_Screencentered | #PB_Window_Systemmenu)
Debug "Inner width:  " + WindowWidth (0, #PB_Window_Innercoordinate)
Debug "Inner height: " + WindowHeight(0, #PB_Window_Innercoordinate)
Debug "Outer width:  " + WindowWidth (0, #PB_Window_Framecoordinate)
Debug "Outer height: " + WindowHeight(0, #PB_Window_Framecoordinate)
CloseWindow(0)
End

Re: Commands for true window sizes

Posted: Sat Dec 22, 2012 7:03 pm
by DoctorLove
netmaestro wrote:
[ ]...instead of WindowWidth() and WindowHeight() that just return the inner client dimensions?
Sorry, I'm confused. Why isn't this ok:

Code: Select all

; PB 5.10 code:
OpenWindow(0,0,0,640,480,"", #PB_Window_Screencentered | #PB_Window_Systemmenu)
Debug "Inner width:  " + WindowWidth (0, #PB_Window_Innercoordinate)
Debug "Inner height: " + WindowHeight(0, #PB_Window_Innercoordinate)
Debug "Outer width:  " + WindowWidth (0, #PB_Window_Framecoordinate)
Debug "Outer height: " + WindowHeight(0, #PB_Window_Framecoordinate)
CloseWindow(0)
End
Netmaestro,
I get strange results on your code example.
All the debug values are 14 here on my win8 64 bits laptop.
Can anybody else confirm?

Re: Commands for true window sizes

Posted: Sun Dec 23, 2012 3:02 am
by MachineCode
I didn't notice the #PB_Window_Framecoordinate flag before. Does what I asked. Nice! Thanks Fred + Netmaestro. :)

Re: Commands for true window sizes

Posted: Sun Dec 23, 2012 3:09 am
by netmaestro
It may be already stylized as such, I dunno as my IDE isn't changing case for constants for some reason. What's posted in my code is just what I typed.