dlgcomsettings.cpp

来自「一个操纵RS232端口的程序」· C++ 代码 · 共 69 行

CPP
69
字号
// DlgComSettings.cpp : implementation file
//

#include "stdafx.h"
#include "Terminal.h"
#include "DlgComSettings.h"

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

/////////////////////////////////////////////////////////////////////////////
// CDlgComSettings dialog


CDlgComSettings::CDlgComSettings(CWnd* pParent /*=NULL*/)
	: CDialog(CDlgComSettings::IDD, pParent)
{
	//{{AFX_DATA_INIT(CDlgComSettings)
	m_strBaud = _T("");
	m_strDataBits = _T("");
	m_bEcho = FALSE;
	m_iFlowCtrl = -1;
	m_bNewLine = FALSE;
	m_strParity = _T("");
	m_strPort = _T("");
	m_strStopBits = _T("");
	m_bConnected = FALSE;
	//}}AFX_DATA_INIT
}


void CDlgComSettings::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CDlgComSettings)
	DDX_CBString(pDX, IDC_CMB_BAUD, m_strBaud);
	DDX_CBString(pDX, IDC_CMB_DATABITS, m_strDataBits);
	DDX_Check(pDX, IDC_MBT_ECHO, m_bEcho);
	DDX_Radio(pDX, IDC_SBT_FLOWCONTROL, m_iFlowCtrl);
	DDX_Check(pDX, IDC_MBT_NEWLINE, m_bNewLine);
	DDX_CBString(pDX, IDC_CMB_PARITY, m_strParity);
	DDX_CBString(pDX, IDC_CMB_PORT, m_strPort);
	DDX_CBString(pDX, IDC_CMB_STOPBITS, m_strStopBits);
	//}}AFX_DATA_MAP
}


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

/////////////////////////////////////////////////////////////////////////////
// CDlgComSettings message handlers

BOOL CDlgComSettings::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	GetDlgItem(IDC_CMB_PORT)->EnableWindow(!m_bConnected);
	
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

⌨️ 快捷键说明

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