loggingpage.cpp
来自「Synaptics触摸板应用开发包(SDK)」· C++ 代码 · 共 91 行
CPP
91 行
// LoggingPage.cpp : implementation file
//
#include "stdafx.h"
#include "mfctest.h"
#include "LoggingPage.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CLoggingPage property page
IMPLEMENT_DYNCREATE(CLoggingPage, CPropertyPage)
CLoggingPage::CLoggingPage() : CPropertyPage(CLoggingPage::IDD)
{
//{{AFX_DATA_INIT(CLoggingPage)
m_LogFileName = _T("");
//}}AFX_DATA_INIT
}
CLoggingPage::~CLoggingPage()
{
}
void CLoggingPage::DoDataExchange(CDataExchange* pDX)
{
CPropertyPage::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CLoggingPage)
DDX_Text(pDX, IDC_LOGFILE, m_LogFileName);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CLoggingPage, CPropertyPage)
//{{AFX_MSG_MAP(CLoggingPage)
ON_BN_CLICKED(IDC_ENABLE, OnEnable)
ON_BN_CLICKED(IDC_DISABLE, OnDisable)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CLoggingPage message handlers
int StateToControl(int iState)
{
switch(iState)
{
case 0:
return IDC_DISABLE;
default:
return IDC_ENABLE;
}
}
BOOL CLoggingPage::OnInitDialog()
{
CPropertyPage::OnInitDialog();
CheckRadioButton(IDC_ENABLE, IDC_DISABLE,
StateToControl(m_iState));
::EnableWindow(GetDlgItem(IDC_LOGFILE)->m_hWnd, m_iState);
return TRUE;
}
void CLoggingPage::OnOK()
{
m_pView->UpdateLogFile(m_LogFileName, m_iState);
CPropertyPage::OnOK();
}
void CLoggingPage::OnEnable()
{
m_iState = 1;
::EnableWindow(GetDlgItem(IDC_LOGFILE)->m_hWnd, m_iState);
}
void CLoggingPage::OnDisable()
{
m_iState = 0;
::EnableWindow(GetDlgItem(IDC_LOGFILE)->m_hWnd, m_iState);
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?