Ignore:
Timestamp:
May 8, 2002, 1:26:30 PM (23 years ago)
Author:
sandervl
Message:

merge with latest Wine

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/comctl32/imagelist.c

    r7815 r8382  
    66 *            2001 Michael Stefaniuc
    77 *            2001 Charles Loep for CodeWeavers
     8 *
     9 * This library is free software; you can redistribute it and/or
     10 * modify it under the terms of the GNU Lesser General Public
     11 * License as published by the Free Software Foundation; either
     12 * version 2.1 of the License, or (at your option) any later version.
     13 *
     14 * This library is distributed in the hope that it will be useful,
     15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     17 * Lesser General Public License for more details.
     18 *
     19 * You should have received a copy of the GNU Lesser General Public
     20 * License along with this library; if not, write to the Free Software
     21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    822 *
    923 *  TODO:
     
    2236 *      partially implemented, the functions mentioned above will be
    2337 *      limited in functionality too.
     38 *
     39 *    - Hotspot handling still not correct. The Hotspot passed to BeginDrag
     40 *      is the offset of the image position relative to the actual mouse pointer
     41 *      position. However the Hotspot passed to SetDragCursorImage is the
     42 *      offset of the mouse messages sent to the application...
    2443 */
    2544
     
    3251#include "commctrl.h"
    3352#include "imagelist.h"
    34 #include "debugtools.h"
    35 
    36 DEFAULT_DEBUG_CHANNEL(imagelist);
     53#include "wine/debug.h"
     54
     55WINE_DEFAULT_DEBUG_CHANNEL(imagelist);
    3756
    3857
     
    5473    /* saved background */
    5574    HBITMAP     hbmBg;
     75    BOOL        bHSPending;
    5676} INTERNALDRAG;
    5777
    58 static INTERNALDRAG InternalDrag = { 0, 0, 0, 0, 0, 0, FALSE, 0 };
     78static INTERNALDRAG InternalDrag = { 0, 0, 0, 0, 0, 0, FALSE, 0, FALSE };
    5979
    6080
     
    748768
    749769    InternalDrag.himl->cCurImage = 1;
     770    InternalDrag.bHSPending = TRUE;
    750771
    751772    return TRUE;
     
    10721093ImageList_DragLeave (HWND hwndLock)
    10731094{
    1074     if (hwndLock)
     1095    /* As we don't save drag info in the window this can lead to problems if
     1096       an app does not supply the same window as DragEnter */
     1097    /* if (hwndLock)
    10751098        InternalDrag.hwnd = hwndLock;
    10761099    else
    1077         InternalDrag.hwnd = GetDesktopWindow ();
     1100        InternalDrag.hwnd = GetDesktopWindow (); */
     1101    if(!hwndLock)
     1102        hwndLock = GetDesktopWindow();
     1103    if(InternalDrag.hwnd != hwndLock)
     1104        FIXME("DragLeave hWnd != DragEnter hWnd\n");
    10781105
    10791106    ImageList_DragShowNolock (FALSE);
     
    14901517    DeleteObject(InternalDrag.hbmBg);
    14911518    InternalDrag.hbmBg = 0;
     1519    InternalDrag.bHSPending = FALSE;
    14921520
    14931521    return TRUE;
     
    26012629     * hotspot) to the origin of the second image.
    26022630     * See M$DN for details */
    2603     dx = InternalDrag.dxHotspot - dxHotspot;
    2604     dy = InternalDrag.dyHotspot - dyHotspot;
     2631    if(InternalDrag.bHSPending) {
     2632        dx = 0;
     2633        dy = 0;
     2634        InternalDrag.bHSPending = FALSE;
     2635    } else {
     2636        dx = InternalDrag.dxHotspot - dxHotspot;
     2637        dy = InternalDrag.dyHotspot - dyHotspot;
     2638    }
    26052639    himlTemp = ImageList_Merge (InternalDrag.himl, 0, himlDrag, iDrag, dx, dy);
    26062640
     
    26212655    /* update the InternalDragOffset, if the origin of the
    26222656     * DragImage was changed by ImageList_Merge. */
    2623     if (dx > InternalDrag.dxHotspot) {
    2624         InternalDrag.dxHotspot = dx;
    2625     }
    2626     if (dy > InternalDrag.dyHotspot) {
    2627         InternalDrag.dyHotspot = dy;
    2628     }
     2657    if (dx <= 0)
     2658        InternalDrag.dxHotspot = dxHotspot;
     2659    if (dy <= 0)
     2660        InternalDrag.dyHotspot = dyHotspot;
    26292661
    26302662    if (visible) {
     
    29342966
    29352967    if(bitCount == 1) {
    2936         //Hack.
     2968        /* Hack. */
    29372969        LPBITMAPINFO inf = (LPBITMAPINFO)bmih;
    29382970        inf->bmiColors[0].rgbRed = inf->bmiColors[0].rgbGreen = inf->bmiColors[0].rgbBlue = 0;
Note: See TracChangeset for help on using the changeset viewer.