📄 loggingpage.cpp
字号:
// LoggingPage.cpp : implementation file
//
#include "stdafx.h"
#include "SynView.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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -