Let Int09 routines remember a keystroke's ASCII code, if available.
[wine/multimedia.git] / dlls / comctl32 / draglist.c
blob17391bf84c91620e1367b78e85815c8754e443be
1 /*
2 * Drag List control
4 * Copyright 1999 Eric Kohl
6 * NOTES
7 * This is just a dummy control. An author is needed! Any volunteers?
8 * I will only improve this control once in a while.
9 * Eric <ekohl@abo.rhein-zeitung.de>
11 * TODO:
12 * - Everything.
15 #include "commctrl.h"
16 #include "debugtools.h"
18 DEFAULT_DEBUG_CHANNEL(commctrl)
21 static DWORD dwLastScrollTime = 0;
23 /***********************************************************************
24 * MakeDragList
26 BOOL WINAPI MakeDragList (HWND hwndLB)
28 FIXME("(0x%x)\n", hwndLB);
31 return FALSE;
34 /***********************************************************************
35 * DrawInsert
37 VOID WINAPI DrawInsert (HWND hwndParent, HWND hwndLB, INT nItem)
39 FIXME("(0x%x 0x%x %d)\n", hwndParent, hwndLB, nItem);
44 /***********************************************************************
45 * LBItemFromPt
47 INT WINAPI LBItemFromPt (HWND hwndLB, POINT pt, BOOL bAutoScroll)
49 RECT rcClient;
50 INT nIndex;
51 DWORD dwScrollTime;
53 FIXME("(0x%x %ld x %ld %s)\n",
54 hwndLB, pt.x, pt.y, bAutoScroll ? "TRUE" : "FALSE");
56 ScreenToClient (hwndLB, &pt);
57 GetClientRect (hwndLB, &rcClient);
58 nIndex = (INT)SendMessageA (hwndLB, LB_GETTOPINDEX, 0, 0);
60 if (PtInRect (&rcClient, pt))
62 /* point is inside -- get the item index */
63 while (TRUE)
65 if (SendMessageA (hwndLB, LB_GETITEMRECT, nIndex, (LPARAM)&rcClient) == LB_ERR)
66 return -1;
68 if (PtInRect (&rcClient, pt))
69 return nIndex;
71 nIndex++;
74 else
76 /* point is outside */
77 if (!bAutoScroll)
78 return -1;
80 if ((pt.x > rcClient.right) || (pt.x < rcClient.left))
81 return -1;
83 if (pt.y < 0)
84 nIndex--;
85 else
86 nIndex++;
88 dwScrollTime = GetTickCount ();
90 if ((dwScrollTime - dwLastScrollTime) < 200)
91 return -1;
93 dwLastScrollTime = dwScrollTime;
95 SendMessageA (hwndLB, LB_SETTOPINDEX, (WPARAM)nIndex, 0);
98 return -1;
102 #if 0
103 static LRESULT CALLBACK
104 DRAGLIST_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
107 return FALSE;
109 #endif