Ignore:
Timestamp:
Oct 10, 1999, 10:59:41 AM (26 years ago)
Author:
sandervl
Message:

Dialog, style + window handle translation bugfixes

File:
1 edited

Legend:

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

    r1194 r1240  
    1 /* $Id: win32dlg.cpp,v 1.8 1999-10-08 18:39:34 sandervl Exp $ */
     1/* $Id: win32dlg.cpp,v 1.9 1999-10-10 08:59:41 sandervl Exp $ */
    22/*
    33 * Win32 Dialog Code for OS/2
     
    199199        hwndFocus = GetNextDlgTabItem( getWindowHandle(), 0, FALSE );
    200200
    201         if (SendMessageA(WM_INITDIALOG, (WPARAM)hwndFocus, param ))
     201    if (SendMessageA(WM_INITDIALOG, (WPARAM)hwndFocus, param ))
    202202             SetFocus(hwndFocus);
    203203
     
    207207            ::UpdateWindow( getWindowHandle() );
    208208        }
    209         SetLastError(0);
     209    SetLastError(0);
    210210        dprintf(("********* DIALOG CREATED ************"));
    211211        return;
     
    233233    /* Owner must be a top-level window */
    234234    if(getOwner() == NULL) {
    235         topOwner = windowDesktop;
     235    topOwner = windowDesktop;
    236236    }
    237237    else topOwner = getOwner()->getTopParent();
     
    980980        if (child == nextchild) break;
    981981
    982             if ((nextchild->getStyle() & WS_TABSTOP) && (nextchild->getStyle() & WS_VISIBLE) &&
     982        if ((nextchild->getStyle() & WS_TABSTOP) && (nextchild->getStyle() & WS_VISIBLE) &&
    983983            !(nextchild->getStyle() & WS_DISABLED))
     984        {
     985            lastchild = nextchild;
     986            if (!fPrevious) break;
     987        }
     988        nextchild = (Win32BaseWindow *)nextchild->getNextChild();
     989    }
     990    retvalue = lastchild->getWindowHandle();
     991
     992END:
     993    return retvalue;
     994}
     995//******************************************************************************
     996//******************************************************************************
     997HWND Win32Dialog::getNextDlgGroupItem(HWND hwndCtrl, BOOL fPrevious)
     998{
     999 Win32BaseWindow *child, *nextchild, *lastchild;
     1000 HWND retvalue;
     1001
     1002    if (hwndCtrl)
     1003    {
     1004        child = GetWindowFromHandle(hwndCtrl);
     1005        if (!child)
     1006        {
     1007            retvalue = 0;
     1008            goto END;
     1009        }
     1010        /* Make sure hwndCtrl is a top-level child */
     1011        while ((child->getStyle() & WS_CHILD) && (child->getParent() != this))
     1012        {
     1013            child = child->getParent();
     1014            if(child == NULL) break;
     1015        }
     1016
     1017        if (!child || child->getParent() != this)
     1018        {
     1019            retvalue = 0;
     1020            goto END;
     1021        }
     1022    }
     1023    else
     1024    {
     1025        /* No ctrl specified -> start from the beginning */
     1026        child = (Win32BaseWindow *)getFirstChild();
     1027        if (!child)
     1028        {
     1029            retvalue = 0;
     1030            goto END;
     1031        }
     1032
     1033        if (fPrevious)
     1034        {
     1035            while (child->getNextChild())
     1036            {
     1037                child = (Win32BaseWindow *)child->getNextChild();
     1038            }
     1039        }
     1040    }
     1041
     1042    lastchild = child;
     1043    nextchild = (Win32BaseWindow *)child->getNextChild();
     1044    while (TRUE)
     1045    {
     1046        if (!nextchild || nextchild->getStyle() & WS_GROUP)
     1047        {
     1048            /* Wrap-around to the beginning of the group */
     1049            Win32BaseWindow *pWndTemp;
     1050
     1051            nextchild = (Win32BaseWindow *)getFirstChild();
     1052
     1053            for(pWndTemp = nextchild;pWndTemp;pWndTemp = (Win32BaseWindow *)pWndTemp->getNextChild())
     1054            {
     1055                if (pWndTemp->getStyle() & WS_GROUP) nextchild = pWndTemp;
     1056                if (pWndTemp == child) break;
     1057            }
     1058
     1059        }
     1060        if (nextchild == child) break;
     1061
     1062            if ((nextchild->getStyle() & WS_VISIBLE) && !(nextchild->getStyle() & WS_DISABLED))
    9841063            {
    9851064                lastchild = nextchild;
    986                 if (!fPrevious) break;
    987             }
    988             nextchild = (Win32BaseWindow *)nextchild->getNextChild();
     1065            if (!fPrevious) break;
     1066        }
    9891067    }
    9901068    retvalue = lastchild->getWindowHandle();
    991 
    9921069END:
    9931070    return retvalue;
Note: See TracChangeset for help on using the changeset viewer.