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

📄 chatwnd.cpp

📁 传2机器人源代码VC
💻 CPP
字号:
// ChatWnd.cpp: implementation of the CChatWnd class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "MirRobot.h"
#include "ChatWnd.h"
#include "windowsx.h"

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

BEGIN_MESSAGE_MAP(CChatWnd,CSizingControlBarCF)
	//{{AFX_MSG_MAP(CMyBar)
	ON_WM_CREATE()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

CChatWnd::CChatWnd()
{
	m_font.CreatePointFont(9*10,"宋体");
}

CChatWnd::~CChatWnd()
{

}

int CChatWnd::OnCreate(LPCREATESTRUCT lpCreateStruct) 
{
	m_szHorz.cy=128;
	m_szVert.cy=128;
	if (CSizingControlBarCF::OnCreate(lpCreateStruct) == -1)
		return -1;

	SetSCBStyle(GetSCBStyle()|/*SCBS_SHOWEDGES|*/SCBS_SIZECHILD);

	const DWORD dwViewStyle=WS_CHILD|WS_VISIBLE|WS_BORDER|WS_VSCROLL|LBS_NOINTEGRALHEIGHT;

	if(!m_wndChild.Create(dwViewStyle,
		CRect(0,0,0,0),this,123))
		return -1;
	m_wndChild.SetWindowText("Welcome to use MirRobot!\n");

	m_wndChild.SetFont(&m_font);
	m_wndChild.AddString("欢迎使用!");
	m_wndChild.AddString("MirRobot未公开版本.");
	return 0;
}

BOOL CChatWnd::AddString(CString s)
{
	int cnt=m_wndChild.GetCount();
	if(cnt>=200)
		m_wndChild.DeleteString(cnt);
	return m_wndChild.SetCurSel(m_wndChild.AddString(s));
}

⌨️ 快捷键说明

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