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

📄 keyedit.cpp

📁 仓储管理系统主要提供一个仓储业务及其作业管理的信息存储和检索系统。通过入库管理、出库管理、报表生成管理、仓库人员管理、仓库位置信息管理等功能模块来实现仓库的综合管理
💻 CPP
字号:
// KeyEdit.cpp : implementation file
//

#include "stdafx.h"
#include "aaa.h"
#include "KeyEdit.h"
#include "CustomGrid.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CKeyEdit

CKeyEdit::CKeyEdit()
{
	IsNumber =false;
}

CKeyEdit::~CKeyEdit()
{

}

BEGIN_MESSAGE_MAP(CKeyEdit, CEdit)
	//{{AFX_MSG_MAP(CKeyEdit)
	ON_WM_KEYDOWN()
	ON_CONTROL_REFLECT(EN_KILLFOCUS, OnKillfocus)
	ON_WM_KILLFOCUS()
	ON_WM_CREATE()
	ON_CONTROL_REFLECT(EN_CHANGE, OnChange)
	ON_WM_CHAR()
	ON_WM_PAINT()
	ON_WM_DRAWITEM()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CKeyEdit message handlers

void CKeyEdit::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags) 
{	
	CEdit::OnKeyDown(nChar, nRepCnt, nFlags);
}

void CKeyEdit::OnKillfocus() 
{

}

void CKeyEdit::OnKillFocus(CWnd* pNewWnd) 
{
	CCustomGrid * temp = (CCustomGrid *)GetParent();
	if (temp)
	{
		temp->DisposeEdit(true);
	}
}

int CKeyEdit::OnCreate(LPCREATESTRUCT lpCreateStruct) 
{
	if (CEdit::OnCreate(lpCreateStruct) == -1)
		return -1;
	LOGFONT font;
	font.lfHeight = -12;
	font.lfWidth = 0;
	font.lfItalic = 0;
	font.lfStrikeOut = 0;
	font.lfEscapement = 0;
	font.lfUnderline = 0;
	font.lfWeight = 400;
	font.lfCharSet = 134;
	strcpy(font.lfFaceName,"宋体");
	m_font.DeleteObject();
	if (m_font.CreateFontIndirect(&font))
		SetFont(&m_font);

	return 0;
}

void CKeyEdit::OnChange() 
{
	// TODO: If this is a RICHEDIT control, the control will not
	// send this notification unless you override the CEdit::OnInitDialog()
	// function and call CRichEditCtrl().SetEventMask()
	// with the ENM_CHANGE flag ORed into the mask.
	
	// TODO: Add your control notification handler code here
	
}

void CKeyEdit::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags) 
{
	if (IsNumber)
		if (((nChar <45)||(nChar>46)&&(nChar<48)||(nChar > 57))&& (nChar != 8))
			nChar = 0;
		else
			CEdit::OnChar(nChar, nRepCnt, nFlags);
	else
		CEdit::OnChar(nChar, nRepCnt, nFlags);
}


⌨️ 快捷键说明

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