Moved a large number of 16-bit functions to a separate gdi16.c file.
[wine/hacks.git] / dlls / comctl32 / draglist.c
blob46364c84ee2e9e1ef4713e68410d9a5114bab9f1
1 /*
2 * Drag List control
4 * Copyright 1999 Eric Kohl
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 * NOTES
21 * This is just a dummy control. An author is needed! Any volunteers?
22 * I will only improve this control once in a while.
23 * Eric <ekohl@abo.rhein-zeitung.de>
25 * TODO:
26 * - Everything.
29 #include "commctrl.h"
30 #include "wine/debug.h"
32 WINE_DEFAULT_DEBUG_CHANNEL(commctrl);
35 static DWORD dwLastScrollTime = 0;
37 /***********************************************************************
38 * MakeDragList (COMCTL32.13)
40 BOOL WINAPI MakeDragList (HWND hwndLB)
42 FIXME("(0x%x)\n", hwndLB);
45 return FALSE;
48 /***********************************************************************
49 * DrawInsert (COMCTL32.15)
51 VOID WINAPI DrawInsert (HWND hwndParent, HWND hwndLB, INT nItem)
53 FIXME("(0x%x 0x%x %d)\n", hwndParent, hwndLB, nItem);
58 /***********************************************************************
59 * LBItemFromPt (COMCTL32.14)
61 INT WINAPI LBItemFromPt (HWND hwndLB, POINT pt, BOOL bAutoScroll)
63 RECT rcClient;
64 INT nIndex;
65 DWORD dwScrollTime;
67 FIXME("(0x%x %ld x %ld %s)\n",
68 hwndLB, pt.x, pt.y, bAutoScroll ? "TRUE" : "FALSE");
70 ScreenToClient (hwndLB, &pt);
71 GetClientRect (hwndLB, &rcClient);
72 nIndex = (INT)SendMessageA (hwndLB, LB_GETTOPINDEX, 0, 0);
74 if (PtInRect (&rcClient, pt))
76 /* point is inside -- get the item index */
77 while (TRUE)
79 if (SendMessageA (hwndLB, LB_GETITEMRECT, nIndex, (LPARAM)&rcClient) == LB_ERR)
80 return -1;
82 if (PtInRect (&rcClient, pt))
83 return nIndex;
85 nIndex++;
88 else
90 /* point is outside */
91 if (!bAutoScroll)
92 return -1;
94 if ((pt.x > rcClient.right) || (pt.x < rcClient.left))
95 return -1;
97 if (pt.y < 0)
98 nIndex--;
99 else
100 nIndex++;
102 dwScrollTime = GetTickCount ();
104 if ((dwScrollTime - dwLastScrollTime) < 200)
105 return -1;
107 dwLastScrollTime = dwScrollTime;
109 SendMessageA (hwndLB, LB_SETTOPINDEX, (WPARAM)nIndex, 0);
112 return -1;
116 #if 0
117 static LRESULT CALLBACK
118 DRAGLIST_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
121 return FALSE;
123 #endif