bookdetailsdlg.cpp

来自「Windows CE Database Programming using ED」· C++ 代码 · 共 75 行

CPP
75
字号
// BookDetailsDlg.cpp : implementation file
//

#include "stdafx.h"
#include "Books.h"
#include "BookDetailsDlg.h"


// CBookDetailsDlg dialog

IMPLEMENT_DYNAMIC(CBookDetailsDlg, CDialog)

CBookDetailsDlg::CBookDetailsDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CBookDetailsDlg::IDD, pParent)
{

}

CBookDetailsDlg::~CBookDetailsDlg()
{
}

void CBookDetailsDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
}


BEGIN_MESSAGE_MAP(CBookDetailsDlg, CDialog)
END_MESSAGE_MAP()


// CBookDetailsDlg message handlers

void CBookDetailsDlg::CreateMenu(UINT uMenuId)
{
	SHMENUBARINFO info; 
	
	info.cbSize			= sizeof(info); 
	info.hwndParent		= m_hWnd; 
	info.dwFlags		= SHCMBF_HMENU; 
	info.nToolBarId		= uMenuId; 
	info.hInstRes		= ::AfxGetInstanceHandle(); 
	info.nBmpId			= 0; 
	info.cBmpImages		= 0; 
	
	SHCreateMenuBar(&info);
}
BOOL CBookDetailsDlg::OnInitDialog()
{
	CDialog::OnInitDialog();

	CreateMenu(IDR_OKCANCEL);
	SetControlValues();

	return TRUE;
}

void CBookDetailsDlg::SetControlValues()
{
	GetDlgItem(IDC_TITLE)->SetWindowText(m_strTitle);
	GetDlgItem(IDC_ISBN)->SetWindowText(m_strISBN);
	GetDlgItem(IDC_AUTHOR)->SetWindowText(m_strAuthors);
	GetDlgItem(IDC_DESC)->SetWindowText(m_strDesc);
}
void CBookDetailsDlg::OnOK()
{
	GetDlgItem(IDC_TITLE)->GetWindowText(m_strTitle);
	GetDlgItem(IDC_ISBN)->GetWindowText(m_strISBN);
	GetDlgItem(IDC_AUTHOR)->GetWindowText(m_strAuthors);
	GetDlgItem(IDC_DESC)->GetWindowText(m_strDesc);

	CDialog::OnOK();
}

⌨️ 快捷键说明

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