📄 configdlg.cpp
字号:
// ConfigDlg.cpp : implementation file
//
#include "stdafx.h"
#include "VecDraw.h"
#include "ConfigDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CConfigDlg dialog
CConfigDlg::CConfigDlg(CWnd* pParent, DCB dcb)
: CDialog(CConfigDlg::IDD, pParent)
{
m_dcb = dcb;
}
CConfigDlg::CConfigDlg(CWnd* pParent /*=NULL*/)
: CDialog(CConfigDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CConfigDlg)
m_ComNumb = _T("");
m_BaudRate = _T("");
m_ByteSize = _T("");
m_StopBits = _T("");
m_Parity = _T("");
m_CommBreakDetected = FALSE;
m_CommCTSDetected = FALSE;
m_CommDSRDetected = FALSE;
m_CommERRDetected = FALSE;
m_CommRingDetected = FALSE;
m_CommRLSDDetected = FALSE;
m_CommRXchar = FALSE;
m_CommRXcharFlag = FALSE;
m_CommTXEmpty = FALSE;
m_strSendBuffer = _T("");
//}}AFX_DATA_INIT
}
void CConfigDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CConfigDlg)
DDX_Control(pDX, IDC_COMBO5, Box_Parity);
DDX_Control(pDX, IDC_COMBO4, Box_StopBits);
DDX_Control(pDX, IDC_COMBO3, Box_ByteSize);
DDX_Control(pDX, IDC_COMBO2, Box_BaudRate);
DDX_Control(pDX, IDC_COMBO1, Box_ComNumb);
DDX_CBString(pDX, IDC_COMBO1, m_ComNumb);
DDX_CBString(pDX, IDC_COMBO2, m_BaudRate);
DDX_CBString(pDX, IDC_COMBO3, m_ByteSize);
DDX_CBString(pDX, IDC_COMBO4, m_StopBits);
DDX_CBString(pDX, IDC_COMBO5, m_Parity);
DDX_Check(pDX, IDC_CHECK1, m_CommBreakDetected);
DDX_Check(pDX, IDC_CHECK2, m_CommCTSDetected);
DDX_Check(pDX, IDC_CHECK3, m_CommDSRDetected);
DDX_Check(pDX, IDC_CHECK4, m_CommERRDetected);
DDX_Check(pDX, IDC_CHECK5, m_CommRingDetected);
DDX_Check(pDX, IDC_CHECK6, m_CommRLSDDetected);
DDX_Check(pDX, IDC_CHECK7, m_CommRXchar);
DDX_Check(pDX, IDC_CHECK8, m_CommRXcharFlag);
DDX_Check(pDX, IDC_CHECK9, m_CommTXEmpty);
DDX_CBString(pDX, IDC_COMBO6, m_strSendBuffer);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CConfigDlg, CDialog)
//{{AFX_MSG_MAP(CConfigDlg)
// NOTE: the ClassWizard will add message map macros here
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CConfigDlg message handlers
BOOL CConfigDlg::OnInitDialog()
{
CDialog::OnInitDialog();
CString str[4]={"1","2","3","4"};
for(int i=0;i<4;i++)
{
Box_ComNumb.InsertString(i,str[i]);
}
Box_ComNumb.SetCurSel(0);
CString str1[4]={"4800","9600","19200","115200"};
for(i=0;i<4;i++)
{
Box_BaudRate.InsertString(i,str1[i]);
}
Box_BaudRate.SetCurSel(1);
CString str2[5]={"4","5","6","7","8"};
for(i=0;i<5;i++)
{
Box_ByteSize.InsertString(i,str2[i]);
}
Box_ByteSize.SetCurSel(4);
CString str3[3]={"0","1","2"};
for(i=0;i<3;i++)
{
Box_StopBits.InsertString(i,str3[i]);
}
Box_StopBits.SetCurSel(1);
CString str4[5]={"0","1","2","3","4"};
for(i=0;i<5;i++)
{
Box_Parity.InsertString(i,str4[i]);
}
Box_Parity.SetCurSel(0);
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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -