?? floatedit2.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 + -