Ignore:
Timestamp:
Oct 24, 2001, 5:41:54 PM (24 years ago)
Author:
sandervl
Message:

double click fix + double click on system menu now works

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/user32/oslibmsgtranslate.cpp

    r7191 r7195  
    1 /* $Id: oslibmsgtranslate.cpp,v 1.65 2001-10-24 13:18:59 phaller Exp $ */
     1/* $Id: oslibmsgtranslate.cpp,v 1.66 2001-10-24 15:41:54 sandervl Exp $ */
    22/*
    33 * Window message translation functions for OS/2
     
    161161};
    162162
     163static BOOL fGenerateDoubleClick = FALSE;
     164static MSG  doubleClickMsg = {0};
     165
    163166//******************************************************************************
    164167//******************************************************************************
     
    185188{
    186189  return ((win32wnd->getLastHitTestVal() != HTCLIENT_W) && (WinQueryCapture(HWND_DESKTOP) != win32wnd->getOS2WindowHandle()));
     190}
     191//******************************************************************************
     192//******************************************************************************
     193void SetMenuDoubleClick(BOOL fSet)
     194{
     195  fGenerateDoubleClick = fSet;
    187196}
    188197//******************************************************************************
     
    389398        //WM_NC*BUTTON* is posted when the cursor is in a non-client area of the window
    390399
     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
    391402        HWND hwnd;
    392403
     
    445456            else goto dummymessage; //don't send mouse messages to disabled windows
    446457        }
     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
    447489        break;
    448490    }
Note: See TracChangeset for help on using the changeset viewer.