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.
This commit is contained in:
parent
9cd9cfd2ed
commit
bea0555890
@ -1529,29 +1529,19 @@ static BOOL PROPSHEET_CreatePage(HWND hwndParent,
|
|||||||
(DWORD)hwndPage, rc.left, rc.top, rc.right, rc.bottom,
|
(DWORD)hwndPage, rc.left, rc.top, rc.right, rc.bottom,
|
||||||
pageWidth, pageHeight, padding.x, padding.y);
|
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 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))
|
|
||||||
{
|
|
||||||
((PropSheetInfo *)psInfo)->ppshheader.u4.hbmWatermark =
|
|
||||||
CreateMappedBitmap(ppshpage->hInstance, (INT)psInfo->ppshheader.u4.pszbmWatermark, 0, NULL, 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (psInfo->ppshheader.dwFlags & (PSH_WIZARD97_NEW | PSH_WIZARD97_OLD) &&
|
if (psInfo->ppshheader.dwFlags & (PSH_WIZARD97_NEW | PSH_WIZARD97_OLD) &&
|
||||||
psInfo->ppshheader.dwFlags & PSH_HEADER)
|
psInfo->ppshheader.dwFlags & PSH_HEADER)
|
||||||
{
|
{
|
||||||
/* Same behavior as for watermarks */
|
if ((ppshpage->dwFlags & PSP_USEHEADERTITLE) &&
|
||||||
if (!(psInfo->ppshheader.dwFlags & PSH_USEHBMHEADER))
|
(HIWORD(ppshpage->pszHeaderTitle) == 0))
|
||||||
{
|
{
|
||||||
((PropSheetInfo *)psInfo)->ppshheader.u5.hbmHeader =
|
/* FIXME: load title string into ppshpage->pszHeaderTitle */
|
||||||
CreateMappedBitmap(ppshpage->hInstance, (INT)psInfo->ppshheader.u5.pszbmHeader, 0, NULL, 0);
|
}
|
||||||
|
|
||||||
|
if ((ppshpage->dwFlags & PSP_USEHEADERSUBTITLE) &&
|
||||||
|
(HIWORD(ppshpage->pszHeaderSubTitle) == 0))
|
||||||
|
{
|
||||||
|
/* FIXME: load title string into ppshpage->pszHeaderSubTitle */
|
||||||
}
|
}
|
||||||
|
|
||||||
hwndChild = GetDlgItem(hwndParent, IDC_SUNKEN_LINEHEADER);
|
hwndChild = GetDlgItem(hwndParent, IDC_SUNKEN_LINEHEADER);
|
||||||
@ -1585,6 +1575,36 @@ static BOOL PROPSHEET_CreatePage(HWND hwndParent,
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/******************************************************************************
|
||||||
|
* 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
|
* PROPSHEET_ShowPage
|
||||||
*
|
*
|
||||||
@ -3210,6 +3230,8 @@ PROPSHEET_DialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||||||
|
|
||||||
PROPSHEET_CreateTabControl(hwnd, psInfo);
|
PROPSHEET_CreateTabControl(hwnd, psInfo);
|
||||||
|
|
||||||
|
PROPSHEET_LoadWizardBitmaps(psInfo);
|
||||||
|
|
||||||
if (psInfo->ppshheader.dwFlags & INTRNL_ANY_WIZARD)
|
if (psInfo->ppshheader.dwFlags & INTRNL_ANY_WIZARD)
|
||||||
{
|
{
|
||||||
ShowWindow(hwndTabCtrl, SW_HIDE);
|
ShowWindow(hwndTabCtrl, SW_HIDE);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user