Changeset 12998


Ignore:
Timestamp:
Jan 12, 2000, 1:41:20 PM (25 years ago)
Author:
sandervl
Message:

menu, resize/move fixes + ported Wine messagebox code

Location:
tags/trunk/src/user32/new
Files:
1 added
1 deleted
8 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified tags/trunk/src/user32/new/makefile

    r12986 r12998  
    1 # $Id: makefile,v 1.56 2000-01-11 10:38:33 sandervl Exp $
     1# $Id: makefile,v 1.57 2000-01-12 12:40:41 sandervl Exp $
    22
    33#
     
    115115icontitle.obj: icontitle.cpp $(PDWIN32_INCLUDE)\win\icontitle.h
    116116
    117 msgbox.obj:    msgbox.cpp
     117msgbox.obj:    msgbox.c
    118118window.obj:    window.cpp win32class.h win32wbase.h win32wndchild.h oslibwin.h win32wmdiclient.h win32wdesktop.h
    119119windowmsg.obj: windowmsg.cpp win32class.h win32wbase.h win32wndchild.h oslibmsg.h
  • TabularUnified tags/trunk/src/user32/new/menu.cpp

    r12993 r12998  
    1 /* $Id: menu.cpp,v 1.7 2000-01-11 17:34:42 cbratschi Exp $*/
     1/* $Id: menu.cpp,v 1.8 2000-01-12 12:40:43 sandervl Exp $*/
    22/*
    33 * Menu functions
     
    24022402        if( hNewWnd != pmt->hOwnerWnd )
    24032403        {
    2404             ReleaseCapture();
     2404            ReleaseCapture(); 
    24052405            pmt->hOwnerWnd = hNewWnd;
     2406            SetCapture(pmt->hOwnerWnd); //SvL: Don't know if this is good enough
    24062407            //EVENT_Capture( pmt->hOwnerWnd, HTMENU ); //CB: todo
    24072408        }
     
    25942595
    25952596    //EVENT_Capture( mt.hOwnerWnd, HTMENU ); //CB: todo
     2597    //SvL: Set keyboard & mouse event capture
     2598    SetCapture(mt.hOwnerWnd);
    25962599
    25972600    while (!fEndMenu)
     
    26022605        /* we have to keep the message in the queue until it's
    26032606         * clear that menu loop is not over yet. */
    2604         if (!GetMessageA(&msg,msg.hwnd,0,0)) break;
     2607//        if (!GetMessageA(&msg,msg.hwnd,0,0)) break;
     2608        //SvL: Getting messages for only the menu delays background paints (i.e. VPBuddy logo)
     2609        if (!GetMessageA(&msg,0,0,0)) break;
    26052610        TranslateMessage( &msg );
    26062611        mt.pt = msg.pt;
     
    26102615
    26112616        fRemove = FALSE;
    2612         if ((msg.message >= WM_MOUSEFIRST) && (msg.message <= WM_MOUSELAST))
     2617        if((msg.message >= WM_MOUSEFIRST) && (msg.message <= WM_MOUSELAST))
    26132618        {
    26142619            /* Find a menu for this mouse event */
  • TabularUnified tags/trunk/src/user32/new/oslibmsgtranslate.cpp

    r12983 r12998  
    1 /* $Id: oslibmsgtranslate.cpp,v 1.10 2000-01-10 23:29:12 sandervl Exp $ */
     1/* $Id: oslibmsgtranslate.cpp,v 1.11 2000-01-12 12:40:44 sandervl Exp $ */
    22/*
    33 * Window message translation functions for OS/2
     
    561561    }
    562562
    563     case WM_INITMENU:
    564         winMsg->message = WINWM_INITMENU;
    565         winMsg->wParam  = (WPARAM)os2Msg->mp2; //hMenu
    566         break;
    567 
    568     case WM_MENUSELECT:
    569     case WM_MENUEND:
    570     case WM_NEXTMENU:
    571         goto dummymessage;
    572 
    573563    case WM_TIMER:
    574564        if (os2Msg->mp2)
     
    630620
    631621    case WM_CONTEXTMENU:
    632     {
    633         OSLIBPOINT pt;
    634 
    635         pt.x = (*(POINTS *)&os2Msg->mp1).x;
    636         pt.y = (*(POINTS *)&os2Msg->mp1).y;
    637         mapOS2ToWin32Point(os2Msg->hwnd,OSLIB_HWND_DESKTOP,&pt);
    638         winMsg->message = WINWM_CONTEXTMENU;
    639         winMsg->wParam  = (WPARAM)win32wnd->getWindowHandle();
    640         winMsg->lParam  = MAKELONG((USHORT)pt.x, (USHORT)pt.y);
    641         break;
    642     }
    643 
     622    case WM_INITMENU:
     623    case WM_MENUSELECT:
     624    case WM_MENUEND:
     625    case WM_NEXTMENU:
    644626    case WM_SYSCOLORCHANGE:
    645627    case WM_SYSVALUECHANGED:
  • TabularUnified tags/trunk/src/user32/new/pmframe.cpp

    r12983 r12998  
    1 /* $Id: pmframe.cpp,v 1.10 2000-01-10 23:29:13 sandervl Exp $ */
     1/* $Id: pmframe.cpp,v 1.11 2000-01-12 12:40:45 sandervl Exp $ */
    22/*
    33 * Win32 Frame Managment Code for OS/2
     
    107107  {
    108108    case WM_FORMATFRAME:
    109     {
    110       PSWP pswp = (PSWP)mp1,swpClient;
    111       RECTL *client = (PRECTL)mp2,rect;
    112       RECT winRect;
    113       INT ccount;
    114 
    115       if (!win32wnd->IsWindowCreated()) goto RunDefFrameProc;
    116       dprintf(("PMFRAME: WM_FORMATFRAME %x",hwnd));
    117       RestoreOS2TIB();
    118       ccount = (INT)OldFrameProc(hwnd,msg,mp1,mp2);
    119       SetWin32TIB();
    120       dprintf(("Frame size: %d %d",win32wnd->getWindowWidth(),win32wnd->getWindowHeight()));
    121       win32wnd->MsgFormatFrame();
    122       //CB: todo: use result for WM_CALCVALIDRECTS
    123       mapWin32ToOS2Rect(WinQueryWindow(hwnd,QW_PARENT),hwnd,win32wnd->getClientRectPtr(),(PRECTLOS2)&rect);
    124       swpClient = &pswp[ccount-1];
    125       swpClient->x = rect.xLeft;
    126       swpClient->y = rect.yBottom;
    127       swpClient->cx = rect.xRight-rect.xLeft;
    128       swpClient->cy = rect.yTop-rect.yBottom;
    129       dprintf(("New client position: x=%d y=%d w=%d h=%d",swpClient->x,swpClient->y,swpClient->cx,swpClient->cy));
    130       RestoreOS2TIB();
    131       return (MRESULT)ccount;
    132     }
     109        break;
    133110
    134111    case WM_MINMAXFRAME:
     
    141118      {
    142119        win32wnd->setStyle((win32wnd->getStyle() & ~WS_MINIMIZE_W) | WS_MAXIMIZE_W);
    143       } else if ((swp->fl & SWP_MINIMIZE) == SWP_MINIMIZE)
     120      }
     121      else if ((swp->fl & SWP_MINIMIZE) == SWP_MINIMIZE)
    144122      {
    145123        win32wnd->setStyle((win32wnd->getStyle() & ~WS_MAXIMIZE_W) | WS_MINIMIZE_W);
    146       } else if ((swp->fl & SWP_RESTORE) == SWP_RESTORE)
     124      }
     125      else if ((swp->fl & SWP_RESTORE) == SWP_RESTORE)
    147126      {
    148127        win32wnd->setStyle(win32wnd->getStyle() & ~(WS_MINIMIZE_W | WS_MAXIMIZE_W));
     
    277256      WINDOWPOS wp;
    278257      HWND      hParent = NULLHANDLE;
     258      RECTL rect;
     259      SWP swpClient = {0};
    279260
    280261        dprintf(("PMFRAME: WM_WINDOWPOSCHANGED (%x) %x %x (%d,%d) (%d,%d)", mp2, win32wnd->getWindowHandle(), pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy));
    281262
    282263        if ((pswp->fl & (SWP_SIZE | SWP_MOVE | SWP_ZORDER)) == 0)
    283             goto PosChangedEnd;
     264        {
     265                swpClient.hwnd = win32wnd->getOS2WindowHandle();
     266                swpClient.hwndInsertBehind = 0;
     267                swpClient.x  = 0;
     268                swpClient.y  = 0;
     269                swpClient.cx = 0;
     270                swpClient.cy = 0;
     271                swpClient.fl = pswp->fl & ~SWP_ZORDER;
     272                WinSetMultWindowPos(thdb->hab, &swpClient, 1);
     273                goto PosChangedEnd;
     274        }
    284275
    285276        if(pswp->fl & (SWP_MOVE | SWP_SIZE)) {
     
    293284        OSLibMapSWPtoWINDOWPOSFrame(pswp, &wp, &swpOld, hParent, hwnd);
    294285
    295         win32wnd->setWindowRect(wp.x, wp.y, wp.x+wp.cx, wp.y+wp.cy);
     286        if(pswp->fl & (SWP_MOVE | SWP_SIZE)) {
     287                win32wnd->setWindowRect(wp.x, wp.y, wp.x+wp.cx, wp.y+wp.cy);
     288
     289                win32wnd->MsgFormatFrame();
     290                //CB: todo: use result for WM_CALCVALIDRECTS
     291                mapWin32ToOS2Rect(WinQueryWindow(hwnd,QW_PARENT),hwnd,win32wnd->getClientRectPtr(),(PRECTLOS2)&rect);
     292
     293                swpClient.hwnd = win32wnd->getOS2WindowHandle();
     294                swpClient.hwndInsertBehind = 0;
     295                swpClient.x  = rect.xLeft;
     296                swpClient.y  = rect.yBottom;
     297                swpClient.cx = rect.xRight-rect.xLeft;
     298                swpClient.cy = rect.yTop-rect.yBottom;
     299                //TODO: Get rid of SWP_SHOW; needed for winhlp32 button bar for now
     300                swpClient.fl = (pswp->fl & ~SWP_ZORDER) | SWP_MOVE | SWP_SHOW;
     301                WinSetMultWindowPos(thdb->hab, &swpClient, 1);
     302        }
    296303
    297304        if(win32wnd->CanReceiveSizeMsgs())
    298305          win32wnd->MsgPosChanged((LPARAM)&wp);
    299306
     307        //update child positions: rectWindow is in window coordinates
     308        if(pswp->fl & (SWP_MOVE | SWP_SIZE)) {
     309                FrameUpdateChildPositions(win32wnd->getOS2WindowHandle());
     310        }
     311
    300312PosChangedEnd:
    301         //update the client rect
    302         RECTL rectl;
    303 
    304         WinQueryWindowRect(win32wnd->getOS2FrameWindowHandle(),&rectl);
    305         mapOS2ToWin32Rect(win32wnd->getOS2FrameWindowHandle(),OSLIB_HWND_DESKTOP,(PRECTLOS2)&rectl,win32wnd->getWindowRect());
    306         WinQueryWindowRect(win32wnd->getOS2WindowHandle(),&rectl);
    307         mapOS2ToWin32Rect(win32wnd->getOS2WindowHandle(),WinQueryWindow(hwnd,QW_PARENT),(PRECTLOS2)&rectl,win32wnd->getClientRectPtr());
    308 
    309         //calls WM_FORMATFRAME if SWP_SIZE is set
    310313        RestoreOS2TIB();
    311         rc = OldFrameProc(hwnd,msg,mp1,mp2);
    312         SetWin32TIB();
    313         //update child positions: rectWindow is in window coordinates
    314         FrameUpdateChildPositions(win32wnd->getOS2WindowHandle());
    315         RestoreOS2TIB();
    316         return rc;
     314        return (MRESULT)FALSE;
    317315    }
    318316
     
    320318    {
    321319      PRECTL oldRect = (PRECTL)mp1,newRect = oldRect+1;
    322       UINT res = CVR_ALIGNLEFT | CVR_ALIGNTOP;
     320      UINT res = 0; //= CVR_ALIGNLEFT | CVR_ALIGNTOP;
    323321
    324322//CB: todo: use WM_NCCALCSIZE result
     
    334332
    335333      //CB: PM sets client window position
    336       RestoreOS2TIB();
    337       OldFrameProc(hwnd,msg,mp1,mp2);
    338       SetWin32TIB();
     334//      RestoreOS2TIB();
     335//      OldFrameProc(hwnd,msg,mp1,mp2);
     336//      SetWin32TIB();
    339337
    340338      RestoreOS2TIB();
  • TabularUnified tags/trunk/src/user32/new/pmwindow.cpp

    r12991 r12998  
    1 /* $Id: pmwindow.cpp,v 1.35 2000-01-11 13:52:18 sandervl Exp $ */
     1/* $Id: pmwindow.cpp,v 1.36 2000-01-12 12:40:46 sandervl Exp $ */
    22/*
    33 * Win32 Window Managment Code for OS/2
     
    245245
    246246    case WM_ADJUSTWINDOWPOS:
    247         goto RunDefWndProc;
     247    {
     248      PSWP      pswp   = (PSWP)mp1;
     249        dprintf(("PMWINDOW: WM_WINDOWPOSCHANGED (%x) %x %x (%d,%d) (%d,%d)", mp2, win32wnd->getWindowHandle(), pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy));
     250        goto RunDefWndProc;
     251    }
    248252
    249253    case WM_WINDOWPOSCHANGED:
     
    366370        break;
    367371
    368     case WM_INITMENU:
    369         win32wnd->MsgInitMenu(pWinMsg);
    370         break;
    371 
    372372    case WM_TIMER:
    373373        win32wnd->DispatchMsgA(pWinMsg);
    374         goto RunDefWndProc;
    375 
    376     case WM_MENUSELECT:
    377     case WM_MENUEND:
    378     case WM_NEXTMENU:
    379374        goto RunDefWndProc;
    380375
     
    434429        goto RunDefWndProc;
    435430
     431    case WM_INITMENU:
     432    case WM_MENUSELECT:
     433    case WM_MENUEND:
     434    case WM_NEXTMENU:
    436435    case WM_SYSCOLORCHANGE:
    437436    case WM_SYSVALUECHANGED:
  • TabularUnified tags/trunk/src/user32/new/user32.rc

    r12892 r12998  
    1 /* $Id: user32.rc,v 1.7 2000-01-03 20:53:50 cbratschi Exp $ */
     1/* $Id: user32.rc,v 1.8 2000-01-12 12:40:46 sandervl Exp $ */
    22/* converted from WINE */
    33
     
    806806#define OCR_APPSTARTING     32650
    807807#define OCR_HELP            32651  /* only defined in Odin */
     808
     809
     810MSGBOX DIALOG 100, 80, 216, 168
     811STYLE DS_SYSMODAL | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
     812BEGIN
     813        ICON "", 1088, 8, 20, 16, 16, WS_CHILD | WS_VISIBLE
     814        LTEXT "", 100, 32, 4, 176, 48, WS_CHILD | WS_VISIBLE | WS_GROUP
     815        PUSHBUTTON "&OK", 1, 16, 56, 40, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP
     816        PUSHBUTTON "&Cancel", 2, 64, 56, 40, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP
     817        PUSHBUTTON "&Abort", 3, 112, 56, 40, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP
     818        PUSHBUTTON "&Retry", 4, 160, 56, 40, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP
     819        PUSHBUTTON "&Ignore", 5, 208, 56, 40, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP
     820        PUSHBUTTON "&Yes", 6, 256, 56, 40, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP
     821        PUSHBUTTON "&No", 7, 304, 56, 40, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP
     822END
     823
    808824
    809825/////////////////////////////////////////////////////////////////////////////
  • TabularUnified tags/trunk/src/user32/new/win32wbase.cpp

    r12993 r12998  
    1 /* $Id: win32wbase.cpp,v 1.34 2000-01-11 17:34:43 cbratschi Exp $ */
     1/* $Id: win32wbase.cpp,v 1.35 2000-01-12 12:40:47 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    10231023}
    10241024//******************************************************************************
    1025 //TODO: Depending on menu type, we should send WM_INITMENU or WM_INITPOPUPMENU
    1026 //TODO: PM sends it for each submenu that gets activated; Windows only for the first
    1027 //      submenu; once the menu bar is active, moving the cursor doesn't generate other
    1028 //      WM_INITMENU msgs. Not really a problem, but might need to fix this later on.
    1029 //******************************************************************************
    1030 ULONG Win32BaseWindow::MsgInitMenu(MSG *msg)
    1031 {
    1032     return SendInternalMessageA(msg->message, msg->wParam, msg->lParam);
    1033 }
    1034 //******************************************************************************
    10351025//******************************************************************************
    10361026ULONG Win32BaseWindow::MsgNCPaint()
     
    10611051
    10621052    return rc;
    1063   } else return 0;
     1053  }
     1054  else return 0;
    10641055}
    10651056//******************************************************************************
     
    11001091    SendInternalMessageA(WM_GETTEXT, wndNameLength, (LPARAM)windowNameA);
    11011092    return windowNameA;
    1102 }
    1103 //******************************************************************************
    1104 //******************************************************************************
    1105 ULONG  Win32BaseWindow::MsgContextMenu(ULONG x,ULONG y)
    1106 {
    1107   return SendInternalMessageA(WM_CONTEXTMENU,Win32Hwnd,MAKELPARAM(x,y));
    11081093}
    11091094//******************************************************************************
  • TabularUnified tags/trunk/src/user32/new/win32wbase.h

    r12993 r12998  
    1 /* $Id: win32wbase.h,v 1.24 2000-01-11 17:34:44 cbratschi Exp $ */
     1/* $Id: win32wbase.h,v 1.25 2000-01-12 12:40:49 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    115115         ULONG  MsgPaint(ULONG tmp1, BOOL select = TRUE);
    116116         ULONG  MsgEraseBackGround(HDC hdc);
    117          ULONG  MsgInitMenu(MSG *msg);
    118117         ULONG  MsgHitTest(ULONG x, ULONG y);
    119118         ULONG  MsgNCPaint();
     
    125124         ULONG  MsgGetTextLength();
    126125         char  *MsgGetText();
    127          ULONG  MsgContextMenu(ULONG x,ULONG y);
    128126         VOID   updateWindowStyle(DWORD oldExStyle,DWORD oldStyle);
    129127
Note: See TracChangeset for help on using the changeset viewer.