I have created a simple layout with a top window and button on it. The window size is 335, 250 yet when I run the getsize it comes up with 358, 288, and then I have a button on the window the size is 200, 175, yet when I run the get size on it it shows 214, 173.
Why is their a difference? How do I get the actual size of the item? Is this a bug, or am I missing something here?
I have attached the file with the everything in it so you can see.
dolik.rce Messages: 1789 Registered: August 2008 Location: Czech Republic
Ultimate Contributor
Hi silverx,
The cause lies in the concept of "zooming". It is intended to make things look the same on systems with various settings. The layout designer internally uses the "Z" functions (e.g. LeftPosZ() etc.). If you invoked the same code yourself, using e.g. LeftPos(), you would achieve the values you expected. Read the detailed explanation in this article: http://www.ultimatepp.org/srcdoc$CtrlCore$LogPos$en-us.html