autoteachedit.cpp

来自「机械手IPC控制器伺服运动程序」· C++ 代码 · 共 58 行

CPP
58
字号
// AutoTeachEdit.cpp : implementation file
//

#include "stdafx.h"
#include "alfa.h"
#include "AutoTeachEdit.h"
#include "AutoTeach.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CAutoTeachEdit

CAutoTeachEdit::CAutoTeachEdit()
{
	m_clrBack=RGB(255,255,0); // yellow background 
    m_brush.CreateSolidBrush(m_clrBack);
}

CAutoTeachEdit::~CAutoTeachEdit()
{
}


BEGIN_MESSAGE_MAP(CAutoTeachEdit, CEdit)
	//{{AFX_MSG_MAP(CAutoTeachEdit)
	ON_WM_CTLCOLOR_REFLECT()
	ON_WM_LBUTTONDOWN()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CAutoTeachEdit message handlers

HBRUSH CAutoTeachEdit::CtlColor(CDC* pDC, UINT nCtlColor) 
{
	// TODO: Change any attributes of the DC here
	pDC->SetBkColor(m_clrBack);
	return (HBRUSH)m_brush.GetSafeHandle() ;
	// TODO: Return a non-NULL brush if the parent's handler should not be called
}

void CAutoTeachEdit::OnLButtonDown(UINT nFlags, CPoint point) 
{
	// TODO: Add your message handler code here and/or call default
	CEdit::OnLButtonDown(nFlags, point);
	if(GetStyle() & ES_READONLY) return;
	CString str;
	GetWindowText(str);
	CAutoTeach * parent=(CAutoTeach *)(GetParent()->GetParent());
	parent->dlgautoteachkey->num=str;
	parent->dlgautoteachkey->edt=this;
	parent->dlgautoteachkey->ShowWindow(TRUE);
}

⌨️ 快捷键说明

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