Changeset 2377 for trunk/src


Ignore:
Timestamp:
Jan 8, 2000, 5:47:50 PM (26 years ago)
Author:
cbratschi
Message:

* empty log message *

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

Legend:

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

    r2290 r2377  
    1 /* $Id: button.cpp,v 1.13 2000-01-01 14:57:08 cbratschi Exp $ */
     1/* $Id: button.cpp,v 1.14 2000-01-08 16:47:45 cbratschi Exp $ */
    22/* File: button.cpp -- Button type widgets
    33 *
     
    239239  POINT pt;
    240240
    241   if (style == BS_GROUPBOX) return 0;
    242241  pt.x = LOWORD(lParam);
    243242  pt.y = HIWORD(lParam);
     
    315314  DWORD style = GetWindowLongA(hwnd,GWL_STYLE) & 0x0f;
    316315
    317   if (style == BS_GROUPBOX) return HTTRANSPARENT;
     316  //if (style == BS_GROUPBOX) return HTTRANSPARENT;
    318317
    319318  return DefWindowProcA(hwnd,WM_NCHITTEST,wParam,lParam);
  • trunk/src/user32/new/oslibmsgtranslate.cpp

    r2353 r2377  
    1 /* $Id: oslibmsgtranslate.cpp,v 1.6 2000-01-07 17:38:47 cbratschi Exp $ */
     1/* $Id: oslibmsgtranslate.cpp,v 1.7 2000-01-08 16:47:46 cbratschi Exp $ */
    22/*
    33 * Window message translation functions for OS/2
     
    102102//******************************************************************************
    103103//******************************************************************************
     104ULONG GetMouseKeyState()
     105{
     106  ULONG keystate;
     107
     108  if(WinGetKeyState(HWND_DESKTOP, VK_BUTTON1) & 0x8000)
     109    keystate |= MK_LBUTTON_W;
     110  if(WinGetKeyState(HWND_DESKTOP, VK_BUTTON2) & 0x8000)
     111    keystate |= MK_RBUTTON_W;
     112  if(WinGetKeyState(HWND_DESKTOP, VK_BUTTON3) & 0x8000)
     113    keystate |= MK_MBUTTON_W;
     114  if(WinGetKeyState(HWND_DESKTOP, VK_SHIFT) & 0x8000)
     115    keystate |= MK_SHIFT_W;
     116  if(WinGetKeyState(HWND_DESKTOP, VK_CTRL) & 0x8000)
     117    keystate |= MK_CONTROL_W;
     118
     119  return keystate;
     120}
     121//******************************************************************************
     122//******************************************************************************
     123LONG IsNCMouseMsg(Win32BaseWindow *win32wnd)
     124{
     125  return ((win32wnd->getLastHitTestVal() != HTCLIENT_W) && (WinQueryCapture(HWND_DESKTOP) != win32wnd->getOS2WindowHandle()));
     126}
     127//******************************************************************************
     128//******************************************************************************
    104129BOOL OS2ToWinMsgTranslate(void *pThdb, QMSG *os2Msg, MSG *winMsg, BOOL isUnicode, BOOL fMsgRemoved)
    105130{
     
    141166      case WM_BUTTON3DBLCLK:
    142167        //WM_NC*BUTTON* is posted when the cursor is in a non-client area of the window
    143         if(win32wnd->lastHitTestVal != HTCLIENT_W) {
     168        if (IsNCMouseMsg(win32wnd)) {
    144169            winMsg->message = WINWM_NCLBUTTONDOWN + (os2Msg->msg - WM_BUTTON1DOWN);
    145170            winMsg->wParam  = win32wnd->lastHitTestVal;
     
    153178
    154179            winMsg->message = WINWM_LBUTTONDOWN + (os2Msg->msg - WM_BUTTON1DOWN);
     180            winMsg->wParam  = GetMouseKeyState();
    155181            winMsg->lParam  = MAKELONG(ClientPoint.x, ClientPoint.y); //client coordinates
    156182        }
     
    171197      case WM_MOUSEMOVE:
    172198      {
    173         ULONG keystate = 0, setcursormsg = WINWM_MOUSEMOVE;
    174 
    175         if(WinGetKeyState(HWND_DESKTOP, VK_BUTTON1) & 0x8000)
    176             keystate |= MK_LBUTTON_W;
    177         if(WinGetKeyState(HWND_DESKTOP, VK_BUTTON2) & 0x8000)
    178             keystate |= MK_RBUTTON_W;
    179         if(WinGetKeyState(HWND_DESKTOP, VK_BUTTON3) & 0x8000)
    180             keystate |= MK_MBUTTON_W;
    181         if(WinGetKeyState(HWND_DESKTOP, VK_SHIFT) & 0x8000)
    182             keystate |= MK_SHIFT_W;
    183         if(WinGetKeyState(HWND_DESKTOP, VK_CTRL) & 0x8000)
    184             keystate |= MK_CONTROL_W;
    185 
    186199        //WM_NCMOUSEMOVE is posted when the cursor moves into a non-client area of the window
    187         if(win32wnd->lastHitTestVal != HTCLIENT_W)
    188         {
    189           setcursormsg  = WINWM_NCMOUSEMOVE;
    190           winMsg->wParam = (WPARAM)win32wnd->lastHitTestVal;
    191           winMsg->lParam = MAKELONG(winMsg->pt.x,winMsg->pt.y);
     200        if(IsNCMouseMsg(win32wnd))
     201        {
     202          winMsg->message = WINWM_NCMOUSEMOVE;
     203          winMsg->wParam  = (WPARAM)win32wnd->lastHitTestVal;
     204          winMsg->lParam  = MAKELONG(winMsg->pt.x,winMsg->pt.y);
    192205        } else
    193206        {
    194           winMsg->wParam = (WPARAM)keystate;
     207          winMsg->message = WINWM_MOUSEMOVE;
     208          winMsg->wParam  = GetMouseKeyState();
    195209          winMsg->lParam  = MAKELONG(SHORT1FROMMP(os2Msg->mp1),mapOS2ToWin32Y(win32wnd->getOS2FrameWindowHandle(),win32wnd->getOS2WindowHandle(),SHORT2FROMMP(os2Msg->mp1)));
    196210        }
    197211        //OS/2 Window coordinates -> Win32 Window coordinates
    198         winMsg->message = setcursormsg;
    199212        return TRUE;
    200213      }
     
    332345    case WM_BUTTON3DBLCLK:
    333346        //WM_NC*BUTTON* is posted when the cursor is in a non-client area of the window
    334         if(win32wnd->lastHitTestVal != HTCLIENT_W) {
     347        if(IsNCMouseMsg(win32wnd)) {
    335348            winMsg->message = WINWM_NCLBUTTONDOWN + (os2Msg->msg - WM_BUTTON1DOWN);
    336349            winMsg->wParam  = win32wnd->lastHitTestVal;
     
    344357
    345358            winMsg->message = WINWM_LBUTTONDOWN + (os2Msg->msg - WM_BUTTON1DOWN);
     359            winMsg->wParam  = GetMouseKeyState();
    346360            winMsg->lParam  = MAKELONG(ClientPoint.x, ClientPoint.y); //client coordinates
    347361        }
     
    362376    case WM_MOUSEMOVE:
    363377    {
    364         ULONG keystate = 0, setcursormsg = WINWM_MOUSEMOVE;
    365 
    366         if(WinGetKeyState(HWND_DESKTOP, VK_BUTTON1) & 0x8000)
    367             keystate |= MK_LBUTTON_W;
    368         if(WinGetKeyState(HWND_DESKTOP, VK_BUTTON2) & 0x8000)
    369             keystate |= MK_RBUTTON_W;
    370         if(WinGetKeyState(HWND_DESKTOP, VK_BUTTON3) & 0x8000)
    371             keystate |= MK_MBUTTON_W;
    372         if(WinGetKeyState(HWND_DESKTOP, VK_SHIFT) & 0x8000)
    373             keystate |= MK_SHIFT_W;
    374         if(WinGetKeyState(HWND_DESKTOP, VK_CTRL) & 0x8000)
    375             keystate |= MK_CONTROL_W;
    376 
    377378        //WM_NCMOUSEMOVE is posted when the cursor moves into a non-client area of the window
    378         if(win32wnd->lastHitTestVal != HTCLIENT_W)
    379         {
    380           setcursormsg  = WINWM_NCMOUSEMOVE;
    381           winMsg->wParam = (WPARAM)win32wnd->lastHitTestVal;
    382           winMsg->lParam = MAKELONG(winMsg->pt.x,winMsg->pt.y);
     379        if(IsNCMouseMsg(win32wnd))
     380        {
     381          winMsg->message = WINWM_NCMOUSEMOVE;
     382          winMsg->wParam  = (WPARAM)win32wnd->lastHitTestVal;
     383          winMsg->lParam  = MAKELONG(winMsg->pt.x,winMsg->pt.y);
    383384        } else
    384385        {
    385           winMsg->wParam = (WPARAM)keystate;
     386          winMsg->message = WINWM_MOUSEMOVE;
     387          winMsg->wParam  = GetMouseKeyState();
    386388          winMsg->lParam  = MAKELONG(SHORT1FROMMP(os2Msg->mp1),mapY(win32wnd,SHORT2FROMMP(os2Msg->mp1)));
    387389        }
    388390        //OS/2 Window coordinates -> Win32 Window coordinates
    389         winMsg->message = setcursormsg;
    390391        break;
    391392    }
  • trunk/src/user32/new/pmframe.cpp

    r2353 r2377  
    1 /* $Id: pmframe.cpp,v 1.7 2000-01-07 17:38:47 cbratschi Exp $ */
     1/* $Id: pmframe.cpp,v 1.8 2000-01-08 16:47:47 cbratschi Exp $ */
    22/*
    33 * Win32 Frame Managment Code for OS/2
     
    210210}
    211211//******************************************************************************
     212//******************************************************************************
     213VOID FrameUpdateChildPositions(HWND hwnd)
     214{
     215  HENUM henum;
     216  HWND hchild;
     217  RECTL rectl;
     218
     219  henum = WinBeginEnumWindows(hwnd);
     220  while ((hchild = WinGetNextWindow(henum)) != NULLHANDLE)
     221  {
     222    Win32BaseWindow *child = Win32BaseWindow::GetWindowFromOS2FrameHandle(hchild);
     223
     224    if (child)
     225    {
     226      WinQueryWindowRect(child->getOS2FrameWindowHandle(),&rectl);
     227      mapOS2ToWin32Rect(child->getOS2FrameWindowHandle(),OSLIB_HWND_DESKTOP,(PRECTLOS2)&rectl,child->getWindowRect());
     228      FrameUpdateChildPositions(child->getOS2WindowHandle());
     229    }
     230  }
     231  WinEndEnumWindows(henum);
     232}
     233//******************************************************************************
    212234//Win32 frame message handler
    213235//******************************************************************************
     
    273295      win32wnd->MsgFormatFrame();
    274296      //CB: todo: use result for WM_CALCVALIDRECTS
    275       mapWin32ToOS2Rect(WinQueryWindow(hwnd,QW_PARENT),win32wnd->getClientRectPtr(),(PRECTLOS2)&rect);
    276       WinMapWindowPoints(WinQueryWindow(hwnd,QW_PARENT),hwnd,(PPOINTL)&rect,2);
    277       dprintf(("New client position: %d %d %d %d",rect.xLeft,rect.yBottom,rect.xRight,rect.yTop));
     297      mapWin32ToOS2Rect(WinQueryWindow(hwnd,QW_PARENT),hwnd,win32wnd->getClientRectPtr(),(PRECTLOS2)&rect);
    278298      swpClient = &pswp[ccount-1];
    279299      swpClient->x = rect.xLeft;
     
    281301      swpClient->cx = rect.xRight-rect.xLeft;
    282302      swpClient->cy = rect.yTop-rect.yBottom;
     303      dprintf(("New client position: x=%d y=%d w=%d h=%d",swpClient->x,swpClient->y,swpClient->cx,swpClient->cy));
    283304      RestoreOS2TIB();
    284305      return (MRESULT)ccount;
     
    286307
    287308    case WM_MINMAXFRAME:
     309    {
     310      PSWP swp = (PSWP)mp1;
     311
     312      if (!win32wnd->IsWindowCreated()) goto RunDefFrameProc;
    288313      dprintf(("PMFRAME: WM_MINMAXFRAME %x",hwnd));
    289       //CB: todo
     314      if ((swp->fl & SWP_MAXIMIZE) == SWP_MAXIMIZE)
     315      {
     316        win32wnd->setStyle((win32wnd->getStyle() & ~WS_MINIMIZE_W) | WS_MAXIMIZE_W);
     317      } else if ((swp->fl & SWP_MINIMIZE) == SWP_MINIMIZE)
     318      {
     319        win32wnd->setStyle((win32wnd->getStyle() & ~WS_MAXIMIZE_W) | WS_MINIMIZE_W);
     320      } else if ((swp->fl & SWP_RESTORE) == SWP_RESTORE)
     321      {
     322        win32wnd->setStyle(win32wnd->getStyle() & ~(WS_MINIMIZE_W | WS_MAXIMIZE_W));
     323      }
    290324      goto RunDefFrameProc;
     325    }
    291326
    292327    case WM_QUERYBORDERSIZE:
     
    303338    case WM_BUTTON3DBLCLK:
    304339    {
    305         SWP swp;
    306 
    307         WinQueryWindowPos(hwnd,&swp);
    308         if ((swp.fl & SWP_MINIMIZE) == SWP_MINIMIZE)
    309           goto RunDefFrameProc;
    310340        if (win32wnd->IsWindowCreated())
    311341        {
     
    330360    case WM_MOUSEMOVE:
    331361    {
    332         SWP swp;
    333 
    334         WinQueryWindowPos(hwnd,&swp);
    335         if ((swp.fl & SWP_MINIMIZE) == SWP_MINIMIZE)
    336           goto RunDefFrameProc;
    337362        //OS/2 Window coordinates -> Win32 Window coordinates
    338363        if (win32wnd->IsWindowCreated())
     
    345370    {
    346371      DWORD res;
    347       SWP swp;
    348 
    349       WinQueryWindowPos(hwnd,&swp);
    350       if ((swp.fl & SWP_MINIMIZE) == SWP_MINIMIZE)
    351         goto RunDefFrameProc;
    352372
    353373      // Only send this message if the window is enabled
     
    373393    case WM_PAINT:
    374394    {
    375         SWP swp;
    376 
    377         WinQueryWindowPos(hwnd,&swp);
    378         if ((swp.fl & SWP_MINIMIZE) == SWP_MINIMIZE)
    379           goto RunDefFrameProc;
    380395        dprintf(("PMFRAME: WM_PAINT"));
     396        if (win32wnd->getStyle() & WS_MINIMIZE_W)
     397         goto RunDefFrameProc;
    381398        if (win32wnd->IsWindowCreated())
    382399          win32wnd->MsgNCPaint();
     
    416433
    417434        WinQueryWindowPos(hwnd, &swpOld);
    418 
    419435        if(pswp->fl & (SWP_MOVE | SWP_SIZE)) {
    420436            if (win32wnd->isChild()) {
     
    484500        RECTL rectl;
    485501
     502        WinQueryWindowRect(win32wnd->getOS2FrameWindowHandle(),&rectl);
     503        mapOS2ToWin32Rect(win32wnd->getOS2FrameWindowHandle(),OSLIB_HWND_DESKTOP,(PRECTLOS2)&rectl,win32wnd->getWindowRect());
    486504        WinQueryWindowRect(win32wnd->getOS2WindowHandle(),&rectl);
    487505        mapOS2ToWin32Rect(win32wnd->getOS2WindowHandle(),WinQueryWindow(hwnd,QW_PARENT),(PRECTLOS2)&rectl,win32wnd->getClientRectPtr());
     
    490508        RestoreOS2TIB();
    491509        rc = OldFrameProc(hwnd,msg,mp1,mp2);
     510        SetWin32TIB();
     511        //update child positions: rectWindow is in window coordinates
     512        FrameUpdateChildPositions(win32wnd->getOS2WindowHandle());
     513        RestoreOS2TIB();
    492514        return rc;
    493515    }
  • trunk/src/user32/new/pmframe.h

    r2290 r2377  
    1 /* $Id: pmframe.h,v 1.1 2000-01-01 14:54:53 cbratschi Exp $ */
     1/* $Id: pmframe.h,v 1.2 2000-01-08 16:47:48 cbratschi Exp $ */
    22/*
    33 * Win32 Frame Managment Code for OS/2
     
    5959VOID FrameTrackFrame(Win32BaseWindow *win32wnd,DWORD flags);
    6060
     61#define WS_MINIMIZE_W      0x20000000L
     62#define WS_MAXIMIZE_W      0x01000000L
     63
    6164#endif
  • trunk/src/user32/new/win32wbase.cpp

    r2353 r2377  
    1 /* $Id: win32wbase.cpp,v 1.24 2000-01-07 17:38:47 cbratschi Exp $ */
     1/* $Id: win32wbase.cpp,v 1.25 2000-01-08 16:47:48 cbratschi Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    700700  rectWindow.bottom = cs->y+cs->cy;
    701701  rectClient = rectWindow; //dummy client rect
    702   if (getParent()) MapWindowPoints(getParent()->getWindowHandle(),0,(PPOINT)&rectWindow,2);
     702  if (getParent()) mapWin32Rect(getParent()->getOS2WindowHandle(),OSLIB_HWND_DESKTOP,&rectWindow);
    703703  /* Send the WM_CREATE message
    704704   * Perhaps we shouldn't allow width/height changes as well.
     
    718718        rectWindow.top = cs->y;
    719719        rectWindow.bottom = cs->y+cs->cy;
    720         if (getParent()) MapWindowPoints(getParent()->getWindowHandle(),0,(PPOINT)&rectWindow,2);
     720        if (getParent()) mapWin32Rect(getParent()->getOS2WindowHandle(),OSLIB_HWND_DESKTOP,&rectWindow);
    721721        OffsetRect(&rectWindow, maxPos.x - rectWindow.left, maxPos.y - rectWindow.top);
    722722        rectClient = rectWindow;
    723         if (getParent()) MapWindowPoints(0,getParent()->getWindowHandle(),(PPOINT)&rectClient,2);
     723        if (getParent()) mapWin32Rect(OSLIB_HWND_DESKTOP,getParent()->getOS2WindowHandle(),&rectClient);
    724724        //set the window size and update the client
    725725        SetWindowPos(hwndLinkAfter,rectClient.left,rectClient.top,rectClient.right-rectClient.left,rectClient.bottom-rectClient.top,SWP_NOACTIVATE | SWP_NOREDRAW | SWP_FRAMECHANGED);
    726726        fNoSizeMsg = FALSE;
     727        if (cs->style & WS_VISIBLE) dwStyle |= WS_VISIBLE; //program could change position in WM_CREATE
    727728        if( (SendInternalMessageA(WM_CREATE, 0, (LPARAM)cs )) != -1 )
    728729        {
     
    745746            }
    746747
    747             if (cs->style & WS_VISIBLE) ShowWindow( sw );
     748            if (cs->style & WS_VISIBLE) ShowWindow(sw);
    748749
    749750            /* Call WH_SHELL hook */
     
    803804    }
    804805    SendInternalMessageA(WM_NCDESTROY, 0, 0);
    805 
    806     if (hwndHorzScroll && (OSLibWinQueryWindow(hwndHorzScroll,QWOS_PARENT) == OSLibWinQueryObjectWindow())) OSLibWinDestroyWindow(hwndHorzScroll);
    807     if (hwndVertScroll && (OSLibWinQueryWindow(hwndVertScroll,QWOS_PARENT) == OSLibWinQueryObjectWindow())) OSLibWinDestroyWindow(hwndVertScroll);
    808806
    809807    TIMER_KillTimerFromWindow(OS2Hwnd);
     
    982980        case WM_NCRBUTTONDBLCLK:
    983981        case WM_NCMBUTTONDBLCLK:
    984                 if (!(windowClass && windowClass->getClassLongA(GCL_STYLE) & CS_DBLCLKS))
     982                if (!(windowClass && windowClass->getClassLongA(GCL_STYLE) & CS_DBLCLKS) && (msg->message != WM_NCLBUTTONDBLCLK))
    985983                {
    986984                    msg->message = msg->message - (WM_LBUTTONDBLCLK - WM_LBUTTONDOWN); //dblclick -> down
     
    11201118//CB: bug in GetDCEx with region!!!
    11211119    rc = SendInternalMessageA(WM_NCPAINT,/*hrgn*/0,0);
    1122 dprintf(("CB: %d %d %d %d",rect.left,rect.top,rect.bottom,rect.right));
     1120//dprintf(("CB: %d %d %d %d",rect.left,rect.top,rect.bottom,rect.right));
    11231121    DeleteObject(hrgn);
    11241122    //CB: todo: check if intersection with client
     
    11371135  wndPos.hwndInsertAfter = 0;
    11381136  rect = rectWindow;
    1139   if (getParent()) MapWindowPoints(0,getParent()->getWindowHandle(),(PPOINT)&rect,2);
     1137  if (getParent()) mapWin32Rect(OSLIB_HWND_DESKTOP,getParent()->getOS2WindowHandle(),&rect);
    11401138  wndPos.x = rect.left;
    11411139  wndPos.y = rect.top;
    11421140  wndPos.cx = rect.right-rect.left;
    11431141  wndPos.cy = rect.bottom-rect.top;
    1144   wndPos.flags = 0;
     1142  wndPos.flags = 0; //dummy
    11451143
    11461144  return SendNCCalcSize(TRUE,&window,&window,&client,&wndPos,&rectClient);
     
    12011199  {
    12021200    case SB_HORZ:
     1201      if (!horzScrollInfo)
     1202      {
     1203        horzScrollInfo = (SCROLLBAR_INFO*)malloc(sizeof(SCROLLBAR_INFO));
     1204        horzScrollInfo->MinVal = horzScrollInfo->CurVal = horzScrollInfo->Page = 0;
     1205        horzScrollInfo->MaxVal = 100;
     1206        horzScrollInfo->flags  = ESB_ENABLE_BOTH;
     1207      }
    12031208      return horzScrollInfo;
    12041209
    12051210    case SB_VERT:
     1211      if (!vertScrollInfo)
     1212      {
     1213        vertScrollInfo = (SCROLLBAR_INFO*)malloc(sizeof(SCROLLBAR_INFO));
     1214        vertScrollInfo->MinVal = vertScrollInfo->CurVal = vertScrollInfo->Page = 0;
     1215        vertScrollInfo->MaxVal = 100;
     1216        vertScrollInfo->flags  = ESB_ENABLE_BOTH;
     1217      }
    12061218      return vertScrollInfo;
    12071219  }
     
    13621374        DrawMaxButton(hdc,pressed,FALSE);
    13631375    }
    1364   } while ((msg.message != WM_LBUTTONUP) && (msg.message != WM_NCLBUTTONUP));
     1376  } while (msg.message != WM_LBUTTONUP);
    13651377  if (wParam == HTMINBUTTON)
    13661378    DrawMinButton(hdc,FALSE,FALSE);
     
    14081420    if (pressed != oldstate)
    14091421      DrawCloseButton(hdc, pressed, FALSE);
    1410   } while ((msg.message != WM_LBUTTONUP) && (msg.message != WM_NCLBUTTONUP));
     1422  } while (msg.message != WM_LBUTTONUP);
    14111423  DrawCloseButton(hdc,FALSE,FALSE);
    14121424  ReleaseCapture();
     
    15541566  clientRect = &((NCCALCSIZE_PARAMS*)winRect)->rgrc[2];
    15551567  *clientRect = rectWindow;
    1556   if (getParent()) MapWindowPoints(0,getParent()->getOS2WindowHandle(),(PPOINT)clientRect,2);
     1568  if (getParent()) mapWin32Rect(OSLIB_HWND_DESKTOP,getParent()->getOS2WindowHandle(),clientRect);
    15571569
    15581570  if(!(dwStyle & WS_MINIMIZE))
     
    17121724      if ((dwStyle & WS_VSCROLL) &&
    17131725          (pt.x >= rect.right - GetSystemMetrics(SM_CXVSCROLL)))
    1714         return HTSIZE;
     1726        return (dwStyle & WS_CHILD) ? HTSIZE:HTBOTTOMRIGHT;
    17151727      return HTHSCROLL;
    17161728    }
     
    19621974{
    19631975  RECT  r = *rect;
    1964   char    buffer[256];
     1976  char  buffer[256];
    19651977  HPEN  hPrevPen;
    19661978  HMENU hSysMenu;
     
    20592071                      ((clip > 1) ?(DCX_INTERSECTRGN /*| DCX_KEEPCLIPRGN*/) : 0) ))) return;
    20602072
    2061 
    20622073  rect.top = rect.left = 0;
    20632074  rect.right  = rectWindow.right - rectWindow.left;
     
    21262137#if 0 //CB: todo
    21272138  if (dwStyle & WS_VSCROLL)
    2128     SCROLL_DrawScrollBar( hwnd, hdc, SB_VERT, TRUE, TRUE );
     2139    SCROLL_DrawScrollBar(hwnd,hdc,SB_VERT,TRUE,TRUE);
    21292140  if (wndPtr->dwStyle & WS_HSCROLL)
    2130     SCROLL_DrawScrollBar( hwnd, hdc, SB_HORZ, TRUE, TRUE );
     2141    SCROLL_DrawScrollBar(hwnd,hdc,SB_HORZ,TRUE,TRUE);
    21312142#endif
    21322143  /* Draw the "size-box" */
     
    21372148    r.top  = r.bottom - GetSystemMetrics(SM_CYHSCROLL) + 1;
    21382149    FillRect( hdc, &r,  GetSysColorBrush(COLOR_SCROLLBAR) );
    2139     //CB: todo: use scroll code for size grip
     2150    if (!(dwStyle & WS_CHILD))
     2151    {
     2152      POINT p1,p2;
     2153      HPEN penDark = GetSysColorPen(COLOR_3DSHADOW);
     2154      HPEN penWhite = GetSysColorPen(COLOR_3DHILIGHT);
     2155      HPEN oldPen = SelectObject(hdc,penDark);
     2156      INT x;
     2157
     2158      p1.x = r.right-1;
     2159      p1.y = r.bottom;
     2160      p2.x = r.right;
     2161      p2.y = r.bottom-1;
     2162      for (x = 0;x < 3;x++)
     2163      {
     2164        SelectObject(hdc,penDark);
     2165        MoveToEx(hdc,p1.x,p1.y,NULL);
     2166        LineTo(hdc,p2.x,p2.y);
     2167        p1.x--;
     2168        p2.y--;
     2169        MoveToEx(hdc,p1.x,p1.y,NULL);
     2170        LineTo(hdc,p2.x,p2.y);
     2171        SelectObject(hdc,penWhite);
     2172        p1.x--;
     2173        p2.y--;
     2174        MoveToEx(hdc,p1.x,p1.y,NULL);
     2175        LineTo(hdc,p2.x,p2.y);
     2176        p1.x -= 2;
     2177        p2.y -= 2;
     2178      }
     2179
     2180      SelectObject(hdc,oldPen);
     2181    }
    21402182  }
    21412183
     
    21462188LONG Win32BaseWindow::HandleNCPaint(HRGN clip)
    21472189{
    2148   if (!(dwStyle & WS_VISIBLE)) return 0;
    2149 
    2150   if (dwStyle & WS_MINIMIZE) return 0;  //CB: to check
     2190//CB: ignore it for now (SetWindowPos in WM_CREATE)
     2191//  if (!(dwStyle & WS_VISIBLE)) return 0;
     2192
     2193  if (dwStyle & WS_MINIMIZE) return 0;
    21512194
    21522195  DoNCPaint(clip,FALSE);
     
    24042447    {
    24052448    case WM_CLOSE:
    2406     dprintf(("DefWindowProcA: WM_CLOSE %x", getWindowHandle()));
     2449        dprintf(("DefWindowProcA: WM_CLOSE %x", getWindowHandle()));
    24072450        DestroyWindow();
    24082451        return 0;
     
    24392482        }
    24402483        dprintf(("WM_SETTEXT of %x to %s\n", Win32Hwnd, lParam));
    2441 
     2484        if (dwStyle & WS_CAPTION)
     2485        {
     2486          //CB: optimize!
     2487          HandleNCPaint(0);
     2488        }
     2489/* //CB: endless loop in trackbar.exe -> to fix
    24422490        if(OS2HwndFrame && (dwStyle & WS_CAPTION) == WS_CAPTION)
    24432491          return OSLibWinSetWindowText(OS2HwndFrame,(LPSTR)windowNameA);
    2444 
     2492*/
    24452493        return TRUE;
    24462494    }
     
    28922940                  point.x = pt.x;
    28932941                  point.y = pt.y;
    2894                   MapWindowPoints(Win32Hwnd,getParent()->getWindowHandle(),&point,1);
     2942                  mapWin32Point(OS2Hwnd,getParent()->getOS2WindowHandle(),(OSLIBPOINT*)&point);
    28952943                  NotifyParent(Msg,wParam,MAKELPARAM(point.x,point.y));
    28962944                }
     
    32163264        }
    32173265    }
    3218 #if 0
     3266//CB: todo
     3267 #if 0
    32193268    if (isFrameWindow())
    32203269    {
     
    32453294    }
    32463295
    3247     //SWP_FRAMECHANGED is ignored, not necessary for OS/2
     3296    if (fuFlags == SWP_FRAMECHANGED)
     3297    {
     3298      //CB: optimize: if frame size has changed not necessary!
     3299      FrameUpdateFrame(this,0);
     3300    }
    32483301
    32493302    return (rc);
  • trunk/src/user32/new/win32wbase.h

    r2353 r2377  
    1 /* $Id: win32wbase.h,v 1.18 2000-01-07 17:38:48 cbratschi Exp $ */
     1/* $Id: win32wbase.h,v 1.19 2000-01-08 16:47:50 cbratschi Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    112112 Win32WndClass *getWindowClass()                { return windowClass; };
    113113
     114         LONG   getLastHitTestVal()             { return lastHitTestVal; }
    114115         BOOL   getIgnoreHitTest()              { return fIgnoreHitTest; }
    115116         VOID   setIgnoreHitTest(BOOL ignore)   { fIgnoreHitTest = ignore; }
  • trunk/src/user32/new/winmenu.cpp

    r2363 r2377  
    1 /* $Id: winmenu.cpp,v 1.11 2000-01-08 12:06:53 sandervl Exp $ */
     1/* $Id: winmenu.cpp,v 1.12 2000-01-08 16:47:50 cbratschi Exp $ */
    22
    33/*
     
    429429    }
    430430    if(!lpsz || !cchMax) {//determine menu string length
    431         char menustr[256];
    432         rc = O32_GetMenuString(hMenu, idItem, menustr, sizeof(menustr), fuFlags);
     431        char menustr[256];
     432        rc = O32_GetMenuString(hMenu, idItem, menustr, sizeof(menustr), fuFlags);
    433433        //SvL: Open32 returns the wrong error
    434         return (rc == -1) ? 0 : rc;
     434        return (rc == -1) ? 0 : rc;
    435435    }
    436436    rc = O32_GetMenuString(hMenu, idItem, lpsz, cchMax, fuFlags);
     
    645645    }
    646646    if(IS_STRING_ITEM(fuFlags) && HIWORD(lpszNewItem) != 0) {
    647         dprintf(("ModifyMenuA %s", lpszNewItem));
    648     }
    649 
     647        dprintf(("ModifyMenuA %s", lpszNewItem));
     648    }
     649/* //CB: doesn't compile, but don't need it anyway
    650650    if(((fuFlags & (MF_BYCOMMAND|MF_BYPOSITION|MF_POPUP)) == MF_BYCOMMAND) && uItem != idNewItem) {
    651         DWORD pos = OSLibGetMenuItemPos(hMenu, uItem);
    652         ODIN_DeleteMenu(hMenu, uItem, MF_BYCOMMAND);
    653         return ODIN_InsertMenuA(hMenu, pos, fuFlags | MF_BYPOSITION, idNewItem, lpszNewItem);
    654     }
     651        DWORD pos = OSLibGetMenuItemPos(hMenu, uItem);
     652        ODIN_DeleteMenu(hMenu, uItem, MF_BYCOMMAND);
     653        return ODIN_InsertMenuA(hMenu, pos, fuFlags | MF_BYPOSITION, idNewItem, lpszNewItem);
     654    }
     655*/
    655656    return O32_ModifyMenu(hMenu, uItem, fuFlags, idNewItem, lpszNewItem);
    656657}
     
    756757    //SvL: RealPlayer calls InsertMenu with flag 0 & pos -1
    757758    if((flags & (MF_BYCOMMAND|MF_BYPOSITION)) == 0 && (pos == 0xffffffff))
    758         flags |= MF_BYPOSITION;
     759        flags |= MF_BYPOSITION;
    759760
    760761    return O32_InsertMenu(hMenu, pos, flags, id, str);
Note: See TracChangeset for help on using the changeset viewer.