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

📄 inputview.cpp

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

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

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

/////////////////////////////////////////////////////////////////////////////
// CInputView

IMPLEMENT_DYNCREATE(CInputView, CEditView)

CInputView::CInputView()
{
}

CInputView::~CInputView()
{
}


BEGIN_MESSAGE_MAP(CInputView, CEditView)
	//{{AFX_MSG_MAP(CInputView)
	ON_WM_CHAR()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CInputView drawing

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

/////////////////////////////////////////////////////////////////////////////
// CInputView diagnostics

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

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

/////////////////////////////////////////////////////////////////////////////
// CInputView message handlers

void CInputView::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags) 
{
	if ((nChar != VK_RETURN) || (nRepCnt!=1))
	{
		CEditView::OnChar(nChar, nRepCnt, nFlags);
		return;
	}
	else
	{
		CString strMsg;
		CMainFrame* pFrm = (CMainFrame*)AfxGetApp()->GetMainWnd();
		COutputView* pView = (COutputView*)pFrm->m_wndSplitter.GetPane(0,0);
		GetEditCtrl().GetWindowText(strMsg);
		GetEditCtrl().SetWindowText("");
		pView->MsgOut("Server: " + strMsg);

		CMyChatSvrDoc* pDoc = (CMyChatSvrDoc*)GetDocument();
		pDoc->BroadcastMsg(NULL, strMsg);
	}
}

⌨️ 快捷键说明

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