[Implemented] Commands for true window sizes

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
MachineCode
Addict
Addict
Posts: 1482
Joined: Tue Feb 22, 2011 1:16 pm

[Implemented] Commands for true window sizes

Post 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(). ;)
Microsoft Visual Basic only lasted 7 short years: 1991 to 1998.
PureBasic: Born in 1998 and still going strong to this very day!
User avatar
Tenaja
Addict
Addict
Posts: 1959
Joined: Tue Nov 09, 2010 10:15 pm

Re: Commands for true window sizes

Post 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.)
MachineCode
Addict
Addict
Posts: 1482
Joined: Tue Feb 22, 2011 1:16 pm

Re: Commands for true window sizes

Post by MachineCode »

Yes it would break, but only until a quick search/replace in done in your sources. Not that big of a problem.
Microsoft Visual Basic only lasted 7 short years: 1991 to 1998.
PureBasic: Born in 1998 and still going strong to this very day!
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8451
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Re: Commands for true window sizes

Post 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
BERESHEIT
DoctorLove
User
User
Posts: 85
Joined: Sat Mar 06, 2010 2:55 pm

Re: Commands for true window sizes

Post 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?
MachineCode
Addict
Addict
Posts: 1482
Joined: Tue Feb 22, 2011 1:16 pm

Re: Commands for true window sizes

Post by MachineCode »

I didn't notice the #PB_Window_Framecoordinate flag before. Does what I asked. Nice! Thanks Fred + Netmaestro. :)
Microsoft Visual Basic only lasted 7 short years: 1991 to 1998.
PureBasic: Born in 1998 and still going strong to this very day!
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8451
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Re: Commands for true window sizes

Post 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.
BERESHEIT
Post Reply