|
Post by Mark Dunham on Feb 7, 2020 9:06:58 GMT -5
I have used the window position code below for years and years. When I use this format in testing my screen position is way off have these variables changed for LB5?
UpperLeftX = int((DisplayWidth - WindowWidth) / 2) UpperLeftY = int((DisplayHeight - WindowHeight) / 2)
|
|
|
Post by David Drake on Feb 7, 2020 10:06:56 GMT -5
Your code ran fine for me in LB5.
|
|
|
Post by Mark Dunham on Feb 7, 2020 10:27:39 GMT -5
Your code ran fine for me in LB5. What operating system are you running? I am running this on Windows 10.
|
|
|
Post by Chris Iverson on Feb 7, 2020 12:34:32 GMT -5
It works for me, as well, running Windows 10 on a Surface Pro 4.
|
|
|
Post by Mark Dunham on Feb 7, 2020 13:08:20 GMT -5
It works for me, as well, running Windows 10 on a Surface Pro 4. So weird this is a windows 10 OptiPlex5060. I even tried one of my older simple programs and it is not centered as well. I will have to try this on my surface later. I am running dual screens I wonder if that could be part of the issue. I find it odd. Thanks for the feedback.
|
|
|
Post by Chris Iverson on Feb 7, 2020 13:44:04 GMT -5
I am running dual screens I wonder if that could be part of the issue. Bingo. Tried it on another system that has more than one screen, and it got positioned weird. DisplayWidth and DisplayHeight are getting filled in my the entire desktop size, not the size of the monitor the window is currently on(or the size of the primary monitor, I forgot which one LB4 retrieves). On the other system I tried, I have two monitors positioned side-by-side, a 1440x900 and a 1366x768. DisplayWidth x DisplayHeight gets set to 2806x900.
|
|
|
Post by Mark Dunham on Feb 7, 2020 13:49:15 GMT -5
I am running dual screens I wonder if that could be part of the issue. Bingo. Tried it on another system that has more than one screen, and it got positioned weird. DisplayWidth and DisplayHeight are getting filled in my the entire desktop size, not the size of the monitor the window is currently on(or the size of the primary monitor, I forgot which one LB4 retrieves). On the other system I tried, I have two monitors positioned side-by-side, a 1440x900 and a 1366x768. DisplayWidth x DisplayHeight gets set to 2806x900. Glad to know exactly what it is. Wonder if Microsoft changed those variables on the back end for windows 10. They did an update from XP to windows 7 which required us to update our transfer manager at the company I work for so our software would still transfer configurations out to control units.
|
|
|
Post by Chris Iverson on Feb 7, 2020 14:26:44 GMT -5
No, if that had been a change that was made by Microsoft, it would've broken LB4 as well.
This is something being done incorrectly by the new Smalltalk runtime engine.
|
|
|
Post by Mark Dunham on Feb 7, 2020 14:36:48 GMT -5
No, if that had been a change that was made by Microsoft, it would've broken LB4 as well. This is something being done incorrectly by the new Smalltalk runtime engine. Oh yeah it works in LB4 duh lol. I have way too many things on my mind makes perfect sense as soon as you said it. Glad it was found and can be corrected I am really excited for LB5 and cannot wait for another Alpha release. Thanks Chris.
|
|
|
Post by Carl Gundel on Feb 7, 2020 16:21:23 GMT -5
No, if that had been a change that was made by Microsoft, it would've broken LB4 as well. This is something being done incorrectly by the new Smalltalk runtime engine. Yeah, it's trying to make one big screen out of the two. It probably won't be too hard to fix.
|
|
|
Post by Mark Dunham on Feb 7, 2020 16:29:57 GMT -5
No, if that had been a change that was made by Microsoft, it would've broken LB4 as well. This is something being done incorrectly by the new Smalltalk runtime engine. Yeah, it's trying to make one big screen out of the two. It probably won't be too hard to fix. Awesome, thank you Carl.
|
|
|
Post by David Drake on Feb 10, 2020 11:40:59 GMT -5
Your code ran fine for me in LB5. What operating system are you running? I am running this on Windows 10.
Windows 10
|
|