📄 messageview.cpp
字号:
// MessageView.cpp : implementation file
//
#include "stdafx.h"
#include "ChatClient.h"
#include "MessageView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CMessageView
IMPLEMENT_DYNCREATE(CMessageView, CEditView)
CMessageView::CMessageView()
{
}
CMessageView::~CMessageView()
{
}
BEGIN_MESSAGE_MAP(CMessageView, CEditView)
//{{AFX_MSG_MAP(CMessageView)
// NOTE - the ClassWizard will add and remove mapping macros here.
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CMessageView drawing
void CMessageView::OnDraw(CDC* pDC)
{
CDocument* pDoc = GetDocument();
// TODO: add draw code here
}
/////////////////////////////////////////////////////////////////////////////
// CMessageView diagnostics
#ifdef _DEBUG
void CMessageView::AssertValid() const
{
CEditView::AssertValid();
}
void CMessageView::Dump(CDumpContext& dc) const
{
CEditView::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CMessageView message handlers
BOOL CMessageView::PreCreateWindow(CREATESTRUCT& cs)
{
BOOL ret = CEditView::PreCreateWindow(cs);
cs.style = AFX_WS_DEFAULT_VIEW |
WS_VSCROLL |
ES_AUTOVSCROLL |
ES_MULTILINE |
ES_NOHIDESEL;
return ret;
}
void CMessageView::ShowMessage(LPCTSTR lpszMessage)
{
CString strTemp = lpszMessage;
strTemp += _T("\r\n");
int len = GetWindowTextLength();
GetEditCtrl().SetSel(len,len);
GetEditCtrl().ReplaceSel(strTemp);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -