implement GetScreenBounds, which wasn't, oddly. this should fix placement of top-level windows which, equally oddly, seemed unbroken except in one very esoteric circumstance. bug 233081 r=ere,roc

This commit is contained in:
danm-moz%comcast.net 2004-03-03 16:42:51 +00:00
Родитель 3932d23ede
Коммит a5ef79e0d6
2 изменённых файлов: 18 добавлений и 1 удалений

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

@ -2282,7 +2282,23 @@ void nsWindow::GetNonClientBounds(nsRect &aRect)
}
}
// like GetBounds, but don't offset by the parent
NS_METHOD nsWindow::GetScreenBounds(nsRect &aRect)
{
if (mWnd) {
RECT r;
VERIFY(::GetWindowRect(mWnd, &r));
aRect.width = r.right - r.left;
aRect.height = r.bottom - r.top;
aRect.x = r.left;
aRect.y = r.top;
} else
aRect = mBounds;
return NS_OK;
}
//-------------------------------------------------------------------------
//
// Set the background color

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

@ -336,6 +336,7 @@ public:
NS_IMETHOD SetFocus(PRBool aRaise);
NS_IMETHOD GetBounds(nsRect &aRect);
NS_IMETHOD GetClientBounds(nsRect &aRect);
NS_IMETHOD GetScreenBounds(nsRect &aRect);
NS_IMETHOD SetBackgroundColor(const nscolor &aColor);
virtual nsIFontMetrics* GetFont(void);
NS_IMETHOD SetFont(const nsFont &aFont);