📄 auto.cpp
字号:
// Auto.cpp : implementation file
//
#include "stdafx.h"
#include "LANDetect.h"
#include "Auto.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CAuto dialog
CAuto::CAuto(CWnd* pParent /*=NULL*/)
: CDialog(CAuto::IDD, pParent)
{
//{{AFX_DATA_INIT(CAuto)
m_f = FALSE;
m_f1 = FALSE;
m_f2 = FALSE;
m_etime = _T("");
//}}AFX_DATA_INIT
}
void CAuto::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CAuto)
DDX_Control(pDX, IDC_COMBO_SELECT, m_select);
DDX_Check(pDX, IDC_CHECK_AUTO, m_f);
DDX_Check(pDX, IDC_CHECK_TIMES, m_f1);
DDX_Check(pDX, IDC_CHECK_EXACT, m_f2);
DDX_Text(pDX, IDC_EDIT_TIME, m_etime);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CAuto, CDialog)
//{{AFX_MSG_MAP(CAuto)
ON_BN_CLICKED(IDC_CHECK_AUTO, OnCheckAuto)
ON_BN_CLICKED(IDC_CHECK_TIMES, OnCheckTimes)
ON_BN_CLICKED(IDC_CHECK_EXACT, OnCheckExact)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CAuto message handlers
BOOL CAuto::OnInitDialog()
{
CDialog::OnInitDialog();
m_f=f;
m_f1=f1;
m_f2=f2;
UpdateData(false);
if(!m_f)
{
GetDlgItem(IDC_CHECK_TIMES)->EnableWindow(false);
GetDlgItem(IDC_CHECK_EXACT)->EnableWindow(false);
}
else
{
GetDlgItem(IDC_CHECK_TIMES)->EnableWindow(true);
GetDlgItem(IDC_CHECK_EXACT)->EnableWindow(true);
}
if(m_f1)
{
GetDlgItem(IDC_COMBO_SELECT)->EnableWindow(true);
m_select.SetCurSel(sele);
}
else
{
GetDlgItem(IDC_COMBO_SELECT)->EnableWindow(false);
}
if(m_f2)
{
GetDlgItem(IDC_EDIT_TIME)->EnableWindow(true);
m_etime=etime;
UpdateData(false);
}
else
{
GetDlgItem(IDC_EDIT_TIME)->EnableWindow(false);
}
// 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 CAuto::OnCheckAuto()
{
CButton *pBtn=(CButton*)GetDlgItem(IDC_CHECK_AUTO);
if(pBtn->GetCheck())
{
GetDlgItem(IDC_CHECK_TIMES)->EnableWindow(true);
GetDlgItem(IDC_CHECK_EXACT)->EnableWindow(true);
m_f=true;
UpdateData(false);
}
else
{
GetDlgItem(IDC_CHECK_TIMES)->EnableWindow(false);
GetDlgItem(IDC_COMBO_SELECT)->EnableWindow(false);
GetDlgItem(IDC_CHECK_EXACT)->EnableWindow(false);
GetDlgItem(IDC_EDIT_TIME)->EnableWindow(false);
m_f=false;
m_f1=false;
m_f2=false;
UpdateData(false);
}
}
void CAuto::OnCheckTimes()
{
CButton *pBtn=(CButton*)GetDlgItem(IDC_CHECK_TIMES);
if(pBtn->GetCheck())
{
GetDlgItem(IDC_COMBO_SELECT)->EnableWindow(true);
m_select.SetCurSel(0);
m_f1=true;
UpdateData(false);
}
else
{
GetDlgItem(IDC_COMBO_SELECT)->EnableWindow(false);
m_f1=false;
UpdateData(false);
}
}
void CAuto::OnCheckExact()
{
CButton *pBtn=(CButton*)GetDlgItem(IDC_CHECK_EXACT);
if(pBtn->GetCheck())
{
GetDlgItem(IDC_EDIT_TIME)->EnableWindow(true);
m_etime=etime;
m_f2=true;
UpdateData(false);
}
else
{
GetDlgItem(IDC_EDIT_TIME)->EnableWindow(false);
m_f2=false;
UpdateData(false);
}
}
void CAuto::OnOK()
{
UpdateData(true);
f=m_f;
f1=m_f1;
f2=m_f2;
sele=m_select.GetCurSel();
etime=m_etime;
CDialog::OnOK();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -