Page 1 of 1

windows height value???

Posted: Sat May 31, 2003 5:12 pm
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.

Re: windows height value???

Posted: Sat May 31, 2003 5:32 pm
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 |       |   /
+----------------+  /

Posted: Sat May 31, 2003 5:40 pm
by Cor
Thanks PB,

seems logical after explanation.