Ignore:
Timestamp:
Dec 18, 1999, 9:57:01 PM (26 years ago)
Author:
achimha
Message:

WINE 991212 updates - treeview missing

File:
1 edited

Legend:

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

    r104 r2126  
    1313 */
    1414
     15/* WINE 991212 level */
     16
    1517#include "commctrl.h"
     18
     19static DWORD dwLastScrollTime = 0;
    1620
    1721
    1822BOOL WINAPI MakeDragList (HWND hwndLB)
    1923{
    20 //    FIXME (commctrl, "(0x%x)\n", hwndLB);
     24    FIXME("(0x%x)\n", hwndLB);
    2125
    2226
     
    2731VOID WINAPI DrawInsert (HWND hwndParent, HWND hwndLB, INT nItem)
    2832{
    29 //    FIXME (commctrl, "(0x%x 0x%x %d)\n", hwndParent, hwndLB, nItem);
     33    FIXME("(0x%x 0x%x %d)\n", hwndParent, hwndLB, nItem);
    3034
    3135
     
    3539INT WINAPI LBItemFromPt (HWND hwndLB, POINT pt, BOOL bAutoScroll)
    3640{
    37 //    FIXME (commctrl, "(0x%x %ld x %ld %s)\n",
    38 //         hwndLB, pt.x, pt.y, bAutoScroll ? "TRUE" : "FALSE");
     41    RECT rcClient;
     42    INT nIndex;
     43    DWORD dwScrollTime;
    3944
     45    FIXME("(0x%x %ld x %ld %s)\n",
     46           hwndLB, pt.x, pt.y, bAutoScroll ? "TRUE" : "FALSE");
     47
     48    ScreenToClient (hwndLB, &pt);
     49    GetClientRect (hwndLB, &rcClient);
     50    nIndex = (INT)SendMessageA (hwndLB, LB_GETTOPINDEX, 0, 0);
     51
     52    if (PtInRect (&rcClient, pt))
     53    {
     54        /* point is inside -- get the item index */
     55        while (TRUE)
     56        {
     57            if (SendMessageA (hwndLB, LB_GETITEMRECT, nIndex, (LPARAM)&rcClient) == LB_ERR)
     58                return -1;
     59
     60            if (PtInRect (&rcClient, pt))
     61                return nIndex;
     62
     63            nIndex++;
     64        }
     65    }
     66    else
     67    {
     68        /* point is outside */
     69        if (!bAutoScroll)
     70            return -1;
     71
     72        if ((pt.x > rcClient.right) || (pt.x < rcClient.left))
     73            return -1;
     74
     75        if (pt.y < 0)
     76            nIndex--;
     77        else
     78            nIndex++;
     79
     80        dwScrollTime = GetTickCount ();
     81
     82        if ((dwScrollTime - dwLastScrollTime) < 200)
     83            return -1;
     84
     85        dwLastScrollTime = dwScrollTime;
     86
     87        SendMessageA (hwndLB, LB_SETTOPINDEX, (WPARAM)nIndex, 0);
     88    }
    4089
    4190    return -1;
    4291}
    4392
     93
     94static LRESULT CALLBACK
     95DRAGLIST_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
     96{
     97
     98    return FALSE;
     99}
Note: See TracChangeset for help on using the changeset viewer.