⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 outputview.cpp

📁 关于使用VC编程的代码
💻 CPP
字号:
// OutputView.cpp : implementation file
//

#include "stdafx.h"
#include "MyChatSvr.h"
#include "OutputView.h"
#include "MyChatSvrDoc.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// COutputView

IMPLEMENT_DYNCREATE(COutputView, CEditView)

COutputView::COutputView()
{
}

COutputView::~COutputView()
{
}


BEGIN_MESSAGE_MAP(COutputView, CEditView)
	//{{AFX_MSG_MAP(COutputView)
		// NOTE - the ClassWizard will add and remove mapping macros here.
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// COutputView drawing

void COutputView::OnDraw(CDC* pDC)
{
	CDocument* pDoc = GetDocument();
	// TODO: add draw code here
}

/////////////////////////////////////////////////////////////////////////////
// COutputView diagnostics

#ifdef _DEBUG
void COutputView::AssertValid() const
{
	CEditView::AssertValid();
}

void COutputView::Dump(CDumpContext& dc) const
{
	CEditView::Dump(dc);
}
#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// COutputView message handlers

BOOL COutputView::PreCreateWindow(CREATESTRUCT& cs) 
{
	BOOL bRet = CEditView::PreCreateWindow(cs);
	cs.style = AFX_WS_DEFAULT_VIEW | WS_VSCROLL | ES_AUTOHSCROLL |
		ES_AUTOVSCROLL | ES_MULTILINE | ES_NOHIDESEL | ES_READONLY;
	return bRet;
}

void COutputView::MsgOut(CString strMsg)
{
	CEdit& theEdit = GetEditCtrl();
	int nSel = theEdit.GetWindowTextLength();
	theEdit.SetSel(nSel,nSel);
	strMsg += "\r\n";
	theEdit.ReplaceSel(strMsg);
	CMyChatSvrDoc* pDoc;
	pDoc = (CMyChatSvrDoc*)GetDocument();
	pDoc->m_bContentModified = TRUE;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -