Ignore:
Timestamp:
Jun 20, 2002, 4:18:15 PM (23 years ago)
Author:
sandervl
Message:

drag & drop fix; added SetDragDrop; enabled drag & drop

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/user32/pmwindow.cpp

    r8700 r8735  
    1 /* $Id: pmwindow.cpp,v 1.178 2002-06-17 14:04:54 sandervl Exp $ */
     1/* $Id: pmwindow.cpp,v 1.179 2002-06-20 14:18:15 sandervl Exp $ */
    22/*
    33 * Win32 Window Managment Code for OS/2
     
    6767BOOL    fOS2Look = FALSE;
    6868BOOL    fForceMonoCursor = FALSE;
     69BOOL    fDragDropActive = FALSE;
     70BOOL    fDragDropDisabled = FALSE;
    6971HBITMAP hbmFrameMenu[3] = {0};
    7072
     
    264266{
    265267    fForceMonoCursor = TRUE;
     268}
     269//******************************************************************************
     270//******************************************************************************
     271void WIN32API SetDragDrop(BOOL fDisabled)
     272{
     273    fDragDropDisabled = fDisabled;
    266274}
    267275//******************************************************************************
     
    785793        break;
    786794
    787 //temporarily disabled
    788 #if 0
    789795    case DM_DRAGOVER:
    790796    {
     
    796802        dprintf(("OS2: DM_DRAGOVER %x (%d,%d)", win32wnd->getWindowHandle(), sxDrop, syDrop));
    797803
     804        if(fDragDropDisabled) {
     805                rc = (MRFROM2SHORT (DOR_NEVERDROP, 0));
     806            break;
     807        }
     808
    798809        //does this window accept dropped files?
    799810        if(!DragDropAccept(win32wnd->getWindowHandle())) {
     
    810821            char *pszFiles;
    811822
    812             win32wnd->setDragDropActive(TRUE);
    813 
    814823            pszFiles = PMDragExtractFiles(pDragInfo, &cItems, &ulBytes);
    815824            if(pszFiles) {
    816825                POINT point = {sxDrop, syDrop};
    817826                if(DragDropDragEnter(win32wnd->getWindowHandle(), point, cItems, pszFiles, ulBytes, DROPEFFECT_COPY_W) == FALSE) {
    818                         rc = (MRFROM2SHORT (DOR_NEVERDROP, 0));
     827                    rc = (MRFROM2SHORT (DOR_NEVERDROP, 0));
    819828                }
    820                 else    rc = (MRFROM2SHORT(DOR_DROP, DO_MOVE));
     829                else {
     830                    fDragDropActive = TRUE;
     831                    rc = (MRFROM2SHORT(DOR_DROP, DO_MOVE));
     832                    win32wnd->setDragDropActive(TRUE);
     833                }
    821834                free(pszFiles);
    822835            }
     
    837850    {
    838851        dprintf(("OS2: DM_DRAGLEAVE %x", win32wnd->getWindowHandle()));
     852
     853        if(fDragDropDisabled) {
     854            break;
     855        }
     856
     857        fDragDropActive = FALSE;
     858
     859        //does this window accept dropped files?
     860        if(!DragDropAccept(win32wnd->getWindowHandle())) {
     861            break;
     862        }
     863
    839864        DragDropDragLeave(win32wnd->getWindowHandle());
    840865        win32wnd->setDragDropActive(FALSE);
     
    852877        dprintf(("OS2: DM_DROP %x (%d,%d)", win32wnd->getWindowHandle(), sxDrop, syDrop));
    853878
     879        fDragDropActive = FALSE;
    854880        rc = (MRFROM2SHORT (DOR_NODROP, 0));
     881
     882        if(fDragDropDisabled) {
     883            rc = (MRFROM2SHORT (DOR_NODROP, 0));
     884            break;
     885        }
    855886
    856887        //does this window accept dropped files?
     
    879910        break;
    880911    }
    881 #endif
    882912
    883913    case WM_DDE_INITIATE:
Note: See TracChangeset for help on using the changeset viewer.