Pop Panel On Smaller screen Size - VLFOne

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
dhunt
Posts: 60
Joined: Fri Feb 08, 2019 3:06 am

Pop Panel On Smaller screen Size - VLFOne

Post by dhunt » Tue Jan 12, 2021 4:33 am

I have several Pop up Panels that push up above the browser but only on screens smaller than 1920x1080. I also have some that don't do this and it has the same code. If I hit F11 to make it full screen I see it fine and then get out of full screen it is fixed until I need the popup again.

This is how I get it to center on the screen instead of placement center. I can not use the placement center function.

Code: Select all

* Fields to calculate middle of screen
Define Field(#screenWidth) Type(*INT)
Define Field(#screenHeight) Type(*INT)
Define Field(#com_width) Type(*INT)
Define Field(#com_heigtht) Type(*INT)

* calculate where the middle of the screen is
#screenWidth := #SYS_WEB.WebPage.Width
#screenHeight := #SYS_WEB.WebPage.Height
#com_width := #COM_OWNER.Width
#com_heigtht := #COM_OWNER.Height

#COM_ANCESTOR.ShowPopup Left((#screenWidth - #com_width) / 2) Top((#screenHeight - #com_heigtht) / 2)
Untitled6.png
Untitled6.png (11.56 KiB) Viewed 63 times
Should look like this...
Untitled7.png
Untitled7.png (6.13 KiB) Viewed 63 times

MarkD
Posts: 683
Joined: Wed Dec 02, 2015 9:56 am

Re: Pop Panel On Smaller screen Size - VLFOne

Post by MarkD » Thu Jan 14, 2021 11:47 am

Have you tried tracing out the computed Top and Left values to see if they are within the web pages viewing area?
e.g. Negative values are acceptable and would probably make the pop up effectively invisible as it is out of the browser's viewing area.

dhunt
Posts: 60
Joined: Fri Feb 08, 2019 3:06 am

Re: Pop Panel On Smaller screen Size - VLFOne

Post by dhunt » Fri Jan 15, 2021 1:57 am

Mark,

Yes I did. It seems that the height of the popup was the issue. If it is less than 1920x1080, I have to shrink the height of the popup programmatically to 80% of the current screen size. The same issue occurs if the width of the popup is more than the screen size.

Post Reply