Ignore:
Timestamp:
Apr 29, 2000, 8:28:41 PM (25 years ago)
Author:
sandervl
Message:

commented out x&y default code (no longer works), owner bugfix, level 2 debug logging

File:
1 edited

Legend:

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

    r3419 r3462  
    1 /* $Id: win32wbase.cpp,v 1.180 2000-04-18 11:13:00 sandervl Exp $ */
     1/* $Id: win32wbase.cpp,v 1.181 2000-04-29 18:28:39 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    542542  }
    543543
     544//SvL: This completely messes up MS Word 97 (no button bar, no menu)
     545#if 0
    544546  //adjust CW_USEDEFAULT position
    545547  if (fXDefault | fCXDefault)
     
    547549    RECT rect;
    548550
     551    //SvL: Returns invalid rectangle (not the expected shell default size)
    549552    OSLibWinQueryWindowRect(OS2HwndFrame,&rect,RELATIVE_TO_SCREEN);
    550553    if (getParent()) mapWin32Rect(OSLIB_HWND_DESKTOP,getParent()->getOS2WindowHandle(),&rect);
     
    564567    }
    565568  }
     569#endif
     570
     571  OSLibWinSetOwner(OS2Hwnd, OS2HwndFrame);
     572
     573  fakeWinBase.hwndThis     = OS2Hwnd;
     574  fakeWinBase.pWindowClass = windowClass;
     575
     576  //Set icon from window or class
     577  if (hIcon)
     578    OSLibWinSetIcon(OS2HwndFrame,hIcon);
     579  else if (windowClass->getIcon())
     580    OSLibWinSetIcon(OS2HwndFrame,windowClass->getIcon());
     581
     582  /* Get class or window DC if needed */
     583  if(windowClass->getStyle() & CS_OWNDC) {
     584        dprintf(("Class with CS_OWNDC style"));
     585        ownDC = GetDC(getWindowHandle()); //TODO: or GetWindowDC???
     586  }
     587  else
     588  if (windowClass->getStyle() & CS_PARENTDC)  {
     589        dprintf(("WARNING: Class with CS_PARENTDC style!"));
     590        fParentDC = TRUE;
     591        ownDC = 0;
     592  }
     593  else
     594  if (windowClass->getStyle() & CS_CLASSDC)  {
     595        dprintf(("WARNING: Class with CS_CLASSDC style!"));
     596        ownDC = 0;
     597  }
     598  /* Set the window menu */
     599  if ((dwStyle & (WS_CAPTION | WS_CHILD)) == WS_CAPTION )
     600  {
     601        if (cs->hMenu) {
     602            ::SetMenu(getWindowHandle(), cs->hMenu);
     603        }
     604        else {
     605                if (windowClass->getMenuNameA()) {
     606                        cs->hMenu = LoadMenuA(windowClass->getInstance(),windowClass->getMenuNameA());
     607#if 0 //CB: hack for treeview test cases bug
     608if (!cs->hMenu) cs->hMenu = LoadMenuA(windowClass->getInstance(),"MYAPP");
     609#endif
     610                        if (cs->hMenu) ::SetMenu(getWindowHandle(), cs->hMenu );
     611                }
     612        }
     613  }
     614  else
     615  {
     616        setWindowId((DWORD)cs->hMenu);
     617  }
     618  hSysMenu = (dwStyle & WS_SYSMENU) ? MENU_GetSysMenu(Win32Hwnd,0):0;
     619
     620  // Subclass frame
     621  pOldFrameProc = FrameSubclassFrameWindow(this);
    566622
    567623  /* Send the WM_GETMINMAXINFO message and fix the size if needed */
     
    585641        if (cs->cy <= 0) cs->cy = 1;
    586642  }
    587 
    588   OSLibWinSetOwner(OS2Hwnd, OS2HwndFrame);
    589 
    590   fakeWinBase.hwndThis     = OS2Hwnd;
    591   fakeWinBase.pWindowClass = windowClass;
    592 
    593   //Set icon from window or class
    594   if (hIcon)
    595     OSLibWinSetIcon(OS2HwndFrame,hIcon);
    596   else if (windowClass->getIcon())
    597     OSLibWinSetIcon(OS2HwndFrame,windowClass->getIcon());
    598 
    599   /* Get class or window DC if needed */
    600   if(windowClass->getStyle() & CS_OWNDC) {
    601         dprintf(("Class with CS_OWNDC style"));
    602         ownDC = GetDC(getWindowHandle()); //TODO: or GetWindowDC???
    603   }
    604   else
    605   if (windowClass->getStyle() & CS_PARENTDC)  {
    606         dprintf(("WARNING: Class with CS_PARENTDC style!"));
    607         fParentDC = TRUE;
    608         ownDC = 0;
    609   }
    610   else
    611   if (windowClass->getStyle() & CS_CLASSDC)  {
    612         dprintf(("WARNING: Class with CS_CLASSDC style!"));
    613         ownDC = 0;
    614   }
    615   /* Set the window menu */
    616   if ((dwStyle & (WS_CAPTION | WS_CHILD)) == WS_CAPTION )
    617   {
    618         if (cs->hMenu) {
    619             ::SetMenu(getWindowHandle(), cs->hMenu);
    620         }
    621         else {
    622                 if (windowClass->getMenuNameA()) {
    623                         cs->hMenu = LoadMenuA(windowClass->getInstance(),windowClass->getMenuNameA());
    624 #if 0 //CB: hack for treeview test cases bug
    625 if (!cs->hMenu) cs->hMenu = LoadMenuA(windowClass->getInstance(),"MYAPP");
    626 #endif
    627                         if (cs->hMenu) ::SetMenu(getWindowHandle(), cs->hMenu );
    628                 }
    629         }
    630   }
    631   else
    632   {
    633         setWindowId((DWORD)cs->hMenu);
    634   }
    635   hSysMenu = (dwStyle & WS_SYSMENU) ? MENU_GetSysMenu(Win32Hwnd,0):0;
    636 
    637   // Subclass frame
    638   pOldFrameProc = FrameSubclassFrameWindow(this);
    639643
    640644  //preset rects
     
    16081612    case WM_SYSCHAR:
    16091613    {
    1610             int iMenuSysKey = 0;
    1611             if (wParam == VK_RETURN && (getStyle() & WS_MINIMIZE))
     1614        int iMenuSysKey = 0;
     1615        if (wParam == VK_RETURN && (getStyle() & WS_MINIMIZE))
    16121616        {
    16131617                PostMessageA(getWindowHandle(), WM_SYSCOMMAND,
     
    16151619                break;
    16161620        }
    1617             if ((HIWORD(lParam) & KEYDATA_ALT) && wParam)
    1618         {
    1619                 if (wParam == VK_TAB || wParam == VK_ESCAPE) break;
    1620                 if (wParam == VK_SPACE && (getStyle() & WS_CHILD))
    1621                 getParent()->SendMessageA(Msg, wParam, lParam );
    1622                 else
    1623                 SendMessageA(WM_SYSCOMMAND, (WPARAM)SC_KEYMENU, (LPARAM)(DWORD)wParam );
    1624         }
    1625             else /* check for Ctrl-Esc */
    1626             if (wParam != VK_ESCAPE) MessageBeep(0);
    1627             break;
     1621        if((HIWORD(lParam) & KEYDATA_ALT) && wParam)
     1622        {
     1623                if (wParam == VK_TAB || wParam == VK_ESCAPE)
     1624                        break;
     1625                if (wParam == VK_SPACE && (getStyle() & WS_CHILD)) {
     1626                        getParent()->SendMessageA(Msg, wParam, lParam );
     1627                }
     1628                else    SendMessageA(WM_SYSCOMMAND, (WPARAM)SC_KEYMENU, (LPARAM)(DWORD)wParam );
     1629        }
     1630        else /* check for Ctrl-Esc */
     1631                if (wParam != VK_ESCAPE) MessageBeep(0);
     1632                        break;
    16281633    }
    16291634
     
    20812086    BOOL rc = OSLibWinShowWindow(OS2HwndFrame, showstate);
    20822087
     2088    SendInternalMessageA(WM_SHOWWINDOW, (showstate & SWPOS_SHOW) ? 1 : 0, 0);
     2089
    20832090    return rc;
    20842091}
Note: See TracChangeset for help on using the changeset viewer.