⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cpropertysheet.cpp

📁 PGP8.0源码 请认真阅读您的文件包然后写出其具体功能
💻 CPP
字号:
/*____________________________________________________________________________
		Copyright (C) 2002 PGP Corporation
        All rights reserved.

        $Id: CPropertySheet.cpp,v 1.3 2002/08/06 20:10:46 dallen Exp $
____________________________________________________________________________*/

#include "pgpClassesConfig.h"

#include "CPropertyPage.h"
#include "CPropertySheet.h"
#include "UModuleInstance.h"

_USING_PGP

// Class CPropertySheet member functions

CPropertySheet::CPropertySheet() : mNumPages(0)
{
}

CPropertySheet::~CPropertySheet()
{
	ClearPages();
}

void 
CPropertySheet::AddPage(CPropertyPage *pPage)
{
	pgpAssertAddrValid(pPage, CPropertyPage);

	pPage->SetVariables(&mError, &mSkipConfirmCancel);
	mPageList.AddTail(pPage);
}

void 
CPropertySheet::RemovePage(CPropertyPage *pPage)
{
	pgpAssertAddrValid(pPage, CPropertyPage);
	mPageList.Remove(pPage);
}

void 
CPropertySheet::ClearPages()
{
	mPageList.Empty();
	mNumPages = 0;
}

void 
CPropertySheet::Create(HWND parent, PGPBoolean isWizard)
{
	pgpAssert(!mPageList.IsEmpty());
	pgpAssert(CWindow::IsWindow(parent));

	pgpClearMemory(&mPSH, sizeof(mPSH));

	mPSH.dwSize		= sizeof(mPSH);
	mPSH.dwFlags	= PSH_HASHELP | PSH_NOAPPLYNOW | 
		(isWizard ? PSH_WIZARD | PSH_WIZARDCONTEXTHELP : 0);
	mPSH.hwndParent	= parent;
	mPSH.hInstance	= UModuleInstance::Get();

	mPageArray.Resize(mPageList.Count());

	CPropertyPage	*pPage	= reinterpret_cast<CPropertyPage *>(
		mPageList.Head());
	PGPUInt32		i		= 0;

	while (IsntNull(pPage))
	{
		mPageArray[i++] = pPage->PageHandle();
		pPage = reinterpret_cast<CPropertyPage *>(mPageList.Next(pPage));
	}

	mPSH.nPages = mPageList.Count();
	mPSH.phpage = mPageArray.Get();

	mError = CComboError();
	mSkipConfirmCancel = FALSE;

	PreCreateHook();

	try
	{
		PGPInt32	result	= PropertySheet(&mPSH);

		if (result == -1)
			THROW_ERRORS(kPGPError_Win32CommCtrlOpFailed, GetLastError());

		if (mError.IsError())
			throw mError;

		ClearPages();
	}
	catch (CComboError&)
	{
		ClearPages();
		throw;
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -