Page 1 of 1

Pop Panel On Smaller screen Size - VLFOne

Posted: Tue Jan 12, 2021 4:33 am
by dhunt
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 (11.56 KiB) Viewed 64 times
Should look like this...
Untitled7.png (6.13 KiB) Viewed 64 times

Re: Pop Panel On Smaller screen Size - VLFOne

Posted: Thu Jan 14, 2021 11:47 am
by MarkD
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.

Re: Pop Panel On Smaller screen Size - VLFOne

Posted: Fri Jan 15, 2021 1:57 am
by dhunt

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.