I had a lot of people coming to me with that same problem a while back, and it had happened to me enough times for me to be done with the problem.
So I coded this up. I put it in a button inside of the ExamineItem page called CheckLocation, and it gets activated OnShow. If you wanna put it directly in OnShow just remove a Parent. from each line. Feel free to use/mess with it:
Code:
gHeight=Parent.Parent.Height
gWidth=Parent.Parent.Width
iTop=Parent.Top
iBottom=(iTop + Parent.Height)
iLeft=Parent.Left
iRight=(iLeft + Parent.Width)
iNewTop=(gHeight - Parent.Height)
iNewTop=(iNewTop / 2)
iNewTop=int(iNewTop)
iNewTopPos=(iNewTop > 0)
iNewTop=(iNewTopPos ? iNewTop : 1)
bCheckTop=(iTop < 0)
bCheckBottom=(iBottom > gHeight)
bCheckVertical=(bCheckTop || bCheckBottom)
Parent.Top=(bCheckVertical ? iNewTop : iTop)
iNewLeft=(gWidth - Parent.Width)
iNewLeft=(iNewLeft / 2)
iNewLeft=int(iNewLeft)
iNewLeftPos=(iNewLeft > 0)
iNewLeft=(iNewLeftPos ? iNewLeft : 1)
bCheckLeft=(iLeft < 0)
bCheckRight=(iRight > gWidth)
bCheckHorizontal=(bCheckLeft || bCheckRight)
Parent.Left=(bCheckHorizontal ? iNewLeft : iLeft)
gHeight/gWidth gets the game window dimensions via the UI. It then basically checks if the any part of the examine window is off screen. if it is it will center it vertically/horizontally. It's worked really well!
Cheers.