Commit 1720c985 authored by Ulrich Czekalla's avatar Ulrich Czekalla Committed by Alexandre Julliard

Implemented support of DS_CONTROL and WS_EX_CONTROLPARENT styles.

parent b81e96eb
...@@ -1883,75 +1883,104 @@ HWND16 WINAPI GetNextDlgTabItem16( HWND16 hwndDlg, HWND16 hwndCtrl, ...@@ -1883,75 +1883,104 @@ HWND16 WINAPI GetNextDlgTabItem16( HWND16 hwndDlg, HWND16 hwndCtrl,
return (HWND16)GetNextDlgTabItem( hwndDlg, hwndCtrl, fPrevious ); return (HWND16)GetNextDlgTabItem( hwndDlg, hwndCtrl, fPrevious );
} }
/*********************************************************************** /***********************************************************************
* GetNextDlgTabItem32 (USER32.276) * DIALOG_GetNextTabItem
*
* Helper for GetNextDlgTabItem
*/ */
HWND WINAPI GetNextDlgTabItem( HWND hwndDlg, HWND hwndCtrl, static HWND DIALOG_GetNextTabItem( HWND hwndMain, HWND hwndDlg, HWND hwndCtrl, BOOL fPrevious )
BOOL fPrevious )
{ {
WND *pWnd = NULL, LONG dsStyle;
*pWndLast = NULL, LONG exStyle;
*pWndCtrl = NULL, UINT wndSearch = fPrevious ? GW_HWNDPREV : GW_HWNDNEXT;
*pWndDlg = NULL; HWND retWnd = 0;
HWND retvalue; HWND hChildFirst = 0;
if (!(pWndDlg = WIN_FindWndPtr( hwndDlg ))) return 0; if(!hwndCtrl)
if (hwndCtrl)
{ {
if (!(pWndCtrl = WIN_FindWndPtr( hwndCtrl ))) hChildFirst = GetWindow(hwndDlg,GW_CHILD);
if(fPrevious) hChildFirst = GetWindow(hChildFirst,GW_HWNDLAST);
}
else
{ {
retvalue = 0; HWND hParent = GetParent(hwndCtrl);
goto END; BOOL bValid = FALSE;
while( hParent)
{
if(hParent == hwndMain)
{
bValid = TRUE;
break;
}
hParent = GetParent(hParent);
} }
/* Make sure hwndCtrl is a top-level child */ if(bValid)
while ((pWndCtrl->dwStyle & WS_CHILD) && (pWndCtrl->parent != pWndDlg))
WIN_UpdateWndPtr(&pWndCtrl,pWndCtrl->parent);
if (pWndCtrl->parent != pWndDlg)
{ {
retvalue = 0; hChildFirst = GetWindow(hwndCtrl,wndSearch);
goto END; if(!hChildFirst)
} {
if(GetParent(hwndCtrl) != hwndMain)
hChildFirst = GetWindow(GetParent(hwndCtrl),wndSearch);
else
{
if(fPrevious)
hChildFirst = GetWindow(hwndCtrl,GW_HWNDLAST);
else
hChildFirst = GetWindow(hwndCtrl,GW_HWNDFIRST);
}
}
}
} }
else while(hChildFirst)
{ {
/* No ctrl specified -> start from the beginning */ BOOL bCtrl = FALSE;
if (!(pWndCtrl = WIN_LockWndPtr(pWndDlg->child))) while(hChildFirst)
{ {
retvalue = 0; dsStyle = GetWindowLongA(hChildFirst,GWL_STYLE);
goto END; exStyle = GetWindowLongA(hChildFirst,GWL_EXSTYLE);
if(dsStyle & DS_CONTROL || exStyle & WS_EX_CONTROLPARENT)
{
bCtrl=TRUE;
break;
}
else if( (dsStyle & WS_TABSTOP) && (dsStyle & WS_VISIBLE) && !(dsStyle & WS_DISABLED))
break;
hChildFirst = GetWindow(hChildFirst,wndSearch);
} }
if(hChildFirst)
if (!fPrevious) {
while (pWndCtrl->next) WIN_UpdateWndPtr(&pWndCtrl,pWndCtrl->next); if(bCtrl)
retWnd = DIALOG_GetNextTabItem(hwndMain,hChildFirst,(HWND)NULL,fPrevious );
else
retWnd = hChildFirst;
}
if(retWnd) break;
hChildFirst = GetWindow(hChildFirst,wndSearch);
} }
if(!retWnd && hwndCtrl)
pWndLast = WIN_LockWndPtr(pWndCtrl);
pWnd = WIN_LockWndPtr(pWndCtrl->next);
while (1)
{ {
if (!pWnd) pWnd = WIN_LockWndPtr(pWndDlg->child); HWND hParent = GetParent(hwndCtrl);
if (pWnd == pWndCtrl) break; while(hParent)
if ((pWnd->dwStyle & WS_TABSTOP) && (pWnd->dwStyle & WS_VISIBLE) &&
!(pWnd->dwStyle & WS_DISABLED))
{ {
WIN_UpdateWndPtr(&pWndLast,pWnd); if(hParent == hwndMain) break;
if (!fPrevious) break; retWnd = DIALOG_GetNextTabItem(hwndMain,GetParent(hParent),hParent,fPrevious );
if(retWnd) break;
hParent = GetParent(hParent);
} }
WIN_UpdateWndPtr(&pWnd,pWnd->next); if(!retWnd)
retWnd = DIALOG_GetNextTabItem(hwndMain,hwndMain,(HWND)NULL,fPrevious );
} }
retvalue = pWndLast->hwndSelf; return retWnd;
WIN_ReleaseWndPtr(pWndLast);
WIN_ReleaseWndPtr(pWnd);
END:
WIN_ReleaseWndPtr(pWndCtrl);
WIN_ReleaseWndPtr(pWndDlg);
return retvalue;
} }
/***********************************************************************
* GetNextDlgTabItem32 (USER32.276)
*/
HWND WINAPI GetNextDlgTabItem( HWND hwndDlg, HWND hwndCtrl,
BOOL fPrevious )
{
return DIALOG_GetNextTabItem(hwndDlg,hwndDlg,hwndCtrl,fPrevious);
}
/********************************************************************** /**********************************************************************
* DIALOG_DlgDirSelect * DIALOG_DlgDirSelect
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment