mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 08:53:02 +00:00
reimplemented support for double clicks
svn path=/trunk/; revision=7167
This commit is contained in:
parent
dea090e06c
commit
b4ca845b10
1 changed files with 63 additions and 6 deletions
|
@ -16,7 +16,7 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
/* $Id: msgqueue.c,v 1.54 2003/12/21 20:06:45 weiden Exp $
|
/* $Id: msgqueue.c,v 1.55 2003/12/21 21:20:31 weiden Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -181,10 +181,68 @@ MsqInsertSystemMessage(MSG* Msg, BOOL RemMouseMoveMsg)
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL STATIC FASTCALL
|
BOOL STATIC FASTCALL
|
||||||
MsqIsDblClk(BOOL Remove, PUSER_MESSAGE Message)
|
MsqIsDblClk(PWINDOW_OBJECT Window, PUSER_MESSAGE Message, BOOL Remove)
|
||||||
{
|
{
|
||||||
/* FIXME */
|
PWINSTATION_OBJECT WinStaObject;
|
||||||
|
PSYSTEM_CURSORINFO CurInfo;
|
||||||
|
NTSTATUS Status;
|
||||||
|
LONG dX, dY;
|
||||||
|
BOOL Res;
|
||||||
|
|
||||||
|
Status = IntValidateWindowStationHandle(PROCESS_WINDOW_STATION(),
|
||||||
|
KernelMode,
|
||||||
|
0,
|
||||||
|
&WinStaObject);
|
||||||
|
if (!NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
}
|
||||||
|
CurInfo = &WinStaObject->SystemCursor;
|
||||||
|
Res = (Window->Self == (HWND)CurInfo->LastClkWnd) &&
|
||||||
|
((Message->Msg.time - CurInfo->LastBtnDown) < CurInfo->DblClickSpeed);
|
||||||
|
if(Res)
|
||||||
|
{
|
||||||
|
|
||||||
|
dX = CurInfo->LastBtnDownX - Message->Msg.pt.x;
|
||||||
|
dY = CurInfo->LastBtnDownY - Message->Msg.pt.y;
|
||||||
|
if(dX < 0) dX = -dX;
|
||||||
|
if(dY < 0) dY = -dY;
|
||||||
|
|
||||||
|
Res = (dX <= CurInfo->DblClickWidth) &&
|
||||||
|
(dY <= CurInfo->DblClickHeight);
|
||||||
|
|
||||||
|
if(Remove)
|
||||||
|
{
|
||||||
|
if(Res)
|
||||||
|
{
|
||||||
|
CurInfo->LastBtnDown = 0;
|
||||||
|
CurInfo->LastBtnDownX = Message->Msg.pt.x;
|
||||||
|
CurInfo->LastBtnDownY = Message->Msg.pt.y;
|
||||||
|
CurInfo->LastClkWnd = NULL;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
CurInfo->LastBtnDownX = Message->Msg.pt.x;
|
||||||
|
CurInfo->LastBtnDownY = Message->Msg.pt.y;
|
||||||
|
CurInfo->LastClkWnd = (HANDLE)Message->Msg.hwnd;
|
||||||
|
CurInfo->LastBtnDown = Message->Msg.time;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if(Remove)
|
||||||
|
{
|
||||||
|
DbgPrint("NO !!! DblClick in %d ms (Msg: %d, last: %d, Max: %d)\n", Message->Msg.time - CurInfo->LastBtnDown, Message->Msg.time, CurInfo->LastBtnDown, CurInfo->DblClickSpeed);
|
||||||
|
CurInfo->LastBtnDownX = Message->Msg.pt.x;
|
||||||
|
CurInfo->LastBtnDownY = Message->Msg.pt.y;
|
||||||
|
CurInfo->LastClkWnd = (HANDLE)Message->Msg.hwnd;
|
||||||
|
CurInfo->LastBtnDown = Message->Msg.time;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ObDereferenceObject(WinStaObject);
|
||||||
|
return Res;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL STATIC STDCALL
|
BOOL STATIC STDCALL
|
||||||
|
@ -197,7 +255,6 @@ MsqTranslateMouseMessage(HWND hWnd, UINT FilterLow, UINT FilterHigh,
|
||||||
PWINDOW_OBJECT CaptureWin, Window = NULL;
|
PWINDOW_OBJECT CaptureWin, Window = NULL;
|
||||||
HWND Wnd;
|
HWND Wnd;
|
||||||
POINT Point;
|
POINT Point;
|
||||||
|
|
||||||
LPARAM SpareLParam;
|
LPARAM SpareLParam;
|
||||||
LRESULT Result;
|
LRESULT Result;
|
||||||
|
|
||||||
|
@ -317,7 +374,7 @@ MsqTranslateMouseMessage(HWND hWnd, UINT FilterLow, UINT FilterHigh,
|
||||||
{
|
{
|
||||||
if ((((*HitTest) != HTCLIENT) ||
|
if ((((*HitTest) != HTCLIENT) ||
|
||||||
(IntGetClassLong(Window, GCL_STYLE, FALSE) & CS_DBLCLKS)) &&
|
(IntGetClassLong(Window, GCL_STYLE, FALSE) & CS_DBLCLKS)) &&
|
||||||
MsqIsDblClk(Remove, Message))
|
MsqIsDblClk(Window, Message, Remove))
|
||||||
{
|
{
|
||||||
Msg += WM_LBUTTONDBLCLK - WM_LBUTTONDOWN;
|
Msg += WM_LBUTTONDBLCLK - WM_LBUTTONDOWN;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue