Changeset 5146 for trunk/src


Ignore:
Timestamp:
Feb 17, 2001, 3:49:26 PM (25 years ago)
Author:
sandervl
Message:

activate, tab and ischild bugfixes

Location:
trunk/src/user32
Files:
5 edited

Legend:

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

    r5045 r5146  
    1 /* $Id: dc.cpp,v 1.83 2001-02-01 18:02:20 sandervl Exp $ */
     1/* $Id: dc.cpp,v 1.84 2001-02-17 14:49:25 sandervl Exp $ */
    22
    33/*
     
    13741374   }
    13751375   else dprintf(("InvalidateRect %x NULL erase=%d", hwnd, erase));
     1376#if 1
     1377   result = RedrawWindow (hwnd, pRect, NULLHANDLE,
     1378                          RDW_ALLCHILDREN_W | RDW_INVALIDATE_W |
     1379                          (erase ? RDW_ERASE_W : 0) |
     1380                          (hwnd == NULLHANDLE ? RDW_UPDATENOW_W : 0));
     1381#else
    13761382   result = RedrawWindow (hwnd, pRect, NULLHANDLE,
    13771383                          RDW_ALLCHILDREN_W | RDW_INVALIDATE_W |
    13781384                          (erase ? RDW_ERASE_W : RDW_NOERASE_W) |
    13791385                          (hwnd == NULLHANDLE ? RDW_UPDATENOW_W : 0));
     1386#endif
    13801387   return (result);
    13811388}
     
    13871394
    13881395   dprintf(("InvalidateRgn %x %x erase=%d", hwnd, hrgn, erase));
     1396#if 1
     1397   result = RedrawWindow (hwnd, NULL, hrgn,
     1398                          RDW_ALLCHILDREN_W | RDW_INVALIDATE_W |
     1399                          (erase ? RDW_ERASE_W : 0) |
     1400                          (hwnd == NULLHANDLE ? RDW_UPDATENOW_W : 0));
     1401#else
    13891402   result = RedrawWindow (hwnd, NULL, hrgn,
    13901403                          RDW_ALLCHILDREN_W | RDW_INVALIDATE_W |
    13911404                          (erase ? RDW_ERASE_W : RDW_NOERASE_W) |
    13921405                          (hwnd == NULLHANDLE ? RDW_UPDATENOW_W : 0));
     1406#endif
    13931407   return (result);
    13941408}
  • trunk/src/user32/pmwindow.cpp

    r5137 r5146  
    1 /* $Id: pmwindow.cpp,v 1.113 2001-02-15 00:33:01 sandervl Exp $ */
     1/* $Id: pmwindow.cpp,v 1.114 2001-02-17 14:49:26 sandervl Exp $ */
    22/*
    33 * Win32 Window Managment Code for OS/2
     
    222222  else
    223223  if(msg == WIN32APP_SETFOCUSMSG) {
    224       //PM doesn't allow SetFocus calls during WM_SETFOCUS message processing; 
     224      //PM doesn't allow SetFocus calls during WM_SETFOCUS message processing;
    225225      //must delay this function call
    226226      //mp1 = win32 window handle
     
    379379            {
    380380                //Only send PM WM_ACTIVATE to top-level windows (frame windows)
    381                 if(!(WinQueryWindowUShort(hwnd,QWS_FLAGS) & FF_ACTIVE))
     381                if(!(WinQueryWindowULong(hwnd, OFFSET_WIN32FLAGS) & FF_ACTIVE))
    382382                {
    383                     if(isFrame) {
    384383                        WinSendMsg(hwnd, WM_ACTIVATE, (MPARAM)TRUE, (MPARAM)hwnd);
    385                     }
    386                     else
    387                     if(win32wnd->IsWindowCreated()) {
    388                         win32wnd->MsgActivate(1, 0, win32wnd->getWindowHandle(), hwnd);
    389                     }
    390384                }
    391385            }
     
    501495        {
    502496             //Only send PM WM_ACTIVATE to top-level windows (frame windows)
    503              if(!(WinQueryWindowUShort(hwnd,QWS_FLAGS) & FF_ACTIVE))
     497             if(!(WinQueryWindowULong(hwnd, OFFSET_WIN32FLAGS) & FF_ACTIVE))
    504498             {
    505499                if(isFrame) {
     
    519513    case WM_ACTIVATE:
    520514    {
    521         USHORT flags = WinQueryWindowUShort(hwnd,QWS_FLAGS);
     515        USHORT flags = WinQueryWindowULong(hwnd, OFFSET_WIN32FLAGS);
    522516
    523517        dprintf(("OS2: WM_ACTIVATE %x %x %x", hwnd, mp1, mp2));
    524518
    525         WinSetWindowUShort(hwnd,QWS_FLAGS, SHORT1FROMMP(mp1) ? (flags | FF_ACTIVE):(flags & ~FF_ACTIVE));
     519        WinSetWindowULong(hwnd, OFFSET_WIN32FLAGS, SHORT1FROMMP(mp1) ? (flags | FF_ACTIVE):(flags & ~FF_ACTIVE));
    526520        if(win32wnd->IsWindowCreated())
    527521        {
     
    596590    {
    597591      HWND hwndFocus = (HWND)mp1;
    598        
     592
    599593        dprintf(("OS2: WM_SETFOCUS %x %x (%x) %d", win32wnd->getWindowHandle(), mp1, OS2ToWin32Handle(hwndFocus), mp2));
    600594
    601         //PM doesn't allow SetFocus calls during WM_SETFOCUS message processing; 
     595        //PM doesn't allow SetFocus calls during WM_SETFOCUS message processing;
    602596        //must delay this function call
    603597
  • trunk/src/user32/win32wbase.cpp

    r5083 r5146  
    1 /* $Id: win32wbase.cpp,v 1.234 2001-02-10 10:31:31 sandervl Exp $ */
     1/* $Id: win32wbase.cpp,v 1.235 2001-02-17 14:49:26 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    494494        return FALSE;
    495495    }
     496    if(OSLibWinSetWindowULong(OS2Hwnd, OFFSET_WIN32FLAGS, 0) == FALSE) {
     497        dprintf(("WM_CREATE: WinSetWindowULong2 %X failed!!", OS2Hwnd));
     498        SetLastError(ERROR_OUTOFMEMORY); //TODO: Better error
     499        return FALSE;
     500    }
    496501
    497502    if (HOOK_IsHooked( WH_CBT ))
     
    706711            if (getStyle() & (WS_MINIMIZE | WS_MAXIMIZE))
    707712            {
    708                         RECT newPos;
    709                         UINT swFlag = (getStyle() & WS_MINIMIZE) ? SW_MINIMIZE : SW_MAXIMIZE;
     713                        RECT newPos;
     714                        UINT swFlag = (getStyle() & WS_MINIMIZE) ? SW_MINIMIZE : SW_MAXIMIZE;
    710715                setStyle(getStyle() & ~(WS_MAXIMIZE | WS_MINIMIZE));
    711                         MinMaximize(swFlag, &newPos);
     716                        MinMaximize(swFlag, &newPos);
    712717                swFlag = ((getStyle() & WS_CHILD) || GetActiveWindow()) ? SWP_NOACTIVATE | SWP_NOZORDER | SWP_FRAMECHANGED
    713718                                                                        : SWP_NOZORDER | SWP_FRAMECHANGED;
     
    26832688{
    26842689    if(getParent()) {
    2685           return getParent()->getWindowHandle() == hwndParent;
    2686     }
    2687     else  return 0;
     2690         if(getParent()->getWindowHandle() == hwndParent)
     2691             return TRUE;
     2692
     2693         return getParent()->IsChild(hwndParent);
     2694    }
     2695    else return 0;
    26882696}
    26892697//******************************************************************************
     
    34603468//  dprintf2(("Win32BaseWindow::GetWindowFromOS2Handle: not an Odin os2 window %x", hwnd));
    34613469    return 0;
    3462 }
    3463 //******************************************************************************
    3464 //******************************************************************************
    3465 HWND Win32BaseWindow::getNextDlgTabItem(HWND hwndCtrl, BOOL fPrevious)
    3466 {
    3467  Win32BaseWindow *child, *nextchild, *lastchild;
    3468  HWND retvalue;
    3469 
    3470     if (hwndCtrl)
    3471     {
    3472         child = GetWindowFromHandle(hwndCtrl);
    3473         if (!child)
    3474         {
    3475             retvalue = 0;
    3476             goto END;
    3477         }
    3478         /* Make sure hwndCtrl is a top-level child */
    3479         while ((child->getStyle() & WS_CHILD) && (child->getParent() != this))
    3480         {
    3481             child = child->getParent();
    3482             if(child == NULL) break;
    3483         }
    3484 
    3485         if (!child || (child->getParent() != this))
    3486         {
    3487             retvalue = 0;
    3488             goto END;
    3489         }
    3490     }
    3491     else
    3492     {
    3493         /* No ctrl specified -> start from the beginning */
    3494         child = (Win32BaseWindow *)getFirstChild();
    3495         if (!child)
    3496         {
    3497             retvalue = 0;
    3498             goto END;
    3499         }
    3500 
    3501         if (!fPrevious)
    3502         {
    3503             while (child->getNextChild())
    3504             {
    3505                 child = (Win32BaseWindow *)child->getNextChild();
    3506             }
    3507         }
    3508     }
    3509 
    3510     lastchild = child;
    3511     nextchild = (Win32BaseWindow *)child->getNextChild();
    3512     while (TRUE)
    3513     {
    3514         if (!nextchild) nextchild = (Win32BaseWindow *)getFirstChild();
    3515 
    3516         if (child == nextchild) break;
    3517 
    3518         if ((nextchild->getStyle() & WS_TABSTOP) && (nextchild->getStyle() & WS_VISIBLE) &&
    3519             !(nextchild->getStyle() & WS_DISABLED))
    3520         {
    3521             lastchild = nextchild;
    3522             if (!fPrevious) break;
    3523         }
    3524         nextchild = (Win32BaseWindow *)nextchild->getNextChild();
    3525     }
    3526     retvalue = lastchild->getWindowHandle();
    3527 
    3528 END:
    3529     return retvalue;
    35303470}
    35313471//******************************************************************************
  • trunk/src/user32/win32wbase.h

    r5137 r5146  
    1 /* $Id: win32wbase.h,v 1.104 2001-02-15 00:33:01 sandervl Exp $ */
     1/* $Id: win32wbase.h,v 1.105 2001-02-17 14:49:26 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    2727#define OFFSET_WIN32WNDPTR        0
    2828#define OFFSET_WIN32PM_MAGIC      4
    29 #define NROF_WIN32WNDBYTES        8
     29#define OFFSET_WIN32FLAGS         8
     30#define NROF_WIN32WNDBYTES        12
    3031
    3132#define WIN32PM_MAGIC           0x12345678
     
    291292           BOOL EnumWindows(WNDENUMPROC lpfn, LPARAM lParam);
    292293
    293          HWND   getNextDlgTabItem(HWND hwndCtrl, BOOL fPrevious);
    294294         HWND   getNextDlgGroupItem(HWND hwndCtrl, BOOL fPrevious);
    295295
  • trunk/src/user32/windlg.cpp

    r5065 r5146  
    1 /* $Id: windlg.cpp,v 1.20 2001-02-05 18:49:30 sandervl Exp $ */
     1/* $Id: windlg.cpp,v 1.21 2001-02-17 14:49:26 sandervl Exp $ */
    22/*
    33 * Win32 dialog apis for OS/2
     
    241241    return (BOOL)SendDlgItemMessageA(hwnd, id,BM_GETCHECK,0,0);
    242242}
     243/***********************************************************************
     244 *           DIALOG_GetNextTabItem
     245 *
     246 * Helper for GetNextDlgTabItem
     247 */
     248static HWND DIALOG_GetNextTabItem( HWND hwndMain, HWND hwndDlg, HWND hwndCtrl, BOOL fPrevious )
     249{
     250    LONG dsStyle;
     251    LONG exStyle;
     252    UINT wndSearch = fPrevious ? GW_HWNDPREV : GW_HWNDNEXT;
     253    HWND retWnd = 0;
     254    HWND hChildFirst = 0;
     255
     256    if(!hwndCtrl)
     257    {
     258        hChildFirst = GetWindow(hwndDlg,GW_CHILD);
     259        if(fPrevious) hChildFirst = GetWindow(hChildFirst,GW_HWNDLAST);
     260    }
     261    else
     262    {
     263        HWND hParent = GetParent(hwndCtrl);
     264        BOOL bValid = FALSE;
     265        while( hParent)
     266        {
     267            if(hParent == hwndMain)
     268            {
     269                bValid = TRUE;
     270                break;
     271            }
     272            hParent = GetParent(hParent);
     273        }
     274        if(bValid)
     275        {
     276            hChildFirst = GetWindow(hwndCtrl,wndSearch);
     277            if(!hChildFirst)
     278            {
     279                if(GetParent(hwndCtrl) != hwndMain)
     280                    hChildFirst = GetWindow(GetParent(hwndCtrl),wndSearch);
     281                else
     282                {
     283                    if(fPrevious)
     284                        hChildFirst = GetWindow(hwndCtrl,GW_HWNDLAST);
     285                    else
     286                        hChildFirst = GetWindow(hwndCtrl,GW_HWNDFIRST);
     287                }
     288            }
     289        }       
     290    }
     291    while(hChildFirst)
     292    {
     293        BOOL bCtrl = FALSE;
     294        while(hChildFirst)
     295        {
     296            dsStyle = GetWindowLongA(hChildFirst,GWL_STYLE);
     297            exStyle = GetWindowLongA(hChildFirst,GWL_EXSTYLE);
     298            if( (dsStyle & DS_CONTROL || exStyle & WS_EX_CONTROLPARENT) && (dsStyle & WS_VISIBLE) && !(dsStyle & WS_DISABLED))
     299            {
     300                bCtrl=TRUE;
     301                break;
     302            }
     303            else if( (dsStyle & WS_TABSTOP) && (dsStyle & WS_VISIBLE) && !(dsStyle & WS_DISABLED))
     304                break;
     305            hChildFirst = GetWindow(hChildFirst,wndSearch);
     306        }
     307        if(hChildFirst)
     308        {
     309            if(bCtrl)
     310                retWnd = DIALOG_GetNextTabItem(hwndMain,hChildFirst,(HWND)NULL,fPrevious );
     311            else
     312                retWnd = hChildFirst;
     313        }
     314        if(retWnd) break;
     315        hChildFirst = GetWindow(hChildFirst,wndSearch);
     316    }
     317    if(!retWnd && hwndCtrl)
     318    {
     319        HWND hParent = GetParent(hwndCtrl);
     320        while(hParent)
     321        {
     322            if(hParent == hwndMain) break;
     323            retWnd = DIALOG_GetNextTabItem(hwndMain,GetParent(hParent),hParent,fPrevious );
     324            if(retWnd) break;
     325            hParent = GetParent(hParent);
     326        }
     327        if(!retWnd)
     328            retWnd = DIALOG_GetNextTabItem(hwndMain,hwndMain,(HWND)NULL,fPrevious );
     329    }
     330    return retWnd;
     331}
    243332//******************************************************************************
    244333//******************************************************************************
     
    253342        return 0;
    254343    }
    255     dprintf(("USER32:  GetNextDlgTabItem\n"));
    256     return window->getNextDlgTabItem(hwndCtrl, fPrevious);
     344    dprintf(("USER32: GetNextDlgTabItem %x %x %d", hwndDlg,hwndCtrl,fPrevious));
     345    return DIALOG_GetNextTabItem(hwndDlg,hwndDlg,hwndCtrl,fPrevious);
    257346}
    258347//******************************************************************************
Note: See TracChangeset for help on using the changeset viewer.