Question:
When I have the windows height value e.g. 300 with the openwindow and I check it with a screenruler the windows height = 326.
Thus windows height + height windows caption bar
I thought that the windows height of 300 pixels includes the height of the captionbar?
Can someone explain me what is correct, because other languages take the pixel of 300 including the caption height + windows height.
windows height value???
windows height value???
Cor de Visser
Registered PureBasic user
Author of ChordPlanet
Made with PureBasic
http://www.chordplanet.com
Registered PureBasic user
Author of ChordPlanet
Made with PureBasic
http://www.chordplanet.com
Re: windows height value???
> Can someone explain me what is correct
WindowID = OpenWindow(#Window, x, y, InnerWidth, InnerHeight, Flags, Title$)
The InnerWidth and InnerHeight parameters are what you want your actual
window's exact client size to be, without worrying about how big the
caption and border sizes are. So if you want 3 x ButtonGadgets to be
flush with the top and bottom of your window edges, and each of these
is 50 pixels high, you'd just set your InnerHeight to 150. Easy!
Otherwise, if you set your actual window size to 150, your bottom gadgets
would be cropped by the bottom of your window on Windows XP, due to its
larger caption size (or if the user has a strange theme installed with fancy
fonts and sizes for captions). See this crude diagram for an explanation:
WindowID = OpenWindow(#Window, x, y, InnerWidth, InnerHeight, Flags, Title$)
The InnerWidth and InnerHeight parameters are what you want your actual
window's exact client size to be, without worrying about how big the
caption and border sizes are. So if you want 3 x ButtonGadgets to be
flush with the top and bottom of your window edges, and each of these
is 50 pixels high, you'd just set your InnerHeight to 150. Easy!
Otherwise, if you set your actual window size to 150, your bottom gadgets
would be cropped by the bottom of your window on Windows XP, due to its
larger caption size (or if the user has a strange theme installed with fancy
fonts and sizes for captions). See this crude diagram for an explanation:
Code: Select all
PureBasic's method of window size.
Assume each gadget is 50 pixels high.
+----------------+
| Caption _[]X |
+----------------+
| +------+ | \
| | Gad1 | | \
| +------+ | |
| +------+ | |
| | Gad2 | | > InnerHeight = 150.
| +------+ | |
| +------+ | |
| | Gad3 | | /
| +------+ | /
+----------------+
Conventional method of window size.
Assume each gadget is 50 pixels high.
+----------------+ \
| Caption _[]X | \
+----------------+ |
| +------+ | |
| | Gad1 | | > Height = 150.
| +------+ | |
| +------+ | |
| | Gad2 | | /
+----------------+ /
Last edited by PB on Sat May 31, 2003 5:43 pm, edited 2 times in total.
Thanks PB,
seems logical after explanation.
seems logical after explanation.
Cor de Visser
Registered PureBasic user
Author of ChordPlanet
Made with PureBasic
http://www.chordplanet.com
Registered PureBasic user
Author of ChordPlanet
Made with PureBasic
http://www.chordplanet.com

