www.pudn.com > NoteBookVC++.rar > NEWEDIT.cpp
// NEWEDIT.cpp : implementation file
//
#include "stdafx.h"
#include "¼Çʱ¾.h"
#include "NEWEDIT.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// NEWEDIT
NEWEDIT::NEWEDIT()
{
beep.x=0;
beep.y=0;
NEWEDIT::FontColor=RGB(0,0,0);
NEWEDIT::BackColor=RGB(255,255,255);
PaintRect.left=150;
PaintRect.right=650;
PaintRect.top=100;
PaintRect.bottom=500;
ChangeFont=FALSE;
}
NEWEDIT::~NEWEDIT()
{
}
BEGIN_MESSAGE_MAP(NEWEDIT, CEdit)
//{{AFX_MSG_MAP(NEWEDIT)
ON_WM_CHAR()
ON_WM_CTLCOLOR_REFLECT()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// NEWEDIT message handlers
void NEWEDIT::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)
{
// TODO: Add your message handler code here and/or call default
Beep(beep.x,beep.y);
CEdit::OnChar(nChar, nRepCnt, nFlags);
}
HBRUSH NEWEDIT::CtlColor(CDC* pDC, UINT nCtlColor)
{
// TODO: Change any attributes of the DC here
CBrush Brush;
Brush.CreateSolidBrush(NEWEDIT::BackColor);
pDC->SetTextColor(NEWEDIT::FontColor);
pDC->SetBkColor(NEWEDIT::BackColor);
if (ChangeFont)
{
NEWEDIT::SetFont(&NewFont,TRUE);
ChangeFont=FALSE;
}
// TODO: Return a non-NULL brush if the parent's handler should not be called
return Brush;
}