📄 setdlg.cpp
字号:
// SetDlg.cpp : implementation file
//
#include "stdafx.h"
#include "screen.h"
#include "SetDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CSetDlg dialog
CSetDlg::CSetDlg(CWnd* pParent /*=NULL*/)
: CDialog(CSetDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CSetDlg)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
comm=3;
baurd=9600;
}
void CSetDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CSetDlg)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CSetDlg, CDialog)
//{{AFX_MSG_MAP(CSetDlg)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CSetDlg message handlers
BOOL CSetDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
CComboBox* pCombo=(CComboBox*)GetDlgItem(IDC_COMBO1);
CString s;
for(int i=1;i<10;i++)
{
s.Format("COM%d",i);
pCombo->AddString(s);
}
s.Format("COM%d",comm);
pCombo->SetWindowText(s);
pCombo=(CComboBox*)GetDlgItem(IDC_COMBO2);
pCombo->AddString("1200");
pCombo->AddString("2400");
pCombo->AddString("4800");
pCombo->AddString("9600");
pCombo->AddString("19200");
s.Format("%d",baurd);
pCombo->SetWindowText(s);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CSetDlg::OnOK()
{
// TODO: Add extra validation here
CString str;
GetDlgItemText(IDC_COMBO1,str);
str=str.Right(str.GetLength()-3);
comm=atoi(str.GetBuffer(str.GetLength()));
GetDlgItemText(IDC_COMBO2,str);
baurd=atoi(str.GetBuffer(str.GetLength()));
CDialog::OnOK();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -