log.cpp
来自「网络编程」· C++ 代码 · 共 92 行
CPP
92 行
// Log.cpp : implementation file
//
#include "stdafx.h"
#include "Chat Server.h"
#include "Log.h"
#include "MainSheet.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CLog property page
IMPLEMENT_DYNCREATE(CLog, CPropertyPage)
CLog::CLog() : CPropertyPage(CLog::IDD)
{
//{{AFX_DATA_INIT(CLog)
//}}AFX_DATA_INIT
}
CLog::~CLog()
{
}
void CLog::DoDataExchange(CDataExchange* pDX)
{
CPropertyPage::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CLog)
DDX_Control(pDX, IDC_EDTLOG, m_edtLog);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CLog, CPropertyPage)
//{{AFX_MSG_MAP(CLog)
// NOTE: the ClassWizard will add message map macros here
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CLog message handlers
BOOL CLog::PreTranslateMessage (MSG* pMsg)
{
// Let the ToolTip process this message.
m_tooltip.RelayEvent(pMsg);
return CPropertyPage::PreTranslateMessage(pMsg);
}
BOOL CLog::OnInitDialog()
{
CPropertyPage::OnInitDialog();
// Create the ToolTip control.
m_tooltip.Create (this);
m_tooltip.Activate (TRUE);
// TODO: Use one of the following forms to add controls:
// m_tooltip.AddTool (GetDlgItem (IDC_<name>), <string-table-id>);
// m_tooltip.AddTool (GetDlgItem (IDC_<name>), _T ("<text>"));
return TRUE;
}
//DEL void CLog::LogMessage(CString msg)
//DEL {
//DEL msg += "\r\n";
//DEL int iTotalLength = m_edtLog.GetWindowTextLength();
//DEL m_edtLog.SetSel(iTotalLength, iTotalLength);
//DEL m_edtLog.ReplaceSel(msg);
//DEL
//DEL }
void CLog::SetOwner(CMainSheet *pSheet)
{
m_pMainSheet = pSheet;
}
BOOL CLog::OnSetActive()
{
// TODO: Add your specialized code here and/or call the base class
CString strLog = m_pMainSheet->GetLogMessage();
m_edtLog.SetWindowText(strLog);
return CPropertyPage::OnSetActive();
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?