Changeset 8735 for trunk/src


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

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

Location:
trunk/src/user32
Files:
3 edited

Legend:

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

    r8553 r8735  
    1 /* $Id: dragdrop.cpp,v 1.2 2002-06-02 19:34:25 sandervl Exp $ */
     1/* $Id: dragdrop.cpp,v 1.3 2002-06-20 14:18:14 sandervl Exp $ */
    22
    33/*
     
    3131    DWORD      dwExStyle;
    3232    HWND       orghwnd = hwnd;
     33   
     34    dwExStyle = GetWindowLongA(hwnd, GWL_EXSTYLE);
    3335
    34     dwExStyle = GetWindowLongA(hwnd, GWL_EXSTYLE);
    35    
    3636    //TODO: Is it correct if the window or parent accepts files or must we check the top parent?
    3737    hwnd = (dwExStyle & WS_EX_ACCEPTFILES) ? hwnd : GetParent(hwnd);
     38    dwExStyle = GetWindowLongA(hwnd, GWL_EXSTYLE);
    3839
    39     dwExStyle = GetWindowLongA(hwnd, GWL_EXSTYLE);
    4040    if(!(dwExStyle & WS_EX_ACCEPTFILES)) {
    4141        if(pfnDropFiles) {
    42             return pfnDropFiles(hwnd);
     42            return pfnDropFiles(orghwnd);
    4343        }
    4444        return FALSE;
    4545    }
     46
    4647    cbszFiles++;    //extra terminating 0
    4748    hDropFile = GlobalAlloc(0, sizeof(DROPFILES)+cbszFiles);
  • 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:
  • trunk/src/user32/pmwindow.h

    r7943 r8735  
    1 /* $Id: pmwindow.h,v 1.16 2002-02-18 10:14:57 sandervl Exp $ */
     1/* $Id: pmwindow.h,v 1.17 2002-06-20 14:18:15 sandervl Exp $ */
    22/*
    33 * Win32 Window Managment Code for OS/2
     
    2929extern HWND  hwndCD;
    3030extern LONG CapsCharHeight;
     31extern BOOL  fDragDropActive;
    3132
    3233#define TFOS_LEFT                    0x0001
Note: See TracChangeset for help on using the changeset viewer.