Changeset 3284 for trunk/src


Ignore:
Timestamp:
Mar 31, 2000, 4:42:49 PM (25 years ago)
Author:
cbratschi
Message:

HTTRANSPARENT

Location:
trunk/src/user32
Files:
5 edited

Legend:

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

    r3127 r3284  
    1 /* $Id: oslibmsgtranslate.cpp,v 1.25 2000-03-16 19:19:09 sandervl Exp $ */
     1/* $Id: oslibmsgtranslate.cpp,v 1.26 2000-03-31 14:42:47 cbratschi Exp $ */
    22/*
    33 * Window message translation functions for OS/2
     
    138138  POSTMSG_PACKET  *packet;
    139139  THDB            *thdb = (THDB *)pThdb;
    140   ULONG            hittest;
    141140  int i;
    142141
     
    165164    switch (os2Msg->msg)
    166165    {
     166      case WM_HITTEST:
     167        winMsg->message = WINWM_NCHITTEST;
     168        winMsg->wParam  = 0;
     169        winMsg->lParam  = MAKELONG(winMsg->pt.x,winMsg->pt.y);
     170
     171        return TRUE;
     172
    167173      case WM_BUTTON1DOWN:
    168174      case WM_BUTTON1UP:
     
    176182        //WM_NC*BUTTON* is posted when the cursor is in a non-client area of the window
    177183
    178         hittest = win32wnd->MsgHitTest(winMsg->pt.x, winMsg->pt.y);
    179 
    180184        if (IsNCMouseMsg(win32wnd)) {
    181185            winMsg->message = WINWM_NCLBUTTONDOWN + (os2Msg->msg - WM_BUTTON1DOWN);
    182             winMsg->wParam  = hittest;
     186            winMsg->wParam  = win32wnd->getLastHitTestVal();
    183187            winMsg->lParam  = MAKELONG(winMsg->pt.x, winMsg->pt.y); //screen coordinates
    184188        }
     
    197201            if(DInputMouseHandler(win32wnd->getWindowHandle(), winMsg->message, winMsg->pt.x, winMsg->pt.y)) {
    198202                goto dummymessage; //dinput swallowed message
    199             }
     203            }
    200204        }
    201205
     
    216220      {
    217221        //WM_NCMOUSEMOVE is posted when the cursor moves into a non-client area of the window
    218         hittest = win32wnd->MsgHitTest(winMsg->pt.x, winMsg->pt.y);
    219222
    220223        if (IsNCMouseMsg(win32wnd))
    221224        {
    222225          winMsg->message = WINWM_NCMOUSEMOVE;
    223           winMsg->wParam  = (WPARAM)hittest;
     226          winMsg->wParam  = (WPARAM)win32wnd->getLastHitTestVal();
    224227          winMsg->lParam  = MAKELONG(winMsg->pt.x,winMsg->pt.y);
    225228        }
     
    422425    //Mouse messages (OS/2 Window coordinates -> Win32 coordinates relative to screen
    423426    //**************************************************************************
     427    case WM_HITTEST:
     428      winMsg->message = WINWM_NCHITTEST;
     429      winMsg->wParam  = 0;
     430      winMsg->lParam  = MAKELONG(winMsg->pt.x,winMsg->pt.y);
     431
     432      return TRUE;
     433
    424434    case WM_BUTTON1DOWN:
    425435    case WM_BUTTON1UP:
     
    432442    case WM_BUTTON3DBLCLK:
    433443        //WM_NC*BUTTON* is posted when the cursor is in a non-client area of the window
    434         hittest = win32wnd->MsgHitTest(winMsg->pt.x, winMsg->pt.y);
    435444
    436445        if(IsNCMouseMsg(win32wnd)) {
    437446            winMsg->message = WINWM_NCLBUTTONDOWN + (os2Msg->msg - WM_BUTTON1DOWN);
    438             winMsg->wParam  = hittest;
     447            winMsg->wParam  = win32wnd->getLastHitTestVal();
    439448            winMsg->lParam  = MAKELONG(winMsg->pt.x, winMsg->pt.y); //screen coordinates
    440449        }
     
    472481    {
    473482        //WM_NCMOUSEMOVE is posted when the cursor moves into a non-client area of the window
    474         hittest = win32wnd->MsgHitTest(winMsg->pt.x, winMsg->pt.y);
    475483
    476484        if(IsNCMouseMsg(win32wnd))
    477485        {
    478486          winMsg->message = WINWM_NCMOUSEMOVE;
    479           winMsg->wParam  = (WPARAM)hittest;
     487          winMsg->wParam  = (WPARAM)win32wnd->getLastHitTestVal();
    480488          winMsg->lParam  = MAKELONG(winMsg->pt.x,winMsg->pt.y);
    481489        }
     
    609617        winMsg->lParam |= (scanCode & 0x0FF) << 16;              // bit 16-23, scancode
    610618
    611         //TODO: Is this correct and complete? (how does PM differentiate between
     619        //TODO: Is this correct and complete? (how does PM differentiate between
    612620        //      i.e numeric pad pgdn & 'normal' pgdn??)
    613         //Check if it's an extended key
    614         switch(virtualKey) {
    615         case VK_RETURN_W:
    616                 //The enter key on the numeric keypad is an extended key
    617                 if(SHORT2FROMMP(os2Msg->mp2) != VK_NEWLINE)
    618                         break;
    619                 //no break
    620         case VK_LEFT_W:
    621         case VK_RIGHT_W:
    622         case VK_DOWN_W:
    623         case VK_UP_W:
    624         case VK_PRIOR_W:
    625         case VK_NEXT_W:
    626         case VK_END_W:
    627         case VK_DIVIDE_W:
    628         case VK_DELETE_W:
    629         case VK_HOME_W:
    630         case VK_INSERT_W:
    631         case VK_RCONTROL_W:
    632         case VK_RMENU_W: //is this the right alt???
    633                 winMsg->lParam = winMsg->lParam | (1<<24);
    634                 break;
    635         }
     621        //Check if it's an extended key
     622        switch(virtualKey) {
     623        case VK_RETURN_W:
     624                //The enter key on the numeric keypad is an extended key
     625                if(SHORT2FROMMP(os2Msg->mp2) != VK_NEWLINE)
     626                        break;
     627                //no break
     628        case VK_LEFT_W:
     629        case VK_RIGHT_W:
     630        case VK_DOWN_W:
     631        case VK_UP_W:
     632        case VK_PRIOR_W:
     633        case VK_NEXT_W:
     634        case VK_END_W:
     635        case VK_DIVIDE_W:
     636        case VK_DELETE_W:
     637        case VK_HOME_W:
     638        case VK_INSERT_W:
     639        case VK_RCONTROL_W:
     640        case VK_RMENU_W: //is this the right alt???
     641                winMsg->lParam = winMsg->lParam | (1<<24);
     642                break;
     643        }
    636644
    637645        if(!(SHORT1FROMMP(os2Msg->mp1) & KC_ALT))
     
    676684            if(DInputKeyBoardHandler(winMsg)) {
    677685                goto dummymessage; //dinput swallowed message
    678             }
     686            }
    679687        }
    680688        break;
     
    771779    default:
    772780dummymessage:
    773         winMsg->message = 0;
    774         winMsg->wParam  = 0;
    775         winMsg->lParam  = 0;
     781        winMsg->message = 0;
     782        winMsg->wParam  = 0;
     783        winMsg->lParam  = 0;
    776784        return FALSE;
    777785  }
  • trunk/src/user32/pmframe.cpp

    r3101 r3284  
    1 /* $Id: pmframe.cpp,v 1.45 2000-03-13 13:10:47 sandervl Exp $ */
     1/* $Id: pmframe.cpp,v 1.46 2000-03-31 14:42:47 cbratschi Exp $ */
    22/*
    33 * Win32 Frame Managment Code for OS/2
     
    164164      RestoreOS2TIB();
    165165      return (MRESULT)TRUE;
     166    }
     167
     168    case WM_HITTEST:
     169    {
     170        if (win32wnd->IsWindowCreated())
     171        {
     172          MRESULT rc;
     173
     174          rc = (MRESULT)win32wnd->MsgHitTest(pWinMsg);
     175          RestoreOS2TIB();
     176          return rc;
     177        }
     178        return (MRESULT)HT_NORMAL;
    166179    }
    167180
  • trunk/src/user32/pmwindow.cpp

    r3101 r3284  
    1 /* $Id: pmwindow.cpp,v 1.87 2000-03-13 13:10:47 sandervl Exp $ */
     1/* $Id: pmwindow.cpp,v 1.88 2000-03-31 14:42:48 cbratschi Exp $ */
    22/*
    33 * Win32 Window Managment Code for OS/2
     
    9696     (PSZ)WIN32_STDCLASS,               /* Window class name            */
    9797     (PFNWP)Win32WindowProc,            /* Address of window procedure  */
    98      0,
     98     CS_HITTEST,
    9999     NROF_WIN32WNDBYTES)) {
    100100        dprintf(("WinRegisterClass Win32BaseWindow failed"));
     
    105105     (PSZ)WIN32_STDCLASS2,              /* Window class name            */
    106106     (PFNWP)Win32WindowProc,            /* Address of window procedure  */
    107      CS_SAVEBITS,
     107     CS_SAVEBITS | CS_HITTEST,
    108108     NROF_WIN32WNDBYTES)) {
    109109        dprintf(("WinRegisterClass Win32BaseWindow failed"));
     
    118118                          WIN32_INNERFRAME,
    119119                          FrameClassInfo.pfnWindowProc,
    120                           FrameClassInfo.flClassStyle,
     120                          FrameClassInfo.flClassStyle | CS_HITTEST,
    121121                          FrameClassInfo.cbWindowData)) {
    122122     dprintf (("WinRegisterClass Win32InnerFrame failed"));
     
    337337    //Mouse messages (OS/2 Window coordinates -> Win32 coordinates relative to screen
    338338    //**************************************************************************
     339    case WM_HITTEST:
     340        rc = win32wnd->MsgHitTest(pWinMsg);
     341        break;
     342
     343
    339344    case WM_BUTTON1DOWN:
    340345    case WM_BUTTON1UP:
  • trunk/src/user32/win32wbase.cpp

    r3251 r3284  
    1 /* $Id: win32wbase.cpp,v 1.175 2000-03-27 21:41:47 sandervl Exp $ */
     1/* $Id: win32wbase.cpp,v 1.176 2000-03-31 14:42:48 cbratschi Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    257257            if (cs->hwndParent == GetDesktopWindow() && (!(cs->style & WS_CHILD) || (cs->style & WS_POPUP)))
    258258            {
    259                     cs->hwndParent = 0;
     259                    cs->hwndParent = 0;
    260260            }
    261261    }
     
    830830//******************************************************************************
    831831//******************************************************************************
    832 ULONG Win32BaseWindow::MsgHitTest(ULONG x, ULONG y)
    833 {
    834   lastHitTestVal = SendInternalMessageA(WM_NCHITTEST, 0, MAKELONG((USHORT)x, (USHORT)y));
    835   dprintf2(("MsgHitTest (%d,%d) (%d,%d) (%d,%d) returned %x", x, y, rectWindow.left, rectWindow.right, rectWindow.top, rectWindow.bottom, lastHitTestVal));
    836   return lastHitTestVal;
     832ULONG Win32BaseWindow::MsgHitTest(MSG *msg)
     833{
     834  lastHitTestVal = DispatchMessageA(msg);
     835
     836  dprintf2(("MsgHitTest (%d,%d) (%d,%d) (%d,%d) returned %x", LOWORD(msg->lParam), HIWORD(msg->lParam), rectWindow.left, rectWindow.right, rectWindow.top, rectWindow.bottom, lastHitTestVal));
     837
     838  if (lastHitTestVal == HTTRANSPARENT)
     839    return HTOS_TRANSPARENT;
     840  else
     841    return HTOS_NORMAL;
    837842}
    838843//******************************************************************************
  • trunk/src/user32/win32wbase.h

    r3153 r3284  
    1 /* $Id: win32wbase.h,v 1.90 2000-03-18 16:13:39 cbratschi Exp $ */
     1/* $Id: win32wbase.h,v 1.91 2000-03-31 14:42:49 cbratschi Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    114114         ULONG  MsgPaint(ULONG tmp1, BOOL select = TRUE);
    115115         ULONG  MsgEraseBackGround(HDC hdc);
    116          ULONG  MsgHitTest(ULONG x, ULONG y);
     116         ULONG  MsgHitTest(MSG *msg);
    117117         ULONG  MsgNCPaint();
    118118         ULONG  MsgFormatFrame(WINDOWPOS *lpWndPos);
Note: See TracChangeset for help on using the changeset viewer.