Changeset 1576 for trunk/src


Ignore:
Timestamp:
Nov 3, 1999, 8:51:44 PM (26 years ago)
Author:
sandervl
Message:

mouse activate + CreateIconIndirect fix

Location:
trunk/src/user32
Files:
6 edited

Legend:

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

    r1540 r1576  
    1 /* $Id: oslibwin.cpp,v 1.41 1999-11-01 19:11:40 sandervl Exp $ */
     1/* $Id: oslibwin.cpp,v 1.42 1999-11-03 19:51:42 sandervl Exp $ */
    22/*
    33 * Window API wrappers for OS/2
     
    5050//******************************************************************************
    5151HWND OSLibWinCreateWindow(HWND hwndParent, ULONG dwWinStyle, ULONG dwFrameStyle,
    52                           char *pszName, HWND Owner, ULONG fBottom, HWND *hwndFrame,
     52                          char *pszName, HWND Owner, ULONG fHWND_BOTTOM, HWND *hwndFrame,
    5353                          ULONG id)
    5454{
     
    6666        Owner = HWND_DESKTOP;
    6767  }
    68 
    6968  ULONG dwClientStyle;
     69#if 1
    7070
    7171  BOOL TopLevel = hwndParent == HWND_DESKTOP;
     72//  if(dwFrameStyle & FCF_TITLEBAR)
     73//      TopLevel = TRUE;
     74
    7275  FRAMECDATA FCData = {sizeof (FRAMECDATA), 0, 0, 0};
    7376
     
    98101  dprintf(("OSLibWinCreateWindow: (FRAME) WinCreateStdWindow failed (%x)", WinGetLastError(GetThreadHAB())));
    99102  return 0;
     103#else
     104        dwClientStyle = dwWinStyle & ~(WS_TABSTOP | WS_GROUP);
     105
     106        dwFrameStyle |= FCF_NOBYTEALIGN;
     107        if (hwndParent == HWND_DESKTOP && dwFrameStyle & FCF_TITLEBAR)
     108                dwFrameStyle |= FCF_TASKLIST | FCF_NOMOVEWITHOWNER;
     109
     110        dwWinStyle   &= ~WS_CLIPCHILDREN;
     111
     112        *hwndFrame = WinCreateStdWindow(hwndParent, dwWinStyle,
     113                                       &dwFrameStyle, WIN32_STDCLASS,
     114                                       "", dwClientStyle, 0, id, &hwndClient);
     115        if(*hwndFrame) {
     116                if(pszName) {
     117                        WinSetWindowText(*hwndFrame, pszName);
     118                }
     119                return hwndClient;
     120        }
     121        dprintf(("OSLibWinCreateWindow: (FRAME) WinCreateStdWindow failed (%x)", WinGetLastError(GetThreadHAB())));
     122        return 0;
     123#endif
    100124}
    101125//******************************************************************************
     
    10511075  OSLibWinConvertStyle(dwStyle, &dwExStyle, &OSWinStyle, &OSFrameStyle, &borderWidth, &borderHeight);
    10521076
    1053   OSWinStyle = OSWinStyle & ~(WS_TABSTOP | WS_GROUP | WS_CLIPCHILDREN | WS_CLIPSIBLINGS);
     1077//  OSWinStyle = OSWinStyle & ~(WS_TABSTOP | WS_GROUP | WS_CLIPCHILDREN | WS_CLIPSIBLINGS);
     1078  OSWinStyle = OSWinStyle & ~(WS_TABSTOP | WS_GROUP | WS_CLIPCHILDREN);
    10541079
    10551080  WinSetWindowULong(hwnd, QWL_STYLE,
  • trunk/src/user32/pmframe.cpp

    r1572 r1576  
    1 /* $Id: pmframe.cpp,v 1.18 1999-11-03 18:00:25 cbratschi Exp $ */
     1/* $Id: pmframe.cpp,v 1.19 1999-11-03 19:51:43 sandervl Exp $ */
    22/*
    33 * Win32 Frame Managment Code for OS/2
     
    257257
    258258        if(!win32wnd->CanReceiveSizeMsgs()) {
    259             goto RunDefFrameProc; //CB: must call def frame proc or frame control activation is broken
     259//SvL: Doing this breaks button.exe, header4(a).exe & style.exe
     260//            goto RunDefFrameProc; //CB: must call def frame proc or frame control activation is broken
    260261            break;
    261262        }
     
    293294            pswp->hwnd = hwnd;
    294295
    295             goto RunDefFrameProc; //CB: must call def frame proc or frame control activation is broken
    296             //RestoreOS2TIB();
    297             //return (MRESULT)0xf;
     296//            goto RunDefFrameProc; //CB: must call def frame proc or frame control activation is broken
     297            RestoreOS2TIB();
     298            return (MRESULT)0xf;
    298299        }
    299300        goto RunDefFrameProc; //CB: must call def frame proc or frame control activation is broken
     
    422423        if (win32wnd->IsModalDialog())
    423424        {
    424           Win32BaseWindow *topOwner = win32wnd->getOwner()->getTopParent();
     425          Win32BaseWindow *topOwner = win32wnd->getOwner()->GetTopParent();
    425426
    426427          if (topOwner) WinSetWindowPos(topOwner->getOS2FrameWindowHandle(),hwnd,0,0,0,0,SWP_ZORDER);
  • trunk/src/user32/win32dlg.cpp

    r1572 r1576  
    1 /* $Id: win32dlg.cpp,v 1.28 1999-11-03 18:00:26 cbratschi Exp $ */
     1/* $Id: win32dlg.cpp,v 1.29 1999-11-03 19:51:43 sandervl Exp $ */
    22/*
    33 * Win32 Dialog Code for OS/2
     
    261261     topOwner = windowDesktop;
    262262    }
    263     else topOwner = getOwner()->getTopParent();
     263    else topOwner = getOwner()->GetTopParent();
    264264
    265265    if(topOwner == NULL) {
  • trunk/src/user32/win32wbase.cpp

    r1572 r1576  
    1 /* $Id: win32wbase.cpp,v 1.73 1999-11-03 18:00:27 cbratschi Exp $ */
     1/* $Id: win32wbase.cpp,v 1.74 1999-11-03 19:51:43 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    10261026    return  SendInternalMessageA(WM_KILLFOCUS, hwnd, 0);
    10271027}
    1028 //******************************************************************************
    10291028//******************************************************************************
    10301029//******************************************************************************
     
    11021101    }
    11031102
    1104     if(fClick) {
     1103    if(fClick)
     1104    {
     1105     HWND hwndTop;
     1106
    11051107        /* Activate the window if needed */
    1106         HWND hwndTop = (getTopParent()) ? getTopParent()->getWindowHandle() : 0;
    1107 
    1108         if (getWindowHandle() != GetActiveWindow())
     1108        if(isSubclassedOS2Wnd()) {
     1109                Win32BaseWindow *parentwnd = GetWindowFromOS2FrameHandle(OSLibWinQueryWindow(OS2Hwnd, QWOS_PARENT));
     1110                if(parentwnd) {
     1111                        hwndTop = (parentwnd->GetTopParent()) ? parentwnd->GetTopParent()->getWindowHandle() : 0;
     1112                }
     1113                else    hwndTop = 0;
     1114        }
     1115        else    hwndTop = (GetTopParent()) ? GetTopParent()->getWindowHandle() : 0;
     1116
     1117        if (hwndTop && getWindowHandle() != GetActiveWindow())
    11091118        {
    11101119                LONG ret = SendMessageA(WM_MOUSEACTIVATE, hwndTop,
     
    18641873        window = parentwindow;
    18651874   }
    1866 }
    1867 //******************************************************************************
    1868 //******************************************************************************
    1869 Win32BaseWindow *Win32BaseWindow::getTopParent()
    1870 {
    1871  Win32BaseWindow *tmpWnd = this;
    1872 
    1873     while( tmpWnd && (tmpWnd->getStyle() & WS_CHILD))
    1874     {
    1875         tmpWnd = tmpWnd->getParent();
    1876     }
    1877     return tmpWnd;
    18781875}
    18791876//******************************************************************************
  • trunk/src/user32/win32wbase.h

    r1572 r1576  
    1 /* $Id: win32wbase.h,v 1.39 1999-11-03 18:00:29 cbratschi Exp $ */
     1/* $Id: win32wbase.h,v 1.40 1999-11-03 19:51:44 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    186186Win32BaseWindow *getOwner()                   { return owner; };
    187187
    188 Win32BaseWindow *getTopParent();
    189188 SCROLLBAR_INFO *getScrollInfo(int nBar);
    190189       HWND      getVertScrollHandle()        { return hwndVertScroll; };
  • trunk/src/user32/winicon.cpp

    r949 r1576  
    1 /* $Id: winicon.cpp,v 1.1 1999-09-15 23:19:03 sandervl Exp $ */
     1/* $Id: winicon.cpp,v 1.2 1999-11-03 19:51:44 sandervl Exp $ */
    22/*
    33 * Win32 Icon Code for OS/2
     
    5555//******************************************************************************
    5656//******************************************************************************
    57 HICON WIN32API CreateIconIndirect(LPICONINFO arg1)
     57HICON WIN32API CreateIconIndirect(LPICONINFO pIcon)
    5858{
    59 #ifdef DEBUG
    60     WriteLog("USER32:  CreateIconIndirect\n");
    61 #endif
    62     return O32_CreateIconIndirect(arg1);
     59 HICON   hIcon;
     60 HDC     hdcSrc, hdcDst;
     61
     62    dprintf(("USER32:  CreateIconIndirect\n"));
     63    if(pIcon->hbmMask && pIcon->hbmColor)
     64    {
     65        ICONINFO iconinfo;
     66        SIZE bmpsize;
     67
     68        iconinfo = *pIcon;
     69        if(GetBitmapDimensionEx(pIcon->hbmColor, &bmpsize) == FALSE) {
     70                return 0;
     71        }
     72        //if there's a color bitmap, the mask bitmap contains only the AND bits
     73        //Open32 calls WinCreatePointerIndirect which expects AND & XOR bits
     74        //To solve this we create a bitmap that's 2x height of the mask, copy
     75        //the AND bits and set the XOR bits to 0
     76        hdcSrc = CreateCompatibleDC(0);
     77        hdcDst = CreateCompatibleDC(0);
     78
     79        iconinfo.hbmMask  = CreateCompatibleBitmap (hdcDst, bmpsize.cx, bmpsize.cy*2);
     80        SelectObject (hdcDst, iconinfo.hbmMask);
     81        SelectObject (hdcSrc, pIcon->hbmMask);
     82        BitBlt (hdcDst, 0, 0, bmpsize.cx, bmpsize.cy,
     83                hdcSrc, bmpsize.cx, 0, SRCCOPY);
     84        PatBlt (hdcDst, bmpsize.cx, bmpsize.cy, bmpsize.cx, bmpsize.cy, BLACKNESS);
     85       
     86        hIcon = O32_CreateIconIndirect(&iconinfo);
     87
     88        DeleteObject(iconinfo.hbmMask);
     89        DeleteDC(hdcSrc);
     90        DeleteDC(hdcDst);
     91
     92        return hIcon;
     93    }
     94    hIcon = O32_CreateIconIndirect(pIcon);
     95    if(hIcon == 0) {
     96        dprintf(("CreateIconIndirect %d (%d,%d) %x %x failed with %x", pIcon->fIcon, pIcon->xHotspot, pIcon->yHotspot, pIcon->hbmMask, pIcon->hbmColor, GetLastError()));
     97    }
     98    return hIcon;
    6399}
    64100//******************************************************************************
Note: See TracChangeset for help on using the changeset viewer.