inputwnd.cpp

来自「传2机器人源代码VC」· C++ 代码 · 共 68 行

CPP
68
字号
// InputWnd.cpp: implementation of the CInputWnd class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "MirRobot.h"
#include "InputWnd.h"

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

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

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

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

CInputWnd::~CInputWnd()
{

}

int CInputWnd::OnCreate(LPCREATESTRUCT lpCreateStruct) 
{
	m_szHorz.cy=32;
	m_szVert.cy=32;
	m_szMinHorz.cy=32;
	m_szMinVert.cy=32;
	if (CSizingControlBarCF::OnCreate(lpCreateStruct) == -1)
		return -1;

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

	const DWORD dwViewStyle=ES_MULTILINE|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.SetFont(&m_font);
	CRect r;
	return 0;
}

CString CInputWnd::GetAndEmpty()
{
	CString s;
	m_wndChild.GetWindowText(s);
	m_wndChild.SetWindowText("");
	return s;
}

BOOL CInputWnd::IsActive()
{
	return (m_wndChild.GetFocus())->m_hWnd==m_wndChild.m_hWnd;
}

⌨️ 快捷键说明

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