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

📄 bookinfo.cpp

📁 MFC程序开发参考大全 【明日科技】宋坤 刘锐宁 李伟明 【丛 书 名】 软件工程师典藏 【出 版 社】 人民邮电出版社 本书详细介绍了MFC框架中所有常用类及控件的应用
💻 CPP
字号:
// BookInfo.cpp : implementation file
//

#include "stdafx.h"
#include "EncapsulateThread.h"
#include "BookInfo.h"

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

/////////////////////////////////////////////////////////////////////////////
// CBookInfo dialog


CBookInfo::CBookInfo(CWnd* pParent /*=NULL*/)
	: CDialog(CBookInfo::IDD, pParent)
{
	//{{AFX_DATA_INIT(CBookInfo)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
}


void CBookInfo::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CBookInfo)
	DDX_Control(pDX, IDC_SAVE, m_Save);
	DDX_Control(pDX, IDC_PRICE, m_Price);
	DDX_Control(pDX, IDC_CANCEL, m_Cancel);
	DDX_Control(pDX, IDC_BOOKINFO, m_BookInfo);
	DDX_Control(pDX, IDC_BOOKCONCERN, m_BookConcern);
	DDX_Control(pDX, IDC_BARCODE, m_Barcode);
	DDX_Control(pDX, IDC_AUTHOR, m_Author);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CBookInfo, CDialog)
	//{{AFX_MSG_MAP(CBookInfo)
	ON_BN_CLICKED(IDC_SAVE, OnSave)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CBookInfo message handlers

BOOL CBookInfo::PreTranslateMessage(MSG* pMsg) 
{
	//Judge enter key whether or not is pressed
	if( (pMsg->message==WM_KEYDOWN)&&(pMsg->wParam==13))
	{
		MoveFocus();	
	}
	return CDialog::PreTranslateMessage(pMsg);
}

void CBookInfo::MoveFocus()
{
	CWnd* pWnd = GetFocus();
	if (pWnd)
	{
		CWnd* pNextDlg = CWnd::FromHandlePermanent( GetNextDlgTabItem(pWnd)->m_hWnd);
		if ((pNextDlg!=NULL)&&(pNextDlg->IsKindOf(RUNTIME_CLASS(CEdit))))
			pNextDlg->SetFocus();
	}
}

void CBookInfo::OnOK()
{

}

void CBookInfo::OnSave() 
{
	
}

⌨️ 快捷键说明

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