listctrleditbox.cpp

来自「3D reconstruction, medical image process」· C++ 代码 · 共 104 行

CPP
104
字号
// ListCtrlEditBox.cpp : implementation file//#include "stdafx.h"#include "fusion.h"#include "ListCtrlEditBox.h"#ifdef _DEBUG#define new DEBUG_NEW#undef THIS_FILEstatic char THIS_FILE[] = __FILE__;#endif/////////////////////////////////////////////////////////////////////////////// RxListCtrlEditBoxRxListCtrlEditBox::RxListCtrlEditBox(){}RxListCtrlEditBox::~RxListCtrlEditBox(){}BEGIN_MESSAGE_MAP(RxListCtrlEditBox, CEdit)	//{{AFX_MSG_MAP(RxListCtrlEditBox)	ON_WM_CREATE()	ON_WM_KILLFOCUS()	ON_WM_CHAR()	//}}AFX_MSG_MAPEND_MESSAGE_MAP()/////////////////////////////////////////////////////////////////////////////// RxListCtrlEditBox message handlersint RxListCtrlEditBox::OnCreate(LPCREATESTRUCT lpCreateStruct) {	if (CEdit::OnCreate(lpCreateStruct) == -1)		return -1;		SetWindowText(m_strText);	SetFont(GetParent()->GetFont(), FALSE);	SetFocus();	SetSel(0, -1);		return 0;}void RxListCtrlEditBox::OnKillFocus(CWnd* pNewWnd) {	CEdit::OnKillFocus(pNewWnd);		DestroyWindow();	}void RxListCtrlEditBox::PostNcDestroy() {	CEdit::PostNcDestroy();	delete this;}void RxListCtrlEditBox::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags) {	if(nChar == VK_ESCAPE)	{		GetParent()->SetFocus();		return;	}	else if(nChar == VK_RETURN)	{		GetWindowText(m_strText);		SendMessageToParent();		return;	}		CEdit::OnChar(nChar, nRepCnt, nFlags);}/////////////////////////////////////////////////////////////////////////////void RxListCtrlEditBox::SetListCtrlInfo(int iRow, int iCol, LPCTSTR lpszText){	m_iRow = iRow;	m_iCol = iCol;	m_strText = lpszText;}void RxListCtrlEditBox::SendMessageToParent(){	NMLCEB_CTRL		nmlceb;	nmlceb.hdr.hwndFrom	= m_hWnd;	nmlceb.hdr.idFrom	= GetDlgCtrlID();	nmlceb.hdr.code		= LISTCTRL_CHANGED;	nmlceb.iRow			= m_iRow;	nmlceb.iCol			= m_iCol;	nmlceb.lpszText		= (LPCTSTR)m_strText;	CWnd* pOwner = GetOwner();	if (pOwner)		pOwner->SendMessage(WM_NOTIFY, nmlceb.hdr.idFrom, (LPARAM)&nmlceb);}

⌨️ 快捷键说明

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