Commit 32b23b34 authored by Filip Navara's avatar Filip Navara Committed by Alexandre Julliard

- Revert incorrect change to tab control resizing from revision 1.109.

- Move the property sheet resizing code from PROPSHEET_CreatePage to PROPSHEET_SetCurSel. It needs to be executed on every page change because the application can modify it during the notifications.
parent 5d54c7ba
...@@ -1514,6 +1514,8 @@ static BOOL PROPSHEET_CreatePage(HWND hwndParent, ...@@ -1514,6 +1514,8 @@ static BOOL PROPSHEET_CreatePage(HWND hwndParent,
psInfo->proppage[index].hwndPage = hwndPage; psInfo->proppage[index].hwndPage = hwndPage;
/* NOTE: This code should be most probably moved to PROPSHEET_SetCurSel,
* but until it will be proved with test case it's left here. */
if (psInfo->ppshheader.dwFlags & INTRNL_ANY_WIZARD) { if (psInfo->ppshheader.dwFlags & INTRNL_ANY_WIZARD) {
int offsety = 0; int offsety = 0;
HWND hwndChild; HWND hwndChild;
...@@ -1549,21 +1551,6 @@ static BOOL PROPSHEET_CreatePage(HWND hwndParent, ...@@ -1549,21 +1551,6 @@ static BOOL PROPSHEET_CreatePage(HWND hwndParent,
rc.top + padding.y/2 + offsety, rc.top + padding.y/2 + offsety,
pageWidth, pageHeight - offsety, 0); pageWidth, pageHeight - offsety, 0);
} }
else {
/*
* Ask the Tab control to reduce the client rectangle to that
* it has available.
*/
PROPSHEET_GetPageRect(psInfo, hwndParent, &rc);
pageWidth = rc.right - rc.left;
pageHeight = rc.bottom - rc.top;
TRACE("setting page %08lx, rc (%ld,%ld)-(%ld,%ld) w=%d, h=%d\n",
(DWORD)hwndPage, rc.left, rc.top, rc.right, rc.bottom,
pageWidth, pageHeight);
SetWindowPos(hwndPage, HWND_TOP,
rc.left, rc.top,
pageWidth, pageHeight, 0);
}
return TRUE; return TRUE;
} }
...@@ -2027,8 +2014,6 @@ static BOOL PROPSHEET_CanSetCurSel(HWND hwndDlg) ...@@ -2027,8 +2014,6 @@ static BOOL PROPSHEET_CanSetCurSel(HWND hwndDlg)
HWND hwndPage; HWND hwndPage;
PSHNOTIFY psn; PSHNOTIFY psn;
BOOL res = FALSE; BOOL res = FALSE;
HWND hwndTabControl;
RECT rect;
TRACE("active_page %d\n", psInfo->active_page); TRACE("active_page %d\n", psInfo->active_page);
if (!psInfo) if (!psInfo)
...@@ -2054,16 +2039,6 @@ static BOOL PROPSHEET_CanSetCurSel(HWND hwndDlg) ...@@ -2054,16 +2039,6 @@ static BOOL PROPSHEET_CanSetCurSel(HWND hwndDlg)
res = !SendMessageA(hwndPage, WM_NOTIFY, 0, (LPARAM) &psn); res = !SendMessageA(hwndPage, WM_NOTIFY, 0, (LPARAM) &psn);
/*
* Re-adjust the tab control's contents
*/
hwndTabControl = GetDlgItem(hwndDlg, IDC_TABCONTROL);
memset( &rect, 0, sizeof rect );
GetClientRect( hwndTabControl, &rect );
SendMessageW( hwndTabControl, TCM_ADJUSTRECT, 0, (LPARAM) &rect );
SetWindowPos( hwndPage, NULL, rect.left, rect.top,
rect.right - rect.left, rect.bottom - rect.top, 0 );
end: end:
TRACE("<-- %d\n", res); TRACE("<-- %d\n", res);
return res; return res;
...@@ -2096,6 +2071,7 @@ static BOOL PROPSHEET_SetCurSel(HWND hwndDlg, ...@@ -2096,6 +2071,7 @@ static BOOL PROPSHEET_SetCurSel(HWND hwndDlg,
while (1) { while (1) {
int result; int result;
PSHNOTIFY psn; PSHNOTIFY psn;
RECT rc;
if (hwndTabControl) if (hwndTabControl)
SendMessageW(hwndTabControl, TCM_SETCURSEL, index, 0); SendMessageW(hwndTabControl, TCM_SETCURSEL, index, 0);
...@@ -2110,6 +2086,22 @@ static BOOL PROPSHEET_SetCurSel(HWND hwndDlg, ...@@ -2110,6 +2086,22 @@ static BOOL PROPSHEET_SetCurSel(HWND hwndDlg,
PROPSHEET_CreatePage(hwndDlg, index, psInfo, ppshpage); PROPSHEET_CreatePage(hwndDlg, index, psInfo, ppshpage);
} }
/* NOTE: The resizing happens every time the page is selected and
* not only when it's created (some applications depend on it). */
if (!(psInfo->ppshheader.dwFlags & INTRNL_ANY_WIZARD)) {
/*
* Ask the Tab control to reduce the client rectangle to that
* it has available.
*/
PROPSHEET_GetPageRect(psInfo, hwndDlg, &rc);
TRACE("setting page %p, rc (%ld,%ld)-(%ld,%ld) w=%ld, h=%ld\n",
psInfo->proppage[index].hwndPage, rc.left, rc.top, rc.right, rc.bottom,
rc.right - rc.left, rc.bottom - rc.top);
SetWindowPos(psInfo->proppage[index].hwndPage, HWND_TOP,
rc.left, rc.top,
rc.right - rc.left, rc.bottom - rc.top, 0);
}
result = SendMessageW(psInfo->proppage[index].hwndPage, WM_NOTIFY, 0, (LPARAM) &psn); result = SendMessageW(psInfo->proppage[index].hwndPage, WM_NOTIFY, 0, (LPARAM) &psn);
if (!result) if (!result)
break; break;
......
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