Changeset 2483 for trunk/src


Ignore:
Timestamp:
Jan 20, 2000, 5:48:58 PM (26 years ago)
Author:
cbratschi
Message:

WM_CONTEXTMENU, sysmenu changes

Location:
trunk/src/user32
Files:
8 edited

Legend:

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

    r2479 r2483  
    1 /* $Id: menu.cpp,v 1.11 2000-01-19 01:40:56 sandervl Exp $*/
     1/* $Id: menu.cpp,v 1.12 2000-01-20 16:48:54 cbratschi Exp $*/
    22/*
    33 * Menu functions
     
    25812581}
    25822582
     2583VOID MENU_DispatchMouseMsg(MSG *msg)
     2584{
     2585  LONG hittest;
     2586
     2587  hittest = SendMessageA(msg->hwnd,WM_NCHITTEST,0,MAKELONG(msg->pt.x,msg->pt.y));
     2588  if (hittest != HTCLIENT)
     2589    SendMessageA(msg->hwnd,msg->message+WM_NCMOUSEMOVE-WM_MOUSEMOVE,hittest,MAKELONG(msg->pt.x,msg->pt.y));
     2590  else
     2591    DispatchMessageA(msg);
     2592}
     2593
    25832594/***********************************************************************
    25842595 *           MENU_TrackMenu
     
    26382649
    26392650            hmenu = MENU_PtMenu(mt.hTopMenu,pt,inMenuBar);
     2651
     2652            //CB: todo: Win32 dispatches at least some mouse messages!
    26402653
    26412654            switch(msg.message)
     
    26812694
    26822695                    fEndMenu |= !MENU_MouseMove( &mt, hmenu, wFlags );
     2696                    //CB: dispatch message
     2697                    if (!fEndMenu && !hmenu) DispatchMessageA(&msg);
    26832698
    26842699            } /* switch(msg.message) - mouse */
     
    28532868    if (IsMenu(hMenu))
    28542869    {
    2855         if (ht == HTCAPTION) wFlags |= TPM_CAPTIONSYSMENU;
     2870        if (ht == HTCAPTION) wFlags |= TPM_CAPTIONSYSMENU | TPM_RIGHTBUTTON;
    28562871        if (IsIconic(hWnd)) wFlags |= TPM_BOTTOMALIGN; //CB: todo: for minimized windows
    28572872
  • trunk/src/user32/oslibmsgtranslate.cpp

    r2469 r2483  
    1 /* $Id: oslibmsgtranslate.cpp,v 1.15 2000-01-18 20:10:40 sandervl Exp $ */
     1/* $Id: oslibmsgtranslate.cpp,v 1.16 2000-01-20 16:48:55 cbratschi Exp $ */
    22/*
    33 * Window message translation functions for OS/2
     
    208208        hittest = win32wnd->MsgHitTest(winMsg->pt.x, winMsg->pt.y);
    209209
    210         if (IsNCMouseMsg(win32wnd)) 
     210        if (IsNCMouseMsg(win32wnd))
    211211        {
    212212          winMsg->message = WINWM_NCMOUSEMOVE;
    213213          winMsg->wParam  = (WPARAM)hittest;
    214214          winMsg->lParam  = MAKELONG(winMsg->pt.x,winMsg->pt.y);
    215         } 
     215        }
    216216        else
    217217        {
     
    234234        winMsg->message = WINWM_NCACTIVATE;
    235235        winMsg->wParam  = SHORT1FROMMP(os2Msg->mp1);
    236         return TRUE;
     236        return TRUE;
    237237      }
    238238      case WM_WINDOWPOSCHANGED:
    239239      {
    240         //todo: proper translation
    241         return FALSE;
     240        //todo: proper translation
     241        return FALSE;
    242242      }
    243243    }
     
    324324
    325325        if(pswp->fl & (SWP_MOVE | SWP_SIZE)) {
    326                 dprintf(("Set client rectangle to (%d,%d)(%d,%d)", swpOld.x, swpOld.y, swpOld.x + swpOld.cx, swpOld.y + swpOld.cy));
    327                 win32wnd->setClientRect(swpOld.x, swpOld.y, swpOld.x + swpOld.cx, swpOld.y + swpOld.cy);
    328 
    329                 thdb->wp.hwnd = win32wnd->getWindowHandle();
    330                 if ((pswp->fl & SWP_ZORDER) && (pswp->hwndInsertBehind > HWND_BOTTOM))
    331                 {
    332                         Win32BaseWindow *wndAfter = Win32BaseWindow::GetWindowFromOS2Handle(pswp->hwndInsertBehind);
    333                         if(wndAfter)
    334                         thdb->wp.hwndInsertAfter = wndAfter->getWindowHandle();
    335                 }
    336 
    337                 PRECT lpRect = win32wnd->getWindowRect();
    338                 //SvL: Only send it when the client has changed & the frame hasn't
    339                 //     If the frame size/position has changed, pmframe.cpp will send
    340                 //     this message
    341                 if(lpRect->right == thdb->wp.x+thdb->wp.cx && lpRect->bottom == thdb->wp.y+thdb->wp.cy) {
    342                         winMsg->message = WINWM_WINDOWPOSCHANGED;
    343                         winMsg->lParam  = (LPARAM)&thdb->wp;
    344                         break;
    345                 }
     326                dprintf(("Set client rectangle to (%d,%d)(%d,%d)", swpOld.x, swpOld.y, swpOld.x + swpOld.cx, swpOld.y + swpOld.cy));
     327                win32wnd->setClientRect(swpOld.x, swpOld.y, swpOld.x + swpOld.cx, swpOld.y + swpOld.cy);
     328
     329                thdb->wp.hwnd = win32wnd->getWindowHandle();
     330                if ((pswp->fl & SWP_ZORDER) && (pswp->hwndInsertBehind > HWND_BOTTOM))
     331                {
     332                        Win32BaseWindow *wndAfter = Win32BaseWindow::GetWindowFromOS2Handle(pswp->hwndInsertBehind);
     333                        if(wndAfter)
     334                        thdb->wp.hwndInsertAfter = wndAfter->getWindowHandle();
     335                }
     336
     337                PRECT lpRect = win32wnd->getWindowRect();
     338                //SvL: Only send it when the client has changed & the frame hasn't
     339                //     If the frame size/position has changed, pmframe.cpp will send
     340                //     this message
     341                if(lpRect->right == thdb->wp.x+thdb->wp.cx && lpRect->bottom == thdb->wp.y+thdb->wp.cy) {
     342                        winMsg->message = WINWM_WINDOWPOSCHANGED;
     343                        winMsg->lParam  = (LPARAM)&thdb->wp;
     344                        break;
     345                }
    346346        }
    347347        goto dummymessage;
     
    447447          winMsg->wParam  = (WPARAM)hittest;
    448448          winMsg->lParam  = MAKELONG(winMsg->pt.x,winMsg->pt.y);
    449         } 
     449        }
    450450        else
    451451        {
     
    672672
    673673    case WM_CONTEXTMENU:
     674        winMsg->message = WINWM_CONTEXTMENU;
     675        winMsg->wParam  = win32wnd->getWindowHandle();
     676        winMsg->lParam  = MAKELONG(winMsg->pt.x,winMsg->pt.y);
     677        break;
     678
    674679    case WM_INITMENU:
    675680    case WM_MENUSELECT:
  • trunk/src/user32/oslibwin.cpp

    r2469 r2483  
    1 /* $Id: oslibwin.cpp,v 1.61 2000-01-18 20:10:43 sandervl Exp $ */
     1/* $Id: oslibwin.cpp,v 1.62 2000-01-20 16:48:55 cbratschi Exp $ */
    22/*
    33 * Window API wrappers for OS/2
     
    612612        point.x = x;
    613613        point.y = y;
    614         if(hParent)
     614
     615        if (hParent)
    615616        {
    616                 WinMapWindowPoints(hParent, HWND_DESKTOP, &point, 1);
    617         }
    618         point.y = ScreenHeight-point.y-cy;
     617          RECTL parentRect;
     618
     619          WinQueryWindowRect(hParent,&parentRect);
     620          point.y = parentRect.yTop-point.y-cy;
     621        } else point.y = ScreenHeight-point.y-cy;
    619622
    620623        x  = point.x;
  • trunk/src/user32/pmframe.cpp

    r2469 r2483  
    1 /* $Id: pmframe.cpp,v 1.37 2000-01-18 20:10:43 sandervl Exp $ */
     1/* $Id: pmframe.cpp,v 1.38 2000-01-20 16:48:55 cbratschi Exp $ */
    22/*
    33 * Win32 Frame Managment Code for OS/2
     
    139139    }
    140140
     141    case WM_QUERYTRACKINFO:
     142    {
     143      //CB: todo: use minmaxinfo
     144      goto RunDefFrameProc;
     145    }
     146
    141147    case WM_QUERYBORDERSIZE:
    142148    {
     
    290296            }
    291297        }
     298
    292299        OSLibMapSWPtoWINDOWPOSFrame(pswp, &wp, &swpOld, hParent, hwnd);
    293300
  • trunk/src/user32/pmwindow.cpp

    r2469 r2483  
    1 /* $Id: pmwindow.cpp,v 1.78 2000-01-18 20:10:43 sandervl Exp $ */
     1/* $Id: pmwindow.cpp,v 1.79 2000-01-20 16:48:56 cbratschi Exp $ */
    22/*
    33 * Win32 Window Managment Code for OS/2
     
    253253    case WM_WINDOWPOSCHANGED:
    254254    {
    255         if(pWinMsg->message != 0)
    256                 win32wnd->MsgPosChanged((LPARAM)&thdb->wp);
     255        if(pWinMsg->message != 0)
     256                win32wnd->MsgPosChanged((LPARAM)&thdb->wp);
    257257        goto RunDefWndProc;
    258258    }
  • trunk/src/user32/win32wbase.cpp

    r2469 r2483  
    1 /* $Id: win32wbase.cpp,v 1.142 2000-01-18 20:10:53 sandervl Exp $ */
     1/* $Id: win32wbase.cpp,v 1.143 2000-01-20 16:48:56 cbratschi Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    10551055    //set new window rectangle
    10561056    setWindowRect(lpWndPos->x, lpWndPos->y, lpWndPos->x + lpWndPos->cx, lpWndPos->y + lpWndPos->cy);
     1057    if (getParent()) mapWin32Rect(getParent()->getOS2WindowHandle(),OSLIB_HWND_DESKTOP,&rectWindow);
    10571058    newWindowRect= rectWindow;
    10581059  }
     
    14131414            DWORD lParam;
    14141415
    1415             if(getParent()) {//in parent coordinates
    1416                 POINT point;
    1417 
    1418                 point.x = rectClient.left;
    1419                 point.y = rectClient.top;
    1420                 ClientToScreen(getParent()->getWindowHandle(),&point);
    1421 
    1422                 lParam = MAKELONG(point.x, point.y);
    1423             }
    1424             else {//in screen coordinates
    1425                 lParam = MAKELONG(rectClient.left,rectClient.top);
     1416            if (dwStyle & WS_CHILD)
     1417            {
     1418              lParam = MAKELONG(rectClient.left,rectClient.top);
     1419            } else
     1420            {
     1421              POINT point;
     1422
     1423              point.x = rectClient.left;
     1424              point.y = rectClient.top;
     1425              if (getParent()) ClientToScreen(getParent()->getWindowHandle(),&point);
     1426
     1427              lParam = MAKELONG(point.x, point.y);
    14261428            }
    14271429            SendInternalMessageA(WM_MOVE, 0, lParam);
     
    20462048   HWND hParent = 0;
    20472049
    2048     dprintf (("SetWindowPos %x %x (%d,%d)(%d,%d) %x", Win32Hwnd, hwndInsertAfter, x, y, cx, cy, fuFlags));
    2049 
    20502050    if (fuFlags &
    20512051       ~(SWP_NOSIZE     | SWP_NOMOVE     | SWP_NOZORDER     |
     
    20642064    WINDOWPOS wpos;
    20652065    SWP swp, swpOld;
     2066
     2067#if 0 //CB: test: MSIE 2.0 displays the tool-/addressbar this way -> to check
     2068  //CB: cx or cy are 0
     2069if (cx == 0) cx = 50;
     2070if (cy == 0) cy = 50;
     2071#endif
    20662072
    20672073    wpos.flags            = fuFlags;
  • trunk/src/user32/win32wbasenonclient.cpp

    r2469 r2483  
    1 /* $Id: win32wbasenonclient.cpp,v 1.3 2000-01-18 20:10:55 sandervl Exp $ */
     1/* $Id: win32wbasenonclient.cpp,v 1.4 2000-01-20 16:48:57 cbratschi Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2 (non-client methods)
     
    12221222        SetActiveWindow();
    12231223
    1224       if ((GetActiveWindow() == Win32Hwnd) && (dwStyle & WS_SYSMENU))
     1224      if (((GetActiveWindow() == Win32Hwnd) || isMDIChild()) && (dwStyle & WS_SYSMENU))
    12251225      {
    12261226        SendInternalMessageA(WM_SYSCOMMAND,SC_MOUSEMENU+HTCAPTION,lParam);
  • trunk/src/user32/window.cpp

    r2469 r2483  
    1 /* $Id: window.cpp,v 1.49 2000-01-18 20:11:08 sandervl Exp $ */
     1/* $Id: window.cpp,v 1.50 2000-01-20 16:48:58 cbratschi Exp $ */
    22/*
    33 * Win32 window apis for OS/2
     
    640640{
    641641  Win32BaseWindow *window;
    642   BOOL rc;
    643642
    644643    window = Win32BaseWindow::GetWindowFromHandle(hwnd);
     
    646645        dprintf(("GetWindowRect, window %x not found", hwnd));
    647646        SetLastError(ERROR_INVALID_WINDOW_HANDLE);
    648         return 0;
     647        return FALSE;
    649648    }
    650649    if(pRect == NULL) {
    651650        SetLastError(ERROR_INVALID_PARAMETER);
    652         return 0;
     651        return FALSE;
    653652    }
    654653    *pRect = *window->getWindowRect();
    655654    dprintf(("GetWindowRect %x (%d,%d) (%d,%d)", hwnd, pRect->left, pRect->top, pRect->right, pRect->bottom));
    656     return rc;
     655    return TRUE;
    657656}
    658657//******************************************************************************
     
    767766BOOL WIN32API GetClientRect( HWND hwnd, PRECT pRect)
    768767{
    769  BOOL rc;
    770768 HWND hwndWin32 = hwnd;
    771 
    772769 Win32BaseWindow *window;
    773770
Note: See TracChangeset for help on using the changeset viewer.