ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

LRESULT CALLBACK SizeboxWinProc ( HWND  hwnd,
UINT  message,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 20 of file sizebox.c.

Referenced by _tWinMain().

{
    switch (message)
    {
        case WM_SETCURSOR:
            if ((hwnd == hSizeboxLeftTop) || (hwnd == hSizeboxRightBottom))
                SetCursor(LoadCursor(NULL, IDC_SIZENWSE));
            if ((hwnd == hSizeboxLeftBottom) || (hwnd == hSizeboxRightTop))
                SetCursor(LoadCursor(NULL, IDC_SIZENESW));
            if ((hwnd == hSizeboxLeftCenter) || (hwnd == hSizeboxRightCenter))
                SetCursor(LoadCursor(NULL, IDC_SIZEWE));
            if ((hwnd == hSizeboxCenterTop) || (hwnd == hSizeboxCenterBottom))
                SetCursor(LoadCursor(NULL, IDC_SIZENS));
            break;
        case WM_LBUTTONDOWN:
            resizing = TRUE;
            xOrig = LOWORD(lParam);
            yOrig = HIWORD(lParam);
            SetCapture(hwnd);
            break;
        case WM_MOUSEMOVE:
            if (resizing)
            {
                TCHAR sizeStr[100];
                short xRel;
                short yRel;
                xRel = ((short)LOWORD(lParam) - xOrig) * 1000 / zoom;
                yRel = ((short)HIWORD(lParam) - yOrig) * 1000 / zoom;
                if (hwnd == hSizeboxLeftTop)
                    _stprintf(sizeStr, _T("%d x %d"), imgXRes - xRel, imgYRes - yRel);
                if (hwnd == hSizeboxCenterTop)
                    _stprintf(sizeStr, _T("%d x %d"), imgXRes, imgYRes - yRel);
                if (hwnd == hSizeboxRightTop)
                    _stprintf(sizeStr, _T("%d x %d"), imgXRes + xRel, imgYRes - yRel);
                if (hwnd == hSizeboxLeftCenter)
                    _stprintf(sizeStr, _T("%d x %d"), imgXRes - xRel, imgYRes);
                if (hwnd == hSizeboxRightCenter)
                    _stprintf(sizeStr, _T("%d x %d"), imgXRes + xRel, imgYRes);
                if (hwnd == hSizeboxLeftBottom)
                    _stprintf(sizeStr, _T("%d x %d"), imgXRes - xRel, imgYRes + yRel);
                if (hwnd == hSizeboxCenterBottom)
                    _stprintf(sizeStr, _T("%d x %d"), imgXRes, imgYRes + yRel);
                if (hwnd == hSizeboxRightBottom)
                    _stprintf(sizeStr, _T("%d x %d"), imgXRes + xRel, imgYRes + yRel);
                SendMessage(hStatusBar, SB_SETTEXT, 2, (LPARAM) sizeStr);
            }
            break;
        case WM_LBUTTONUP:
            if (resizing)
            {
                short xRel;
                short yRel;
                ReleaseCapture();
                resizing = FALSE;
                xRel = ((short)LOWORD(lParam) - xOrig) * 1000 / zoom;
                yRel = ((short)HIWORD(lParam) - yOrig) * 1000 / zoom;
                if (hwnd == hSizeboxLeftTop)
                    cropReversible(imgXRes - xRel, imgYRes - yRel, xRel, yRel);
                if (hwnd == hSizeboxCenterTop)
                    cropReversible(imgXRes, imgYRes - yRel, 0, yRel);
                if (hwnd == hSizeboxRightTop)
                    cropReversible(imgXRes + xRel, imgYRes - yRel, 0, yRel);
                if (hwnd == hSizeboxLeftCenter)
                    cropReversible(imgXRes - xRel, imgYRes, xRel, 0);
                if (hwnd == hSizeboxRightCenter)
                    cropReversible(imgXRes + xRel, imgYRes, 0, 0);
                if (hwnd == hSizeboxLeftBottom)
                    cropReversible(imgXRes - xRel, imgYRes + yRel, xRel, 0);
                if (hwnd == hSizeboxCenterBottom)
                    cropReversible(imgXRes, imgYRes + yRel, 0, 0);
                if (hwnd == hSizeboxRightBottom)
                    cropReversible(imgXRes + xRel, imgYRes + yRel, 0, 0);
                SendMessage(hStatusBar, SB_SETTEXT, 2, (LPARAM) _T(""));
            }
            break;

        default:
            return DefWindowProc(hwnd, message, wParam, lParam);
    }

    return 0;
}

Generated on Sun May 27 2012 04:42:03 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.