ppagesetcharge.cpp
来自「一个串口通信好例子,是完整的VC++工程,很值得初学者学习.」· C++ 代码 · 共 86 行
CPP
86 行
// PPageSetCharge.cpp : implementation file
//
#include "stdafx.h"
#include "parksys.h"
#include "PPageSetCharge.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CPPageSetCharge property page
IMPLEMENT_DYNCREATE(CPPageSetCharge, CPropertyPage)
CPPageSetCharge::CPPageSetCharge() : CPropertyPage(CPPageSetCharge::IDD)
{
//{{AFX_DATA_INIT(CPPageSetCharge)
//}}AFX_DATA_INIT
}
CPPageSetCharge::~CPPageSetCharge()
{
}
void CPPageSetCharge::DoDataExchange(CDataExchange* pDX)
{
CPropertyPage::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CPPageSetCharge)
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CPPageSetCharge, CPropertyPage)
//{{AFX_MSG_MAP(CPPageSetCharge)
ON_CBN_EDITCHANGE(IDC_CHARGETYPE, OnSelchangeChargetype)
ON_CBN_EDITCHANGE(IDC_CARDCLASS, OnSelchangeCardclass)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
void CPPageSetCharge::SetCombCurSel(UINT nIDComb, UINT index)
{
CWnd* pWnd = GetDlgItem(nIDComb);
CComboBox* p_comb;
p_comb = (CComboBox*)pWnd;
p_comb->SetCurSel(index);
}
UINT CPPageSetCharge::GetCombCurSel(UINT nIDComb)
{
CWnd* pWnd = GetDlgItem(nIDComb);
CComboBox* p_comb;
p_comb = (CComboBox*)pWnd;
return p_comb->GetCurSel();
}
/////////////////////////////////////////////////////////////////////////////
// CPPageSetCharge message handlers
BOOL CPPageSetCharge::OnInitDialog()
{
CPropertyPage::OnInitDialog();
// TODO: Add extra initialization here
SetCombCurSel(IDC_CHARGETYPE, m_chargetype);
SetCombCurSel(IDC_CARDCLASS, m_cardclass);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CPPageSetCharge::OnSelchangeChargetype()
{
// TODO: Add your control notification handler code here
m_chargetype = GetCombCurSel(IDC_CHARGETYPE);
}
void CPPageSetCharge::OnSelchangeCardclass()
{
// TODO: Add your control notification handler code here
m_cardclass = GetCombCurSel(IDC_CARDCLASS);
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?