Commit bea05558 authored by Eric Kohl's avatar Eric Kohl Committed by Alexandre Julliard

Move watermark and header bitmap loading code from

PROPSHEET_CreatePage into its own function PROPSHEET_LoadWizardBitmaps and call this function from property sheet's dialog procedure.
parent 9cd9cfd2
......@@ -1529,29 +1529,19 @@ static BOOL PROPSHEET_CreatePage(HWND hwndParent,
(DWORD)hwndPage, rc.left, rc.top, rc.right, rc.bottom,
pageWidth, pageHeight, padding.x, padding.y);
/* If there is a watermark, offset the dialog items */
if ( (psInfo->ppshheader.dwFlags & (PSH_WIZARD97_NEW | PSH_WIZARD97_OLD)) &&
(psInfo->ppshheader.dwFlags & PSH_WATERMARK) &&
((index == 0) || (index == psInfo->nPages - 1)) )
if (psInfo->ppshheader.dwFlags & (PSH_WIZARD97_NEW | PSH_WIZARD97_OLD) &&
psInfo->ppshheader.dwFlags & PSH_HEADER)
{
/* if PSH_USEHBMWATERMARK is not set, load the resource from pszbmWatermark
and put the HBITMAP in hbmWatermark. Thus all the rest of the code always
considers hbmWatermark as valid. */
if (!(psInfo->ppshheader.dwFlags & PSH_USEHBMWATERMARK))
if ((ppshpage->dwFlags & PSP_USEHEADERTITLE) &&
(HIWORD(ppshpage->pszHeaderTitle) == 0))
{
((PropSheetInfo *)psInfo)->ppshheader.u4.hbmWatermark =
CreateMappedBitmap(ppshpage->hInstance, (INT)psInfo->ppshheader.u4.pszbmWatermark, 0, NULL, 0);
/* FIXME: load title string into ppshpage->pszHeaderTitle */
}
}
if (psInfo->ppshheader.dwFlags & (PSH_WIZARD97_NEW | PSH_WIZARD97_OLD) &&
psInfo->ppshheader.dwFlags & PSH_HEADER)
{
/* Same behavior as for watermarks */
if (!(psInfo->ppshheader.dwFlags & PSH_USEHBMHEADER))
if ((ppshpage->dwFlags & PSP_USEHEADERSUBTITLE) &&
(HIWORD(ppshpage->pszHeaderSubTitle) == 0))
{
((PropSheetInfo *)psInfo)->ppshheader.u5.hbmHeader =
CreateMappedBitmap(ppshpage->hInstance, (INT)psInfo->ppshheader.u5.pszbmHeader, 0, NULL, 0);
/* FIXME: load title string into ppshpage->pszHeaderSubTitle */
}
hwndChild = GetDlgItem(hwndParent, IDC_SUNKEN_LINEHEADER);
......@@ -1586,6 +1576,36 @@ static BOOL PROPSHEET_CreatePage(HWND hwndParent,
}
/******************************************************************************
* PROPSHEET_LoadWizardBitmaps
*
* Loads the watermark and header bitmaps for a wizard.
*/
static VOID PROPSHEET_LoadWizardBitmaps(PropSheetInfo *psInfo)
{
if (psInfo->ppshheader.dwFlags & (PSH_WIZARD97_NEW | PSH_WIZARD97_OLD))
{
/* if PSH_USEHBMWATERMARK is not set, load the resource from pszbmWatermark
and put the HBITMAP in hbmWatermark. Thus all the rest of the code always
considers hbmWatermark as valid. */
if ((psInfo->ppshheader.dwFlags & PSH_WATERMARK) &&
!(psInfo->ppshheader.dwFlags & PSH_USEHBMWATERMARK))
{
((PropSheetInfo *)psInfo)->ppshheader.u4.hbmWatermark =
CreateMappedBitmap(psInfo->ppshheader.hInstance, (INT)psInfo->ppshheader.u4.pszbmWatermark, 0, NULL, 0);
}
/* Same behavior as for watermarks */
if ((psInfo->ppshheader.dwFlags & PSH_HEADER) &&
!(psInfo->ppshheader.dwFlags & PSH_USEHBMHEADER))
{
((PropSheetInfo *)psInfo)->ppshheader.u5.hbmHeader =
CreateMappedBitmap(psInfo->ppshheader.hInstance, (INT)psInfo->ppshheader.u5.pszbmHeader, 0, NULL, 0);
}
}
}
/******************************************************************************
* PROPSHEET_ShowPage
*
* Displays or creates the specified page.
......@@ -3210,6 +3230,8 @@ PROPSHEET_DialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
PROPSHEET_CreateTabControl(hwnd, psInfo);
PROPSHEET_LoadWizardBitmaps(psInfo);
if (psInfo->ppshheader.dwFlags & INTRNL_ANY_WIZARD)
{
ShowWindow(hwndTabCtrl, SW_HIDE);
......
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