?? comset.cpp
字號:
// ComSet.cpp : implementation file
//
#include "stdafx.h"
#include "myPager.h"
#include "ComSet.h"
#include "myPagerDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
extern CMyPagerApp theApp;
/////////////////////////////////////////////////////////////////////////////
// CComSet dialog
CComSet::CComSet(CWnd* pParent /*=NULL*/)
: CDialog(CComSet::IDD, pParent)
{
//{{AFX_DATA_INIT(CComSet)
//}}AFX_DATA_INIT
}
void CComSet::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CComSet)
DDX_Control(pDX, IDC_COM_SPEED, m_cComSpeed);
DDX_Control(pDX, IDC_COM_NUM, m_cComSet);
DDX_Control(pDX, IDOK, m_cIDOK);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CComSet, CDialog)
//{{AFX_MSG_MAP(CComSet)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CComSet message handlers
BOOL CComSet::PreTranslateMessage(MSG* pMsg)
{
// TODO: Add your specialized code here and/or call the base class
if (pMsg->message==WM_KEYDOWN && pMsg->wParam==VK_RETURN)
{
CWnd* v_wCtrl=GetFocus(); //獲得焦點
if (v_wCtrl==&m_cIDOK) //列表窗回車
{
OnOK();
return true;
}
CDialog* Pwnd=(CDialog*)GetActiveWindow(); //取得對話框指針
Pwnd->NextDlgCtrl(); //切換到下一個輸入焦點
return true;
}
return CDialog::PreTranslateMessage(pMsg);
}
BOOL CComSet::OnInitDialog()
{
CDialog::OnInitDialog();
m_cComSet.SetCurSel(v_iComm); //初始化串口
m_cComSpeed.SetCurSel(v_iSpeed);//初始化串口速率
// TODO: Add extra initialization here
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CComSet::OnOK()
{
// TODO: Add extra validation here
v_iComm=m_cComSet.GetCurSel();
v_iSpeed=m_cComSpeed.GetCurSel();
CDialog::OnOK();
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -