Changeset 3603 for trunk/src/user32


Ignore:
Timestamp:
May 24, 2000, 9:30:08 PM (25 years ago)
Author:
sandervl
Message:

experimental WM_NCHITTEST generation (disabled) + MDI fixes

Location:
trunk/src/user32
Files:
7 edited

Legend:

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

    r3525 r3603  
    1 /* $Id: oslibmsgtranslate.cpp,v 1.30 2000-05-12 18:09:40 sandervl Exp $ */
     1/* $Id: oslibmsgtranslate.cpp,v 1.31 2000-05-24 19:30:05 sandervl Exp $ */
    22/*
    33 * Window message translation functions for OS/2
     
    189189        //WM_NC*BUTTON* is posted when the cursor is in a non-client area of the window
    190190
     191#ifdef ODIN_HITTEST
     192        //Send WM_HITTEST message
     193        win32wnd->sendHitTest(MAKELONG(winMsg->pt.x,winMsg->pt.y));
     194#endif
     195
    191196        //if a window is disabled, it's parent receives the mouse messages
    192197        if(!win32wnd->IsWindowEnabled()) {
     
    242247        //WM_NCMOUSEMOVE is posted when the cursor moves into a non-client area of the window
    243248
     249#ifdef ODIN_HITTEST
     250        //Send WM_HITTEST message
     251        win32wnd->sendHitTest(MAKELONG(winMsg->pt.x,winMsg->pt.y));
     252#endif
    244253        //if a window is disabled, it's parent receives the mouse messages
    245254        if(!win32wnd->IsWindowEnabled()) {
     
    288297        winMsg->message = WINWM_NCACTIVATE;
    289298        winMsg->wParam  = SHORT1FROMMP(os2Msg->mp1);
     299
    290300        return TRUE;
    291301      }
     
    417427      BOOL fMinimized = FALSE;
    418428
    419         if(WinQueryWindowULong(hwndActivate, OFFSET_WIN32PM_MAGIC) != WIN32PM_MAGIC) {
     429        hwndActivate = Win32BaseWindow::OS2ToWin32Handle(hwndActivate);
     430        if(hwndActivate == 0) {
    420431                //another (non-win32) application's window
    421432                //set to desktop window handle
    422                 hwndActivate = windowDesktop->getWindowHandle();
    423         }
    424         else    hwndActivate = Win32BaseWindow::OS2ToWin32Handle(hwndActivate);
     433                hwndActivate = windowDesktop->getWindowHandle();
     434        }
    425435
    426436        if(WinQueryWindowULong(os2Msg->hwnd, QWL_STYLE) & WS_MINIMIZED)
     
    483493        //WM_NC*BUTTON* is posted when the cursor is in a non-client area of the window
    484494
     495#ifdef ODIN_HITTEST
     496        //Send WM_HITTEST message
     497        win32wnd->sendHitTest(MAKELONG(winMsg->pt.x,winMsg->pt.y));
     498#endif
     499
    485500        //if a window is disabled, it's parent receives the mouse messages
    486501        if(!win32wnd->IsWindowEnabled()) {
     
    535550    {
    536551        //WM_NCMOUSEMOVE is posted when the cursor moves into a non-client area of the window
     552
     553#ifdef ODIN_HITTEST
     554        //Send WM_HITTEST message
     555        win32wnd->sendHitTest(MAKELONG(winMsg->pt.x,winMsg->pt.y));
     556#endif
    537557
    538558        //if a window is disabled, it's parent receives the mouse messages
  • trunk/src/user32/pmframe.cpp

    r3584 r3603  
    1 /* $Id: pmframe.cpp,v 1.54 2000-05-22 17:21:10 cbratschi Exp $ */
     1/* $Id: pmframe.cpp,v 1.55 2000-05-24 19:30:05 sandervl Exp $ */
    22/*
    33 * Win32 Frame Managment Code for OS/2
     
    464464        USHORT flags = WinQueryWindowUShort(hwnd,QWS_FLAGS);
    465465
    466         dprintf(("PMFRAME: WM_ACTIVATE %x %x", hwnd, mp2));
     466        dprintf(("PMFRAME: WM_ACTIVATE %x %x %x", hwnd, mp1, mp2));
    467467        if(win32wnd->IsWindowCreated())
    468468          win32wnd->DispatchMsgA(pWinMsg);
  • trunk/src/user32/pmwindow.cpp

    r3525 r3603  
    1 /* $Id: pmwindow.cpp,v 1.90 2000-05-12 18:09:41 sandervl Exp $ */
     1/* $Id: pmwindow.cpp,v 1.91 2000-05-24 19:30:06 sandervl Exp $ */
    22/*
    33 * Win32 Window Managment Code for OS/2
     
    9696     (PSZ)WIN32_STDCLASS,               /* Window class name            */
    9797     (PFNWP)Win32WindowProc,            /* Address of window procedure  */
     98#ifdef ODIN_HITTEST
     99     0,
     100#else
    98101     CS_HITTEST,
     102#endif
    99103     NROF_WIN32WNDBYTES)) {
    100104        dprintf(("WinRegisterClass Win32BaseWindow failed"));
     
    105109     (PSZ)WIN32_STDCLASS2,              /* Window class name            */
    106110     (PFNWP)Win32WindowProc,            /* Address of window procedure  */
     111#ifdef ODIN_HITTEST
     112     CS_SAVEBITS,
     113#else
    107114     CS_SAVEBITS | CS_HITTEST,
     115#endif
    108116     NROF_WIN32WNDBYTES)) {
    109117        dprintf(("WinRegisterClass Win32BaseWindow failed"));
     
    118126                          WIN32_INNERFRAME,
    119127                          FrameClassInfo.pfnWindowProc,
     128#ifdef ODIN_HITTEST
     129                          FrameClassInfo.flClassStyle,
     130#else
    120131                          FrameClassInfo.flClassStyle | CS_HITTEST,
     132#endif
    121133                          FrameClassInfo.cbWindowData)) {
    122134     dprintf (("WinRegisterClass Win32InnerFrame failed"));
     
    263275    case WM_ACTIVATE:
    264276    {
    265         dprintf(("OS2: WM_ACTIVATE %x %x", hwnd, mp2));
     277        dprintf(("OS2: WM_ACTIVATE %x %x %x", hwnd, mp1, mp2));
    266278
    267279        if(win32wnd->IsWindowCreated())
  • trunk/src/user32/win32wbase.cpp

    r3587 r3603  
    1 /* $Id: win32wbase.cpp,v 1.193 2000-05-22 19:05:58 sandervl Exp $ */
     1/* $Id: win32wbase.cpp,v 1.194 2000-05-24 19:30:06 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    11421142//******************************************************************************
    11431143//******************************************************************************
     1144LONG Win32BaseWindow::sendHitTest(ULONG lParam)
     1145{
     1146    lastHitTestVal = SendInternalMessageA(WM_NCHITTEST, 0, lParam);
     1147    return lastHitTestVal;
     1148}
     1149//******************************************************************************
     1150//******************************************************************************
    11441151BOOL Win32BaseWindow::isMDIClient()
    11451152{
     
    13871394
    13881395    case WM_ACTIVATE:
    1389       return 0;
     1396        /* The default action in Windows is to set the keyboard focus to
     1397         * the window, if it's being activated and not minimized */
     1398        if (LOWORD(wParam) != WA_INACTIVE) {
     1399                if(!(getStyle() & WS_MINIMIZE))
     1400                        SetFocus(getWindowHandle());
     1401        }
     1402        return 0;
    13901403
    13911404    case WM_SETCURSOR:
     
    21312144   Win32BaseWindow *window;
    21322145   HWND hParent = 0;
    2133    BOOL fShow = FALSE;
    21342146
    21352147    if (fuFlags &
     
    22452257    rc = OSLibWinSetMultWindowPos(&swp, 1);
    22462258
    2247 #ifdef DEBUG
    2248     if(fShow) {
    2249         dprintf(("Frame style 0x%08x, client style 0x%08x", OSLibQueryWindowStyle(OS2HwndFrame), OSLibQueryWindowStyle(OS2Hwnd)));
    2250     }
    2251 #endif
    2252     if (rc == FALSE)
     2259    if(rc == FALSE)
    22532260    {
    22542261        dprintf(("OSLibWinSetMultWindowPos failed! Error %x",OSLibWinGetLastError()));
    2255     }
     2262        return 0;
     2263    }
     2264
    22562265    if((fuFlags & SWP_FRAMECHANGED) && (fuFlags & (SWP_NOMOVE | SWP_NOSIZE) == (SWP_NOMOVE | SWP_NOSIZE)))
    22572266    {
  • trunk/src/user32/win32wbase.h

    r3493 r3603  
    1 /* $Id: win32wbase.h,v 1.94 2000-05-05 11:32:37 sandervl Exp $ */
     1/* $Id: win32wbase.h,v 1.95 2000-05-24 19:30:07 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    149149
    150150         LONG   getLastHitTestVal()             { return lastHitTestVal; }
     151         LONG   sendHitTest(ULONG lParam);
    151152
    152153         DWORD  getWindowContextHelpId()        { return contextHelpId; };
  • trunk/src/user32/win32wmdichild.cpp

    r2803 r3603  
    1 /* $Id: win32wmdichild.cpp,v 1.22 2000-02-16 14:28:24 sandervl Exp $ */
     1/* $Id: win32wmdichild.cpp,v 1.23 2000-05-24 19:30:08 sandervl Exp $ */
    22/*
    33 * Win32 MDI Child Window Class for OS/2
     
    9999
    100100    case WM_CHILDACTIVATE:
    101         client->childActivate(this);
     101        client->childActivate(this);
    102102        return 0;
    103103
     
    295295
    296296    /* this menu is needed to set a check mark in MDI_ChildActivate */
    297     AppendMenuA(client->getMDIMenu(), MF_STRING ,wIDmenu, lpstrDef );
     297    if(client->getMDIMenu())
     298        AppendMenuA(client->getMDIMenu(), MF_STRING ,wIDmenu, lpstrDef );
    298299
    299300    client->incNrActiveChildren();
     
    347348    if(newchild && GetLastError() == 0)
    348349    {
     350        /* All MDI child windows have the WS_EX_MDICHILD style */
     351        newchild->setExStyle(newchild->getExStyle() | WS_EX_MDICHILD);
     352
    349353        newchild->menuModifyItem();
    350354
     
    363367             * the SWP_SHOWWINDOW command.
    364368             */
    365             newchild->SetWindowLongA(GWL_STYLE, newchild->getStyle() & ~WS_VISIBLE);
     369            newchild->setStyle(newchild->getStyle() & ~WS_VISIBLE);
     370
    366371            if(showflag){
    367                 newchild->SetWindowPos(0, 0, 0, 0, 0, SWP_SHOWWINDOW | SWP_NOSIZE | SWP_NOMOVE );
     372                dprintf(("newchild->SetWindowPos active window %x", GetActiveWindow()));
     373                newchild->SetWindowPos(HWND_TOP, 0, 0, 0, 0, SWP_SHOWWINDOW | SWP_NOSIZE | SWP_NOMOVE );
     374                dprintf(("newchild->SetWindowPos active window %x", GetActiveWindow()));
    368375
    369376                /* Set maximized state here in case hwnd didn't receive WM_SIZE
     
    382389            else
    383390                /* needed, harmless ? */
    384                 newchild->SetWindowPos(0, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOSIZE | SWP_NOMOVE );
     391                newchild->SetWindowPos(HWND_TOP, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOSIZE | SWP_NOMOVE );
    385392
    386393        }
     
    389396    {
    390397        client->decNrActiveChildren();
    391         DeleteMenu(client->getMDIMenu(), wIDmenu,MF_BYCOMMAND);
     398        if(client->getMDIMenu()) {
     399                DeleteMenu(client->getMDIMenu(), wIDmenu,MF_BYCOMMAND);
     400        }
    392401
    393402        maximizedChild = client->getMaximizedChild();
  • trunk/src/user32/win32wmdiclient.cpp

    r3153 r3603  
    1 /* $Id: win32wmdiclient.cpp,v 1.26 2000-03-18 16:13:40 cbratschi Exp $ */
     1/* $Id: win32wmdiclient.cpp,v 1.27 2000-05-24 19:30:08 sandervl Exp $ */
    22/*
    33 * Win32 MDI Client Window Class for OS/2
     
    333333    }
    334334
     335    /* Don't activate if it is already active. Might happen
     336       since ShowWindow DOES activate MDI children */
     337    if(activeChild == child)
     338    {
     339        return 0;
     340    }
     341
    335342    if( GetActiveWindow() == getParent()->getWindowHandle())
    336343        isActiveFrameWnd = TRUE;
Note: See TracChangeset for help on using the changeset viewer.