portsetdlg.cpp

来自「通过串口升级mega8的自编程例子原码」· C++ 代码 · 共 73 行

CPP
73
字号
// PortSetDlg.cpp : implementation file
//

#include "stdafx.h"
#include "M8.h"
#include "PortSetDlg.h"

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

/////////////////////////////////////////////////////////////////////////////
// CPortSetDlg dialog


CPortSetDlg::CPortSetDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CPortSetDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CPortSetDlg)
	m_Baud = _T("");
	m_DataBits = _T("");
	m_Parity = _T("");
	m_Port = _T("");
	m_StopsBits = _T("");
	//}}AFX_DATA_INIT
}


void CPortSetDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CPortSetDlg)
	DDX_CBString(pDX, IDC_BAUD, m_Baud);
	DDX_CBString(pDX, IDC_DATABITS, m_DataBits);
	DDX_CBString(pDX, IDC_PARITY, m_Parity);
	DDX_CBString(pDX, IDC_PORT, m_Port);
	DDX_CBString(pDX, IDC_STOPSBITS, m_StopsBits);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CPortSetDlg, CDialog)
	//{{AFX_MSG_MAP(CPortSetDlg)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CPortSetDlg message handlers

BOOL CPortSetDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	CComboBox* pPort = (CComboBox*)GetDlgItem(IDC_PORT);
	for (int i=0; i<p_PortArray->GetSize(); i++)
	{
		pPort->AddString(p_PortArray->GetAt(i));
	}
	pPort->SetCurSel(0);
	
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CPortSetDlg::OnOK() 
{
	// TODO: Add extra validation here
	
	CDialog::OnOK();
}

⌨️ 快捷键说明

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