historypage.cpp

来自「一个有分割窗口的程序」· C++ 代码 · 共 77 行

CPP
77
字号
// historyPage.cpp : implementation file
//

#include "stdafx.h"
#include "testCard.h"
#include "historyPage.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// historyPage property page

IMPLEMENT_DYNCREATE(historyPage, CPropertyPage)

historyPage::historyPage() : CPropertyPage(historyPage::IDD)
{
	//{{AFX_DATA_INIT(historyPage)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
	m_editBrush.CreateSolidBrush(RGB(255, 255, 255));
}

historyPage::~historyPage()
{
}

void historyPage::DoDataExchange(CDataExchange* pDX)
{
	CPropertyPage::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(historyPage)
		// NOTE: the ClassWizard will add DDX and DDV calls here
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(historyPage, CPropertyPage)
	//{{AFX_MSG_MAP(historyPage)
	ON_WM_SIZE()
	ON_WM_CTLCOLOR()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// historyPage message handlers

void historyPage::OnSize(UINT nType, int cx, int cy) 
{
//	CPropertyPage::OnSize(nType, cx, cy);
	this->ShowWindow(SW_MAXIMIZE);
	
	CWnd *pchild = this->GetWindow(GW_CHILD);//只有一个顶层子窗口
	if(pchild != NULL){
		CRect rect;
		this->GetWindowRect(&rect);
		pchild->ScreenToClient(&rect);
		pchild->SetWindowPos(NULL, 0, 0, rect.Width(), rect.Height(),
							SWP_NOZORDER | SWP_NOACTIVATE);
	}	
}

HBRUSH historyPage::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) 
{
	HBRUSH hbr = CPropertyPage::OnCtlColor(pDC, pWnd, nCtlColor);
	
	if(pWnd->GetDlgCtrlID() == IDC_EDIT1){
		pDC->SetBkColor(RGB(255, 255, 255));
		return m_editBrush;	
	}
	
	// TODO: Return a different brush if the default is not desired
	return hbr;
}

⌨️ 快捷键说明

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