This reverts Matts patch. The messaging needs double checking.
This commit is contained in:
parent
916f975624
commit
fd018cc9da
|
@ -1080,9 +1080,6 @@ static int PROPSHEET_CreatePage(HWND hwndParent,
|
||||||
*/
|
*/
|
||||||
static BOOL PROPSHEET_ShowPage(HWND hwndDlg, int index, PropSheetInfo * psInfo)
|
static BOOL PROPSHEET_ShowPage(HWND hwndDlg, int index, PropSheetInfo * psInfo)
|
||||||
{
|
{
|
||||||
PSHNOTIFY psn;
|
|
||||||
HWND hwndTabCtrl;
|
|
||||||
|
|
||||||
if (index == psInfo->active_page)
|
if (index == psInfo->active_page)
|
||||||
{
|
{
|
||||||
if (GetTopWindow(hwndDlg) != psInfo->proppage[index].hwndPage)
|
if (GetTopWindow(hwndDlg) != psInfo->proppage[index].hwndPage)
|
||||||
|
@ -1090,17 +1087,13 @@ static BOOL PROPSHEET_ShowPage(HWND hwndDlg, int index, PropSheetInfo * psInfo)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Synchronize current selection with tab control */
|
|
||||||
hwndTabCtrl = GetDlgItem(hwndDlg, IDC_TABCONTROL);
|
|
||||||
SendMessageA(hwndTabCtrl, TCM_SETCURSEL, index, 0);
|
|
||||||
|
|
||||||
if (psInfo->proppage[index].hwndPage == 0)
|
if (psInfo->proppage[index].hwndPage == 0)
|
||||||
{
|
{
|
||||||
LPCPROPSHEETPAGEA ppshpage;
|
LPCPROPSHEETPAGEA ppshpage;
|
||||||
|
PSHNOTIFY psn;
|
||||||
|
|
||||||
ppshpage = (LPCPROPSHEETPAGEA)psInfo->proppage[index].hpage;
|
ppshpage = (LPCPROPSHEETPAGEA)psInfo->proppage[index].hpage;
|
||||||
PROPSHEET_CreatePage(hwndDlg, index, psInfo, ppshpage);
|
PROPSHEET_CreatePage(hwndDlg, index, psInfo, ppshpage);
|
||||||
}
|
|
||||||
|
|
||||||
psn.hdr.hwndFrom = hwndDlg;
|
psn.hdr.hwndFrom = hwndDlg;
|
||||||
psn.hdr.code = PSN_SETACTIVE;
|
psn.hdr.code = PSN_SETACTIVE;
|
||||||
|
@ -1108,17 +1101,28 @@ static BOOL PROPSHEET_ShowPage(HWND hwndDlg, int index, PropSheetInfo * psInfo)
|
||||||
psn.lParam = 0;
|
psn.lParam = 0;
|
||||||
|
|
||||||
/* Send the notification before showing the page. */
|
/* Send the notification before showing the page. */
|
||||||
SendMessageA(psInfo->proppage[index].hwndPage, WM_NOTIFY, 0, (LPARAM) &psn);
|
SendMessageA(psInfo->proppage[index].hwndPage,
|
||||||
|
WM_NOTIFY, 0, (LPARAM) &psn);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* TODO: check return value.
|
* TODO: check return value.
|
||||||
*/
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
if (psInfo->active_page != -1)
|
if (psInfo->active_page != -1)
|
||||||
ShowWindow(psInfo->proppage[psInfo->active_page].hwndPage, SW_HIDE);
|
ShowWindow(psInfo->proppage[psInfo->active_page].hwndPage, SW_HIDE);
|
||||||
|
|
||||||
ShowWindow(psInfo->proppage[index].hwndPage, SW_SHOW);
|
ShowWindow(psInfo->proppage[index].hwndPage, SW_SHOW);
|
||||||
|
|
||||||
|
if (!(psInfo->ppshheader->dwFlags & PSH_WIZARD))
|
||||||
|
{
|
||||||
|
HWND hwndTabCtrl;
|
||||||
|
|
||||||
|
/* Synchronize current selection with tab control */
|
||||||
|
hwndTabCtrl = GetDlgItem(hwndDlg, IDC_TABCONTROL);
|
||||||
|
SendMessageA(hwndTabCtrl, TCM_SETCURSEL, index, 0);
|
||||||
|
}
|
||||||
|
|
||||||
psInfo->active_page = index;
|
psInfo->active_page = index;
|
||||||
psInfo->activeValid = TRUE;
|
psInfo->activeValid = TRUE;
|
||||||
|
|
||||||
|
@ -1516,6 +1520,27 @@ static BOOL PROPSHEET_SetCurSel(HWND hwndDlg,
|
||||||
|
|
||||||
hwndPage = psInfo->proppage[index].hwndPage;
|
hwndPage = psInfo->proppage[index].hwndPage;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Notify the new page if it's already created.
|
||||||
|
* If not it will get created and notified in PROPSHEET_ShowPage.
|
||||||
|
*/
|
||||||
|
if (hwndPage)
|
||||||
|
{
|
||||||
|
int result;
|
||||||
|
PSHNOTIFY psn;
|
||||||
|
|
||||||
|
psn.hdr.code = PSN_SETACTIVE;
|
||||||
|
psn.hdr.hwndFrom = hwndDlg;
|
||||||
|
psn.hdr.idFrom = 0;
|
||||||
|
psn.lParam = 0;
|
||||||
|
|
||||||
|
result = SendMessageA(hwndPage, WM_NOTIFY, 0, (LPARAM) &psn);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* TODO: check return value.
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Display the new page.
|
* Display the new page.
|
||||||
*/
|
*/
|
||||||
|
@ -2110,6 +2135,7 @@ PROPSHEET_DialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
|
|
||||||
PROPSHEET_SetCurSel(hwnd, idx, psInfo->proppage[idx].hpage);
|
PROPSHEET_SetCurSel(hwnd, idx, psInfo->proppage[idx].hpage);
|
||||||
|
|
||||||
|
if (!(psInfo->ppshheader->dwFlags & PSH_WIZARD))
|
||||||
SendMessageA(hwndTabCtrl, TCM_SETCURSEL, psInfo->active_page, 0);
|
SendMessageA(hwndTabCtrl, TCM_SETCURSEL, psInfo->active_page, 0);
|
||||||
|
|
||||||
if (!HIWORD(psInfo->ppshheader->pszCaption) &&
|
if (!HIWORD(psInfo->ppshheader->pszCaption) &&
|
||||||
|
|
Loading…
Reference in New Issue