windows height value???

Just starting out? Need help? Post your questions and find answers here.
Cor
Enthusiast
Enthusiast
Posts: 124
Joined: Fri Apr 25, 2003 7:52 pm
Location: Netherlands
Contact:

windows height value???

Post by Cor »

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.
Cor de Visser

Registered PureBasic user

Author of ChordPlanet
Made with PureBasic
http://www.chordplanet.com
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Re: windows height value???

Post by PB »

> 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:

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.
Cor
Enthusiast
Enthusiast
Posts: 124
Joined: Fri Apr 25, 2003 7:52 pm
Location: Netherlands
Contact:

Post by Cor »

Thanks PB,

seems logical after explanation.
Cor de Visser

Registered PureBasic user

Author of ChordPlanet
Made with PureBasic
http://www.chordplanet.com
Post Reply