1999-01-24 19:12:34 +00:00
|
|
|
/*
|
|
|
|
* Drag List control
|
|
|
|
*
|
|
|
|
* Copyright 1999 Eric Kohl
|
|
|
|
*
|
2002-03-09 23:29:33 +00:00
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
*
|
1999-01-24 19:12:34 +00:00
|
|
|
* NOTES
|
|
|
|
* This is just a dummy control. An author is needed! Any volunteers?
|
|
|
|
* I will only improve this control once in a while.
|
|
|
|
* Eric <ekohl@abo.rhein-zeitung.de>
|
|
|
|
*
|
|
|
|
* TODO:
|
|
|
|
* - Everything.
|
|
|
|
*/
|
|
|
|
|
2003-09-05 23:08:26 +00:00
|
|
|
#include <stdarg.h>
|
|
|
|
|
|
|
|
#include "windef.h"
|
|
|
|
#include "winbase.h"
|
|
|
|
#include "wingdi.h"
|
|
|
|
#include "winuser.h"
|
|
|
|
#include "winnls.h"
|
1999-01-24 19:12:34 +00:00
|
|
|
#include "commctrl.h"
|
2002-03-09 23:29:33 +00:00
|
|
|
#include "wine/debug.h"
|
1999-01-24 19:12:34 +00:00
|
|
|
|
2002-03-09 23:29:33 +00:00
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(commctrl);
|
1999-04-19 14:56:29 +00:00
|
|
|
|
1999-01-24 19:12:34 +00:00
|
|
|
|
1999-11-23 23:35:12 +00:00
|
|
|
static DWORD dwLastScrollTime = 0;
|
|
|
|
|
2000-03-24 20:46:04 +00:00
|
|
|
/***********************************************************************
|
2001-06-19 03:34:07 +00:00
|
|
|
* MakeDragList (COMCTL32.13)
|
2000-03-24 20:46:04 +00:00
|
|
|
*/
|
1999-02-26 11:11:13 +00:00
|
|
|
BOOL WINAPI MakeDragList (HWND hwndLB)
|
1999-01-24 19:12:34 +00:00
|
|
|
{
|
2002-10-23 22:19:10 +00:00
|
|
|
FIXME("(%p)\n", hwndLB);
|
1999-01-24 19:12:34 +00:00
|
|
|
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2000-03-24 20:46:04 +00:00
|
|
|
/***********************************************************************
|
2001-06-19 03:34:07 +00:00
|
|
|
* DrawInsert (COMCTL32.15)
|
2000-03-24 20:46:04 +00:00
|
|
|
*/
|
1999-02-26 11:11:13 +00:00
|
|
|
VOID WINAPI DrawInsert (HWND hwndParent, HWND hwndLB, INT nItem)
|
1999-01-24 19:12:34 +00:00
|
|
|
{
|
2002-10-23 22:19:10 +00:00
|
|
|
FIXME("(%p %p %d)\n", hwndParent, hwndLB, nItem);
|
1999-01-24 19:12:34 +00:00
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2000-03-24 20:46:04 +00:00
|
|
|
/***********************************************************************
|
2001-06-19 03:34:07 +00:00
|
|
|
* LBItemFromPt (COMCTL32.14)
|
2000-03-24 20:46:04 +00:00
|
|
|
*/
|
1999-02-26 11:11:13 +00:00
|
|
|
INT WINAPI LBItemFromPt (HWND hwndLB, POINT pt, BOOL bAutoScroll)
|
1999-01-24 19:12:34 +00:00
|
|
|
{
|
1999-11-23 23:35:12 +00:00
|
|
|
RECT rcClient;
|
|
|
|
INT nIndex;
|
|
|
|
DWORD dwScrollTime;
|
|
|
|
|
2002-10-23 22:19:10 +00:00
|
|
|
FIXME("(%p %ld x %ld %s)\n",
|
1999-01-24 19:12:34 +00:00
|
|
|
hwndLB, pt.x, pt.y, bAutoScroll ? "TRUE" : "FALSE");
|
|
|
|
|
1999-11-23 23:35:12 +00:00
|
|
|
ScreenToClient (hwndLB, &pt);
|
|
|
|
GetClientRect (hwndLB, &rcClient);
|
|
|
|
nIndex = (INT)SendMessageA (hwndLB, LB_GETTOPINDEX, 0, 0);
|
|
|
|
|
|
|
|
if (PtInRect (&rcClient, pt))
|
|
|
|
{
|
|
|
|
/* point is inside -- get the item index */
|
|
|
|
while (TRUE)
|
|
|
|
{
|
|
|
|
if (SendMessageA (hwndLB, LB_GETITEMRECT, nIndex, (LPARAM)&rcClient) == LB_ERR)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
if (PtInRect (&rcClient, pt))
|
|
|
|
return nIndex;
|
|
|
|
|
|
|
|
nIndex++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* point is outside */
|
|
|
|
if (!bAutoScroll)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
if ((pt.x > rcClient.right) || (pt.x < rcClient.left))
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
if (pt.y < 0)
|
|
|
|
nIndex--;
|
|
|
|
else
|
|
|
|
nIndex++;
|
|
|
|
|
|
|
|
dwScrollTime = GetTickCount ();
|
|
|
|
|
|
|
|
if ((dwScrollTime - dwLastScrollTime) < 200)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
dwLastScrollTime = dwScrollTime;
|
|
|
|
|
|
|
|
SendMessageA (hwndLB, LB_SETTOPINDEX, (WPARAM)nIndex, 0);
|
|
|
|
}
|
1999-01-24 19:12:34 +00:00
|
|
|
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
1999-11-23 23:35:12 +00:00
|
|
|
|
2000-02-25 21:01:50 +00:00
|
|
|
#if 0
|
1999-11-23 23:35:12 +00:00
|
|
|
static LRESULT CALLBACK
|
|
|
|
DRAGLIST_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|
|
|
{
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
2000-02-25 21:01:50 +00:00
|
|
|
#endif
|
1999-11-23 23:35:12 +00:00
|
|
|
|
|
|
|
|
|
|
|
|