?? timerset.cpp
字號:
// TimerSet.cpp : implementation file
//
#include "stdafx.h"
#include "vcsvr.h"
#include "TimerSet.h"
#include "MainFrm.h"
#include "TagDef.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CTimerSet dialog
CTimerSet::CTimerSet(CWnd* pParent /*=NULL*/)
: CDialog(CTimerSet::IDD, pParent)
{
//{{AFX_DATA_INIT(CTimerSet)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CTimerSet::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CTimerSet)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CTimerSet, CDialog)
//{{AFX_MSG_MAP(CTimerSet)
ON_WM_SHOWWINDOW()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CTimerSet message handlers
//設置設備標簽刷新周期
void CTimerSet::OnOK()
{
// TODO: Add extra validation here
long newInterval;
CString str;
CWnd *pWnd = GetParent();
CEdit *pWndEdit= (CEdit *)GetDlgItem(IDC_EDIT1);
pWndEdit->GetWindowText(str);
newInterval = atoi(str.GetBuffer(str.GetLength()));
if(newInterval!=TimerInterval)
{
TimerInterval=newInterval;
KillTimer(ID_TIMER);
pWnd->SetTimer(ID_TIMER,TimerInterval,NULL);
}
CDialog::OnOK();
}
//顯示當前刷新周期
void CTimerSet::OnShowWindow(BOOL bShow, UINT nStatus)
{
CDialog::OnShowWindow(bShow, nStatus);
char Interval[6];
itoa(TimerInterval,Interval,10);
CEdit *pWndEdit= (CEdit *)GetDlgItem(IDC_EDIT1);
pWndEdit->SetWindowText(Interval);
}
void CTimerSet::OnCancel()
{
// TODO: Add extra cleanup here
CDialog::OnCancel();
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -