infosheet.cpp

来自「VC.net 的一些有用的技巧」· C++ 代码 · 共 44 行

CPP
44
字号
// InfoSheet.cpp : 实现文件
//

#include "stdafx.h"
#include "PropDlgDemo.h"
#include "InfoSheet.h"


// CInfoSheet

IMPLEMENT_DYNAMIC(CInfoSheet, CPropertySheet)
CInfoSheet::CInfoSheet(UINT nIDCaption, CWnd* pParentWnd, UINT iSelectPage)
	:CPropertySheet(nIDCaption, pParentWnd, iSelectPage)
{
}

CInfoSheet::CInfoSheet(LPCTSTR pszCaption, CWnd* pParentWnd, UINT iSelectPage)
	:CPropertySheet(pszCaption, pParentWnd, iSelectPage)
{
	AddPage(&m_AuthorPage);//向属性对话框中添加页
	AddPage(&m_BookPage);
}

CInfoSheet::~CInfoSheet()
{
}


BEGIN_MESSAGE_MAP(CInfoSheet, CPropertySheet)
	ON_BN_CLICKED(ID_APPLY_NOW, OnApplyNow)
END_MESSAGE_MAP()


// CInfoSheet 消息处理程序
void CInfoSheet::OnApplyNow()
{
	CFrameWnd* pFrameWnd = (CFrameWnd*) AfxGetMainWnd();
	//获取指向视图的指针
	CView* pView = pFrameWnd->GetActiveFrame()->GetActiveView();
	//发送用户定义消息,在视图中输出信息
	pView->SendMessage(WM_USER_OUTPUT,(WPARAM)this);
	m_AuthorPage.SetModified(FALSE);
	m_BookPage.SetModified(FALSE); //使Apply按钮禁止
}

⌨️ 快捷键说明

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