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

📄 floatedit2.cpp

📁 股票助手的源代码
💻 CPP
字号:
// FloatEdit2.cpp : implementation file
//

#include "stdafx.h"
#include "Accobook_CE.h"
#include "FloatEdit2.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CFloatEdit2

CFloatEdit2::CFloatEdit2()
{
}

CFloatEdit2::~CFloatEdit2()
{
}


BEGIN_MESSAGE_MAP(CFloatEdit2, CEdit)
	//{{AFX_MSG_MAP(CFloatEdit2)
	ON_WM_CHAR()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CFloatEdit2 message handlers

void CFloatEdit2::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags) 
{
	// TODO: Add your message handler code here and/or call default
static CString separators(_T("."));
//static CString separators(_T("。"));
TCHAR tChar=(TCHAR)nChar;
if((IsCharAlphaNumeric(tChar)&&!IsCharAlpha(tChar))
   ||separators.Find(nChar)!=-1
   ||tChar==8||nChar==12290||nChar==0xa1||nChar==0xe3||nChar==0x00b0)
	{
	CEdit::OnChar(nChar, nRepCnt, nFlags);
	}
else
	MessageBeep(MB_ICONASTERISK);
	
}

CFloatEdit2::operator float()
{
double dReturn;
CString number;
LPTSTR endpointer;
GetWindowText(number);
#ifdef _UNICODE
	dReturn=wcstod((LPCTSTR)number,&endpointer);
#else
	dReturn=strtod((LPCTSTR)number,&endpointer);
#endif
	return (float)dReturn;
}

float CFloatEdit2::operator =(float f)
{
return f;
}

⌨️ 快捷键说明

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