Changeset 7195 for trunk/src/user32/oslibmsgtranslate.cpp
- Timestamp:
- Oct 24, 2001, 5:41:54 PM (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/oslibmsgtranslate.cpp
r7191 r7195 1 /* $Id: oslibmsgtranslate.cpp,v 1.6 5 2001-10-24 13:18:59 phallerExp $ */1 /* $Id: oslibmsgtranslate.cpp,v 1.66 2001-10-24 15:41:54 sandervl Exp $ */ 2 2 /* 3 3 * Window message translation functions for OS/2 … … 161 161 }; 162 162 163 static BOOL fGenerateDoubleClick = FALSE; 164 static MSG doubleClickMsg = {0}; 165 163 166 //****************************************************************************** 164 167 //****************************************************************************** … … 185 188 { 186 189 return ((win32wnd->getLastHitTestVal() != HTCLIENT_W) && (WinQueryCapture(HWND_DESKTOP) != win32wnd->getOS2WindowHandle())); 190 } 191 //****************************************************************************** 192 //****************************************************************************** 193 void SetMenuDoubleClick(BOOL fSet) 194 { 195 fGenerateDoubleClick = fSet; 187 196 } 188 197 //****************************************************************************** … … 389 398 //WM_NC*BUTTON* is posted when the cursor is in a non-client area of the window 390 399 400 dprintf(("MsgButton %x (%x) %d at (%d,%d) time %x", winMsg->hwnd, os2Msg->hwnd, WINWM_NCLBUTTONDOWN + (os2Msg->msg - WM_BUTTON1DOWN), winMsg->pt.x, winMsg->pt.y, winMsg->time)); 401 391 402 HWND hwnd; 392 403 … … 445 456 else goto dummymessage; //don't send mouse messages to disabled windows 446 457 } 458 459 DisableLogging(); 460 if ((winMsg->message == WINWM_LBUTTONDOWN) || 461 (winMsg->message == WINWM_RBUTTONDOWN) || 462 (winMsg->message == WINWM_MBUTTONDOWN) || 463 (winMsg->message == WINWM_NCLBUTTONDOWN) || 464 (winMsg->message == WINWM_NCRBUTTONDOWN) || 465 (winMsg->message == WINWM_NCMBUTTONDOWN)) 466 { 467 if(fGenerateDoubleClick && doubleClickMsg.message == winMsg->message && 468 winMsg->time - doubleClickMsg.time < GetDoubleClickTime() && 469 (abs(winMsg->pt.x - doubleClickMsg.pt.x) < GetSystemMetrics(SM_CXDOUBLECLK_W)/2) && 470 (abs(winMsg->pt.y - doubleClickMsg.pt.y) < GetSystemMetrics(SM_CYDOUBLECLK_W)/2)) 471 { 472 dprintf(("single -> double click")); 473 if(winMsg->message >= WINWM_LBUTTONDOWN) { 474 winMsg->message += (WINWM_LBUTTONDBLCLK - WINWM_LBUTTONDOWN); 475 } 476 else winMsg->message += (WINWM_LBUTTONDBLCLK - WINWM_NCLBUTTONDOWN); 477 doubleClickMsg.message = 0; 478 } 479 else { 480 dprintf(("save for double click")); 481 doubleClickMsg = *winMsg; 482 if(doubleClickMsg.message >= WINWM_NCLBUTTONDOWN && doubleClickMsg.message <= WINWM_NCMBUTTONDOWN) { 483 doubleClickMsg.message += (WINWM_LBUTTONDOWN - WINWM_NCLBUTTONDOWN); 484 } 485 } 486 } 487 EnableLogging(); 488 447 489 break; 448 490 }
Note:
See TracChangeset
for help on using the changeset viewer.