Files
envi-code/SourceCode/Code2026/Dimension/RealEdit.h
T

61 lines
1.2 KiB
C++
Raw Normal View History

2026-10-04 00:04:20 +08:00
#if !defined(__REALEDIT_H__)
2026-09-28 15:28:50 +08:00
#define __REALEDIT_H__
// Description:
2026-10-04 00:04:20 +08:00
// 可控制数据输入类型的编辑框,可以限定为只许整型、浮点型输入等
2026-09-28 15:28:50 +08:00
// Company: Kingtouch Software Corporation. Copyright 2002-2005
// Author: WangYongguang
// Date: 2002.05.01
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class CRealEdit : public CEdit
{
DECLARE_DYNCREATE(CRealEdit)
public:
CRealEdit();
virtual ~CRealEdit();
enum EDataType
{
2026-10-04 00:04:20 +08:00
eString = 0, // 字符串
eInteger = 1, // 整型
ePosInt = 2, // 正整型
eNegInt = 3, // 负整型
eReal = 4, // 实型
ePosReal = 5, // 正实型
eNegReal = 6, // 负实型
2026-09-28 15:28:50 +08:00
};
//{{AFX_VIRTUAL(CRealEdit)
//}}AFX_VIRTUAL
protected:
//{{AFX_MSG(CRealEdit)
afx_msg BOOL OnChange();
afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
public:
2026-10-04 00:04:20 +08:00
// 设置数据类型
2026-09-28 15:28:50 +08:00
void SetDataType(CRealEdit::EDataType eType);
2026-10-04 00:04:20 +08:00
// 取得数据类型
2026-09-28 15:28:50 +08:00
CRealEdit::EDataType GetDataType();
protected:
void DoInteger(CString& sText, int& iStart, int& iEnd);
void DoReal(CString& sText, int& iStart, int& iEnd);
2026-10-04 00:04:20 +08:00
// 数据类型
2026-09-28 15:28:50 +08:00
CRealEdit::EDataType m_eType;
BOOL m_bInEdit;
};
//{{AFX_INSERT_LOCATION}}
#endif // !defined(__KTEDIT_H__)