[Edit] Actually, make WindowWidth() and WindowHeight() return the true sizes, and have two new commands called InnerWindowWidth() and InnerWindowHeight().
[Implemented] Commands for true window sizes
-
MachineCode
- Addict

- Posts: 1482
- Joined: Tue Feb 22, 2011 1:16 pm
[Implemented] Commands for true window sizes
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().
[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!
PureBasic: Born in 1998 and still going strong to this very day!
Re: Commands for true window sizes
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.)
(But Fred is unlikely to change the existing commands due to backwards compatibility issues....I'm fine with new commands OuterWindowWidth() etc.)
-
MachineCode
- Addict

- Posts: 1482
- Joined: Tue Feb 22, 2011 1:16 pm
Re: Commands for true window sizes
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!
PureBasic: Born in 1998 and still going strong to this very day!
- netmaestro
- PureBasic Bullfrog

- Posts: 8452
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
Re: Commands for true window sizes
Sorry, I'm confused. Why isn't this ok:[ ]...instead of WindowWidth() and WindowHeight() that just return the inner client dimensions?
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

- Posts: 85
- Joined: Sat Mar 06, 2010 2:55 pm
Re: Commands for true window sizes
Netmaestro,netmaestro wrote:Sorry, I'm confused. Why isn't this ok:[ ]...instead of WindowWidth() and WindowHeight() that just return the inner client dimensions?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
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

- Posts: 1482
- Joined: Tue Feb 22, 2011 1:16 pm
Re: Commands for true window sizes
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!
PureBasic: Born in 1998 and still going strong to this very day!
- netmaestro
- PureBasic Bullfrog

- Posts: 8452
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
Re: Commands for true window sizes
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