Ignore:
Timestamp:
Oct 1, 2001, 7:28:09 PM (24 years ago)
Author:
sandervl
Message:

GetNextDlgGroupItem fix

File:
1 edited

Legend:

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

    r6902 r6927  
    1 /* $Id: win32wbase.cpp,v 1.286 2001-09-30 22:24:41 sandervl Exp $ */
     1/* $Id: win32wbase.cpp,v 1.287 2001-10-01 17:28:08 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    32793279
    32803280        break;
     3281
     3282    case GW_HWNDNEXTCHILD:
     3283        lock();
     3284        window = (Win32BaseWindow *)getNextChild();
     3285        if(window) {
     3286             hwndRelated = window->getWindowHandle();
     3287        }
     3288        else hwndRelated = 0;
     3289        unlock();
     3290        break;
     3291
     3292    case GW_HWNDFIRSTCHILD:
     3293        lock();
     3294        window = (Win32BaseWindow *)getFirstChild();
     3295        if(window) {
     3296             hwndRelated = window->getWindowHandle();
     3297        }
     3298        else hwndRelated = 0;
     3299        unlock();
     3300        break;
     3301
     3302    case GW_HWNDLASTCHILD:
     3303        lock();
     3304        window = (Win32BaseWindow *)getFirstChild();
     3305        if(window) {
     3306             while (window->getNextChild())
     3307             {
     3308                window = (Win32BaseWindow *)window->getNextChild();
     3309             }
     3310             hwndRelated = window->getWindowHandle();
     3311        }
     3312        else hwndRelated = 0;
     3313        unlock();
     3314        break;
    32813315    }
    32823316end:
     
    37483782{
    37493783    dwIDMenu = id;
    3750 }
    3751 //******************************************************************************
    3752 //******************************************************************************
    3753 HWND Win32BaseWindow::getNextDlgGroupItem(HWND hwndCtrl, BOOL fPrevious)
    3754 {
    3755  Win32BaseWindow *firstchild = NULL, *child, *nextchild, *lastchild;
    3756  HWND retvalue;
    3757 
    3758     lock();
    3759     if (hwndCtrl)
    3760     {
    3761         firstchild = child = GetWindowFromHandle(hwndCtrl);
    3762         if (!child)
    3763         {
    3764             retvalue = 0;
    3765             goto END;
    3766         }
    3767         /* Make sure hwndCtrl is a top-level child */
    3768         while ((child->getStyle() & WS_CHILD) && (child->getParent() != this))
    3769         {
    3770             child = child->getParent();
    3771             if(child == NULL) break;
    3772         }
    3773         if (!child || (child->getParent() != this))
    3774         {
    3775             retvalue = 0;
    3776             goto END;
    3777         }
    3778     }
    3779     else
    3780     {
    3781         /* No ctrl specified -> start from the beginning */
    3782         child = (Win32BaseWindow *)getFirstChild();
    3783         if (!child)
    3784         {
    3785             retvalue = 0;
    3786             goto END;
    3787         }
    3788 
    3789         if (fPrevious)
    3790         {
    3791             while (child->getNextChild())
    3792             {
    3793                 child = (Win32BaseWindow *)child->getNextChild();
    3794             }
    3795         }
    3796     }
    3797 
    3798     lastchild = child;
    3799     nextchild = (Win32BaseWindow *)child->getNextChild();
    3800     while (TRUE)
    3801     {
    3802         if (!nextchild || (nextchild->getStyle() & WS_GROUP))
    3803         {
    3804             /* Wrap-around to the beginning of the group */
    3805             Win32BaseWindow *pWndTemp;
    3806 
    3807             nextchild = (Win32BaseWindow *)getFirstChild();
    3808 
    3809             for(pWndTemp = nextchild;pWndTemp;pWndTemp = (Win32BaseWindow *)pWndTemp->getNextChild())
    3810             {
    3811                 if (pWndTemp->getStyle() & WS_GROUP)
    3812                     nextchild = pWndTemp;
    3813 
    3814                 if (pWndTemp == child)
    3815                     break;
    3816             }
    3817 
    3818         }
    3819         if (nextchild == child)
    3820             break;
    3821 
    3822         if ((nextchild->getStyle() & WS_VISIBLE) && !(nextchild->getStyle() & WS_DISABLED))
    3823         {
    3824             lastchild = nextchild;
    3825 
    3826             if (!fPrevious)
    3827                 break;
    3828         }
    3829 
    3830         nextchild = (Win32BaseWindow *)nextchild->getNextChild();
    3831     }
    3832     retvalue = lastchild->getWindowHandle();
    3833 END:
    3834     unlock();
    3835     if(firstchild) RELEASE_WNDOBJ(firstchild);
    3836     return retvalue;
    38373784}
    38383785//******************************************************************************
Note: See TracChangeset for help on using the changeset viewer.