|
// maskedit.cpp : implementation file
//
#include "stdafx.h"
#include "maskedit.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CMaskEdit
CMaskEdit::CMaskEdit(LPCTSTR szMask, BOOL bExclude) : m_sMask(szMask), m_bExclude(bExclude)
{
}
CMaskEdit::~CMaskEdit()
{
}
BEGIN_MESSAGE_MAP(CMaskEdit, CEdit)
//{{AFX_MSG_MAP(CMaskEdit)
ON_WM_CHAR()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CMaskEdit message handlers
void CMaskEdit::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)
{
switch (nChar)
{
case VK_BACK:
break;
case 'c':
case 'C':
case 'v':
case 'V':
case 'x':
case 'X':
if (GetAsyncKeyState(VK_CONTROL) & 0x8000)
break;
default:
{
if (m_bExclude && m_sMask.Find(nChar) != -1)
return;
else if (!m_bExclude && m_sMask.Find(nChar) == -1)
return;
}
break;
}
CEdit::OnChar(nChar, nRepCnt, nFlags);
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
.dan.g. is a naturalised Australian and has been developing commercial windows software since 1998.