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

📄 cpgpdiskpage.cpp

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

        $Id: CPGPdiskPage.cpp,v 1.5 2002/08/06 20:09:24 dallen Exp $
____________________________________________________________________________*/

#include "pgpClassesConfig.h"

#include "CBitmap.h"
#include "CDC.h"
#include "CPalette.h"
#include "CRect.h"

#include "UCommonStrings.h"

#include "CHelpShower.h"
#include "CPGPdiskPage.h"
#include "Resource.h"

_USING_PGP

// Class CPGPdiskPage member functions

void 
CPGPdiskPage::Create(
	const char		*title, 
	PGPBoolean		isInterior, 
	const CBitmap	*pBitmap, 
	const CPalette	*pPalette)
{
	mPSidebarBitmap = pBitmap;
	mPSidebarPalette = pPalette;
	mIsInterior = isInterior;

	CPropertyPage::Create(title);
}

void 
CPGPdiskPage::OnContextMenu(HWND menuWnd, CPoint coords)
{
	CHelpShower::ShowContextMenu(menuWnd, GetPageHelpIds());
}

void 
CPGPdiskPage::OnHelp(HELPINFO *pInfo)
{
	CHelpShower::ShowForControl(static_cast<HWND>(pInfo->hItemHandle), 
		GetPageHelpIds());
}

BOOL 
CPGPdiskPage::OnInitDialog(HWND focusCtrl)
{
	using namespace UCommonStrings;

	CPropertyPage::OnInitDialog(focusCtrl);

	LOGFONT	lf;
	pgpClearMemory(&lf, sizeof(lf));

	if (mIsInterior)
	{
		strcpy(lf.lfFaceName, Get(kWizFontInterior));

		lf.lfHeight = 8;
		lf.lfWeight = FW_BOLD;
	}
	else
	{
		strcpy(lf.lfFaceName, Get(kWizFontIntroDone));
		lf.lfWeight = FW_BOLD;

		mSidebarStatic.Subclass(GetDlgItem(IDC_SIDEBAR));

		CRect	sidebarRect;
		mSidebarStatic.GetWindowRect(sidebarRect);

		ScreenToClient(sidebarRect);
		mSidebarOrigin = CPoint(sidebarRect.Left(), sidebarRect.Top());
	}

	mHeaderFont.CreateIndirect(lf);

	mHeaderText.Subclass(GetDlgItem(IDC_HEADING));
	mHeaderText.SetFont(mHeaderFont);

	return FALSE;
}

void 
CPGPdiskPage::OnPaint(HDC paintDC)
{
	if (mIsInterior)
	{
		CPropertyPage::OnPaint(paintDC);
		return;
	}

	CDC	dc;

	if (IsNull(paintDC))
		dc.BeginPaint(Handle());
	else
		dc.Attach(paintDC);

	mPSidebarBitmap->PaintWithPalette(dc, mPSidebarPalette->Get(), 
		mSidebarOrigin);

	dc.Clear();
}

void 
CPGPdiskPage::OnPsnHelp()
{
	CHelpShower::ShowContext(Handle(), GetPageHelpId());
}

⌨️ 快捷键说明

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