Got an idea for enhancing PureBasic? New command(s) you'd like to see?
MachineCode
Addict
Posts: 1482 Joined: Tue Feb 22, 2011 1:16 pm
Post
by MachineCode » Sat Dec 22, 2012 3:00 pm
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!
Tenaja
Addict
Posts: 1959 Joined: Tue Nov 09, 2010 10:15 pm
Post
by Tenaja » Sat Dec 22, 2012 3:24 pm
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
Posts: 1482 Joined: Tue Feb 22, 2011 1:16 pm
Post
by MachineCode » Sat Dec 22, 2012 3:36 pm
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!
netmaestro
PureBasic Bullfrog
Posts: 8451 Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada
Post
by netmaestro » Sat Dec 22, 2012 5:25 pm
[ ]...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
Posts: 85 Joined: Sat Mar 06, 2010 2:55 pm
Post
by DoctorLove » Sat Dec 22, 2012 7:03 pm
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
Posts: 1482 Joined: Tue Feb 22, 2011 1:16 pm
Post
by MachineCode » Sun Dec 23, 2012 3:02 am
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!
netmaestro
PureBasic Bullfrog
Posts: 8451 Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada
Post
by netmaestro » Sun Dec 23, 2012 3:09 am
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