diff --git a/widget/src/windows/nsWindow.cpp b/widget/src/windows/nsWindow.cpp index 6ce98a058126..5f4551ec424b 100644 --- a/widget/src/windows/nsWindow.cpp +++ b/widget/src/windows/nsWindow.cpp @@ -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(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. diff --git a/widget/src/windows/nsWindow.h b/widget/src/windows/nsWindow.h index 2ce5fa19848a..95b5ca8c45b6 100644 --- a/widget/src/windows/nsWindow.h +++ b/widget/src/windows/nsWindow.h @@ -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);