Reverting changeset 51b055be91bb (185533's main checkin) due to test_resizer.xul orange

This commit is contained in:
Daniel Holbert 2009-09-25 18:46:15 -07:00
Родитель eebaf690db
Коммит 996e66688f
2 изменённых файлов: 1 добавлений и 60 удалений

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

@ -1217,8 +1217,7 @@ void nsWindow::SetThemeRegion()
/**************************************************************
*
* SECTION: nsIWidget::Move, nsIWidget::Resize,
* nsIWidget::Size, nsIWidget::BeginResizeDrag
* SECTION: nsIWidget::Move, nsIWidget::Resize, nsIWidget::Size
*
* Repositioning and sizing a window.
*
@ -1342,63 +1341,6 @@ NS_METHOD nsWindow::Resize(PRInt32 aX, PRInt32 aY, PRInt32 aWidth, PRInt32 aHeig
return NS_OK;
}
NS_IMETHODIMP
nsWindow::BeginResizeDrag(nsGUIEvent* aEvent, PRInt32 aHorizontal, PRInt32 aVertical)
{
NS_ENSURE_ARG_POINTER(aEvent);
if (aEvent->eventStructType != NS_MOUSE_EVENT) {
// you can only begin a resize drag with a mouse event
return NS_ERROR_INVALID_ARG;
}
nsMouseEvent* mouseEvent = static_cast<nsMouseEvent*>(aEvent);
if (mouseEvent->button != nsMouseEvent::eLeftButton) {
// you can only begin a resize drag with the left mouse button
return NS_ERROR_INVALID_ARG;
}
// work out what sizemode we're talking about
WPARAM syscommand;
if (aVertical < 0) {
if (aHorizontal < 0) {
syscommand = SC_SIZE | WMSZ_TOPLEFT;
} else if (aHorizontal == 0) {
syscommand = SC_SIZE | WMSZ_TOP;
} else {
syscommand = SC_SIZE | WMSZ_TOPRIGHT;
}
} else if (aVertical == 0) {
if (aHorizontal < 0) {
syscommand = SC_SIZE | WMSZ_LEFT;
} else if (aHorizontal == 0) {
return NS_ERROR_INVALID_ARG;
} else {
syscommand = SC_SIZE | WMSZ_RIGHT;
}
} else {
if (aHorizontal < 0) {
syscommand = SC_SIZE | WMSZ_BOTTOMLEFT;
} else if (aHorizontal == 0) {
syscommand = SC_SIZE | WMSZ_BOTTOM;
} else {
syscommand = SC_SIZE | WMSZ_BOTTOMRIGHT;
}
}
// resizing doesn't work if the mouse is already captured
CaptureMouse(PR_FALSE);
// find the top-level window
HWND toplevelWnd = GetTopLevelHWND(mWnd, PR_TRUE);
// tell Windows to start the resize
::PostMessage(toplevelWnd, WM_SYSCOMMAND, syscommand,
POINTTOPOINTS(aEvent->refPoint));
return NS_OK;
}
/**************************************************************
*
* SECTION: Window Z-order and state.

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

@ -150,7 +150,6 @@ public:
NS_IMETHOD GetAttention(PRInt32 aCycleCount);
virtual PRBool HasPendingInputEvent();
gfxASurface *GetThebesSurface();
NS_IMETHOD BeginResizeDrag(nsGUIEvent* aEvent, PRInt32 aHorizontal, PRInt32 aVertical);
NS_IMETHOD OnDefaultButtonLoaded(const nsIntRect &aButtonRect);
NS_IMETHOD OverrideSystemMouseScrollSpeed(PRInt32 aOriginalDelta, PRBool aIsHorizontal, PRInt32 &aOverriddenDelta);