Changeset 2353 for trunk/src


Ignore:
Timestamp:
Jan 7, 2000, 6:38:48 PM (26 years ago)
Author:
cbratschi
Message:

* empty log message *

Location:
trunk/src/user32/new
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/user32/new/dc.cpp

    r2317 r2353  
    1 /* $Id: dc.cpp,v 1.9 2000-01-04 19:51:32 sandervl Exp $ */
     1/* $Id: dc.cpp,v 1.10 2000-01-07 17:38:46 cbratschi Exp $ */
    22
    33/*
     
    584584         pRect->left = pRect->top = pRect->right = pRect->bottom = 0;
    585585   }
     586
     587   return updateRegionExists;
     588}
     589
     590//functions for WM_NCPAINT
     591
     592INT SYSTEM GetOS2UpdateRgn(HWND hwnd,HRGN hrgn)
     593{
     594  return O32_GetUpdateRgn(hwnd,hrgn,FALSE);
     595}
     596
     597BOOL SYSTEM GetOS2UpdateRect(HWND hwnd,LPRECT pRect)
     598{
     599   RECTL rectl;
     600   BOOL updateRegionExists = WinQueryUpdateRect(hwnd,pRect ? &rectl:NULL);
     601
     602   if (!pRect)
     603     return (updateRegionExists);
     604
     605   if (updateRegionExists)
     606     mapOS2ToWin32Rect(hwnd,(PRECTLOS2)&rectl,pRect);
     607   else
     608     pRect->left = pRect->top = pRect->right = pRect->bottom = 0;
    586609
    587610   return updateRegionExists;
     
    14511474 *             display any portion of a window that lies outside of the window region
    14521475 *             When this function is called, the system sends the WM_WINDOWPOSCHANGING and
    1453  *             WM_WINDOWPOSCHANGED messages to the window. 
     1476 *             WM_WINDOWPOSCHANGED messages to the window.
    14541477 *
    14551478 * Parameters: HWND  hWnd    handle to window whose window region is to be set
     
    14801503    dprintf(("USER32:SetWindowRgn (%x,%x,%d)", hwnd, hRgn, bRedraw));
    14811504    if(window->GetWindowRegion()) {
    1482         O32_DeleteObject(window->GetWindowRegion());
     1505        O32_DeleteObject(window->GetWindowRegion());
    14831506    }
    14841507    window->SetWindowRegion(hRgn);
    14851508    if(bRedraw) {
    1486         RedrawWindow(hwnd, 0, 0, RDW_UPDATENOW_W);     
     1509        RedrawWindow(hwnd, 0, 0, RDW_UPDATENOW_W);
    14871510    }
    14881511//TODO:
    14891512//  When this function is called, the system sends the WM_WINDOWPOSCHANGING and
    1490 //  WM_WINDOWPOSCHANGED messages to the window. 
     1513//  WM_WINDOWPOSCHANGED messages to the window.
    14911514    return 1;
    14921515}
  • trunk/src/user32/new/oslibmsgtranslate.cpp

    r2335 r2353  
    1 /* $Id: oslibmsgtranslate.cpp,v 1.5 2000-01-05 21:25:04 cbratschi Exp $ */
     1/* $Id: oslibmsgtranslate.cpp,v 1.6 2000-01-07 17:38:47 cbratschi Exp $ */
    22/*
    33 * Window message translation functions for OS/2
     
    141141      case WM_BUTTON3DBLCLK:
    142142        //WM_NC*BUTTON* is posted when the cursor is in a non-client area of the window
    143         if((win32wnd->lastHitTestVal != HTCLIENT_W) && (WinQueryCapture(HWND_DESKTOP) != win32wnd->getOS2WindowHandle())) {
     143        if(win32wnd->lastHitTestVal != HTCLIENT_W) {
    144144            winMsg->message = WINWM_NCLBUTTONDOWN + (os2Msg->msg - WM_BUTTON1DOWN);
    145145            winMsg->wParam  = win32wnd->lastHitTestVal;
     
    185185
    186186        //WM_NCMOUSEMOVE is posted when the cursor moves into a non-client area of the window
    187         if((win32wnd->lastHitTestVal != HTCLIENT_W) && (WinQueryCapture(HWND_DESKTOP) != win32wnd->getOS2WindowHandle()))
     187        if(win32wnd->lastHitTestVal != HTCLIENT_W)
    188188        {
    189189          setcursormsg   = WINWM_NCMOUSEMOVE;
     
    332332    case WM_BUTTON3DBLCLK:
    333333        //WM_NC*BUTTON* is posted when the cursor is in a non-client area of the window
    334         if((win32wnd->lastHitTestVal != HTCLIENT_W) && (WinQueryCapture(HWND_DESKTOP) != win32wnd->getOS2WindowHandle())) {
     334        if(win32wnd->lastHitTestVal != HTCLIENT_W) {
    335335            winMsg->message = WINWM_NCLBUTTONDOWN + (os2Msg->msg - WM_BUTTON1DOWN);
    336336            winMsg->wParam  = win32wnd->lastHitTestVal;
     
    376376
    377377        //WM_NCMOUSEMOVE is posted when the cursor moves into a non-client area of the window
    378         if((win32wnd->lastHitTestVal != HTCLIENT_W) && (WinQueryCapture(HWND_DESKTOP) != win32wnd->getOS2WindowHandle()))
     378        if(win32wnd->lastHitTestVal != HTCLIENT_W)
    379379        {
    380380          setcursormsg   = WINWM_NCMOUSEMOVE;
  • trunk/src/user32/new/pmframe.cpp

    r2340 r2353  
    1 /* $Id: pmframe.cpp,v 1.6 2000-01-06 17:05:52 cbratschi Exp $ */
     1/* $Id: pmframe.cpp,v 1.7 2000-01-07 17:38:47 cbratschi Exp $ */
    22/*
    33 * Win32 Frame Managment Code for OS/2
     
    481481
    482482PosChangedEnd:
     483        //update the client rect
     484        RECTL rectl;
     485
     486        WinQueryWindowRect(win32wnd->getOS2WindowHandle(),&rectl);
     487        mapOS2ToWin32Rect(win32wnd->getOS2WindowHandle(),WinQueryWindow(hwnd,QW_PARENT),(PRECTLOS2)&rectl,win32wnd->getClientRectPtr());
     488
    483489        //calls WM_FORMATFRAME if SWP_SIZE is set
    484490        RestoreOS2TIB();
    485491        rc = OldFrameProc(hwnd,msg,mp1,mp2);
    486         SetWin32TIB();
    487 
    488         RestoreOS2TIB();
    489492        return rc;
    490493    }
  • trunk/src/user32/new/win32wbase.cpp

    r2340 r2353  
    1 /* $Id: win32wbase.cpp,v 1.23 2000-01-06 17:05:52 cbratschi Exp $ */
     1/* $Id: win32wbase.cpp,v 1.24 2000-01-07 17:38:47 cbratschi Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    713713  if (SendInternalMessageA(WM_NCCREATE,0,(LPARAM)cs))
    714714  {
    715         RECT rect;
    716 
    717715        //update rect
    718716        rectWindow.left = cs->x;
     
    720718        rectWindow.top = cs->y;
    721719        rectWindow.bottom = cs->y+cs->cy;
    722         rectClient = rectWindow;
    723720        if (getParent()) MapWindowPoints(getParent()->getWindowHandle(),0,(PPOINT)&rectWindow,2);
    724721        OffsetRect(&rectWindow, maxPos.x - rectWindow.left, maxPos.y - rectWindow.top);
     722        rectClient = rectWindow;
     723        if (getParent()) MapWindowPoints(0,getParent()->getWindowHandle(),(PPOINT)&rectClient,2);
    725724        //set the window size and update the client
    726         rect = rectWindow;
    727         if (getParent()) MapWindowPoints(0,getParent()->getWindowHandle(),(PPOINT)&rect,2);
    728         SetWindowPos(hwndLinkAfter,rect.left,rect.top,rect.right-rect.left,rect.bottom-rect.top,SWP_NOACTIVATE | SWP_NOREDRAW | SWP_FRAMECHANGED);
     725        SetWindowPos(hwndLinkAfter,rectClient.left,rectClient.top,rectClient.right-rectClient.left,rectClient.bottom-rectClient.top,SWP_NOACTIVATE | SWP_NOREDRAW | SWP_FRAMECHANGED);
    729726        fNoSizeMsg = FALSE;
    730727        if( (SendInternalMessageA(WM_CREATE, 0, (LPARAM)cs )) != -1 )
     
    11031100ULONG Win32BaseWindow::MsgNCPaint()
    11041101{
    1105   HRGN hrgn;
    1106 
    1107   hrgn = 0; //CB: todo: set to frame update region
    1108   return SendInternalMessageA(WM_NCPAINT,hrgn,0);
     1102  RECT rect;
     1103
     1104  if (GetOS2UpdateRect(OS2HwndFrame,&rect))
     1105  {
     1106    HRGN hrgn;
     1107    ULONG rc;
     1108    RECT client = rectClient;
     1109
     1110//CB: bug in dc.cpp!!!
     1111    if ((rect.left == rect.right) || (rect.bottom == rect.top)) return 0;
     1112    mapWin32Rect(getParent() ? getParent()->getOS2WindowHandle():OSLIB_HWND_DESKTOP,OS2HwndFrame,&client);
     1113    if ((rect.left >= client.left) && (rect.left < client.right) &&
     1114        (rect.right >= client.left) && (rect.right < client.right) &&
     1115        (rect.top  >= client.top) && (rect.top < client.bottom) &&
     1116        (rect.bottom >= client.top) && (rect.bottom < client.bottom))
     1117      return 0;
     1118    hrgn = CreateRectRgnIndirect(&rect);
     1119    if (!hrgn) return 0;
     1120//CB: bug in GetDCEx with region!!!
     1121    rc = SendInternalMessageA(WM_NCPAINT,/*hrgn*/0,0);
     1122dprintf(("CB: %d %d %d %d",rect.left,rect.top,rect.bottom,rect.right));
     1123    DeleteObject(hrgn);
     1124    //CB: todo: check if intersection with client
     1125
     1126    return rc;
     1127  } else return 0;
    11091128}
    11101129//******************************************************************************
     
    13431362        DrawMaxButton(hdc,pressed,FALSE);
    13441363    }
    1345   } while (msg.message != WM_LBUTTONUP);
     1364  } while ((msg.message != WM_LBUTTONUP) && (msg.message != WM_NCLBUTTONUP));
    13461365  if (wParam == HTMINBUTTON)
    13471366    DrawMinButton(hdc,FALSE,FALSE);
     
    13721391    return;
    13731392  state = GetMenuState(hSysMenu, SC_CLOSE, MF_BYCOMMAND);
     1393#else
     1394state = 0;
    13741395#endif
    13751396  /* If the item close of the sysmenu is disabled or not there do nothing */
     
    13871408    if (pressed != oldstate)
    13881409      DrawCloseButton(hdc, pressed, FALSE);
    1389   } while (msg.message != WM_LBUTTONUP);
    1390   DrawCloseButton(hdc, FALSE, FALSE);
     1410  } while ((msg.message != WM_LBUTTONUP) && (msg.message != WM_NCLBUTTONUP));
     1411  DrawCloseButton(hdc,FALSE,FALSE);
    13911412  ReleaseCapture();
    1392   ReleaseDC(Win32Hwnd, hdc );
     1413  ReleaseDC(Win32Hwnd,hdc);
    13931414  if (!pressed) return;
    13941415  SendInternalMessageA(WM_SYSCOMMAND,SC_CLOSE,*(LPARAM*)&msg.pt);
     
    14591480//******************************************************************************
    14601481//******************************************************************************
    1461 LONG Win32BaseWindow::HandleNCLButtonUp(WPARAM wParam,LPARAM lParam)
    1462 {
    1463   switch(wParam)  /* Hit test */
    1464   {
    1465     case HTMINBUTTON:
    1466       SendInternalMessageA(WM_SYSCOMMAND,SC_MINIMIZE,lParam);
    1467       break;
    1468 
    1469     case HTMAXBUTTON:
    1470       SendInternalMessageA(WM_SYSCOMMAND,SC_MAXIMIZE,lParam);
    1471       break;
    1472 
    1473     case HTCLOSE:
    1474       SendInternalMessageA(WM_SYSCOMMAND,SC_CLOSE,lParam);
    1475       break;
    1476   }
    1477 
    1478   return 0;
    1479 }
    1480 //******************************************************************************
    1481 //******************************************************************************
    14821482BOOL Win32BaseWindow::WindowNeedsWMBorder()
    14831483{
     
    17701770{
    17711771  INT width, height;
     1772  HBRUSH oldBrush;
    17721773
    17731774  if (dlgFrame)
     
    17811782  }
    17821783
    1783   SelectObject( hdc, GetSysColorBrush(active ? COLOR_ACTIVEBORDER :
    1784                 COLOR_INACTIVEBORDER) );
     1784  oldBrush = SelectObject(hdc,GetSysColorBrush(active ? COLOR_ACTIVEBORDER:COLOR_INACTIVEBORDER));
    17851785
    17861786  /* Draw frame */
    1787   PatBlt( hdc, rect->left, rect->top,
    1788             rect->right - rect->left, height, PATCOPY );
    1789   PatBlt( hdc, rect->left, rect->top,
    1790             width, rect->bottom - rect->top, PATCOPY );
    1791   PatBlt( hdc, rect->left, rect->bottom - 1,
    1792             rect->right - rect->left, -height, PATCOPY );
    1793   PatBlt( hdc, rect->right - 1, rect->top,
    1794             -width, rect->bottom - rect->top, PATCOPY );
    1795 
    1796   InflateRect( rect, -width, -height );
     1787
     1788  PatBlt(hdc,rect->left,rect->top,rect->right-rect->left,height,PATCOPY);
     1789  PatBlt(hdc,rect->left,rect->top,width,rect->bottom-rect->top,PATCOPY);
     1790  PatBlt(hdc,rect->left,rect->bottom-1,rect->right-rect->left,-height,PATCOPY);
     1791  PatBlt(hdc,rect->right-1,rect->top,-width,rect->bottom-rect->top,PATCOPY);
     1792  SelectObject(hdc,oldBrush);
     1793
     1794  InflateRect(rect,-width,-height);
    17971795}
    17981796//******************************************************************************
     
    20022000    /* Go get the sysmenu */
    20032001    state = GetMenuState(hSysMenu, SC_CLOSE, MF_BYCOMMAND);
     2002#else
     2003state = 0;
    20042004#endif
    20052005    /* Draw a grayed close button if disabled and a normal one if SC_CLOSE is not there */
     
    21372137    r.top  = r.bottom - GetSystemMetrics(SM_CYHSCROLL) + 1;
    21382138    FillRect( hdc, &r,  GetSysColorBrush(COLOR_SCROLLBAR) );
     2139    //CB: todo: use scroll code for size grip
    21392140  }
    21402141
     
    22942295    case SC_SCREENSAVE:
    22952296        if (wParam == SC_ABOUTWINE)
    2296             ShellAboutA(hwnd, "Odin", WINE_RELEASE_INFO, 0);
     2297            ShellAboutA(hwnd, "Odin", ODIN_RELEASE_INFO, 0);
    22972298        else
    22982299        if (wParam == SC_PUTMARK)
    22992300            dprintf(("Mark requested by user\n"));
    23002301        break;
    2301 
     2302#endif
    23022303    case SC_HOTKEY:
    23032304    case SC_ARRANGE:
     
    23052306    case SC_PREVWINDOW:
    23062307        break;
    2307 #endif
    23082308    }
    23092309    return 0;
     
    24682468    case WM_NCACTIVATE:
    24692469        return HandleNCActivate(wParam);
    2470         return TRUE;
    24712470
    24722471    case WM_NCCREATE:
     
    25122511
    25132512    case WM_ACTIVATE:
    2514       //CB: todo
    25152513      return 0;
    25162514
     
    26422640        return HandleNCLButtonDown(wParam,lParam);
    26432641
    2644     case WM_NCLBUTTONUP:
    2645         return HandleNCLButtonUp(wParam,lParam);
    2646 
     2642    case WM_LBUTTONDBLCLK:
    26472643    case WM_NCLBUTTONDBLCLK:
    26482644        return HandleNCLButtonDblClk(wParam,lParam);
  • trunk/src/user32/new/win32wbase.h

    r2335 r2353  
    1 /* $Id: win32wbase.h,v 1.17 2000-01-05 21:25:08 cbratschi Exp $ */
     1/* $Id: win32wbase.h,v 1.18 2000-01-07 17:38:48 cbratschi Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    363363        VOID  TrackCloseButton(WORD wParam);
    364364        LONG  HandleNCLButtonDown(WPARAM wParam,LPARAM lParam);
    365         LONG  HandleNCLButtonUp(WPARAM wParam,LPARAM lParam);
    366365        LONG  HandleNCLButtonDblClk(WPARAM wParam,LPARAM lParam);
    367366        BOOL  WindowNeedsWMBorder();
Note: See TracChangeset for help on using the changeset viewer.