new method MoveToGlobalPoint. part of bug 23395.

This commit is contained in:
danm%netscape.com 2000-01-08 04:28:29 +00:00
Родитель 0f83a227f0
Коммит a28fb84e28
2 изменённых файлов: 31 добавлений и 0 удалений

Просмотреть файл

@ -652,6 +652,35 @@ NS_IMETHODIMP nsMacWindow::Move(PRInt32 aX, PRInt32 aY)
return NS_OK;
}
//-------------------------------------------------------------------------
//
// Resize this window to a point given in global (screen) coordinates. This
// differs from simple Move(): that method makes JavaScript place windows
// like other browsers: it puts the top-left corner of the outer edge of the
// window border at the given coordinates, offset from the menubar.
// MoveToGlobalPoint expects the top-left corner of the portrect, which
// is inside the border, and is not offset by the menubar height.
//
//-------------------------------------------------------------------------
void nsMacWindow::MoveToGlobalPoint(PRInt32 aX, PRInt32 aY)
{
#if TARGET_CARBON
Rect screenRect;
::GetRegionBounds(::GetGrayRgn(), &screenRect);
#else
Rect screenRect = (**::GetGrayRgn()).rgnBBox;
#endif
if (mIsDialog) {
aX -= kDialogMarginWidth;
aY -= kDialogTitleBarHeight;
} else {
aX -= kWindowMarginWidth;
aY -= kWindowTitleBarHeight;
}
Move(aX - screenRect.left, aY - screenRect.top);
}
//-------------------------------------------------------------------------
//
// Resize this window

Просмотреть файл

@ -97,6 +97,8 @@ public:
NS_IMETHOD ResetInputState();
NS_IMETHOD PasswordFieldInit();
void MoveToGlobalPoint(PRInt32 aX, PRInt32 aY);
protected:
pascal static OSErr DragTrackingHandler ( DragTrackingMessage theMessage, WindowPtr theWindow,