📄 formitemnumber.h
字号:
// FormItemNumber.h: interface for the CFormItemNumber class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_FORMITEMNUMBER_H__449CC45B_D140_4B9A_8AEC_473F1EB74319__INCLUDED_)
#define AFX_FORMITEMNUMBER_H__449CC45B_D140_4B9A_8AEC_473F1EB74319__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "FormItem.h"
#include "NumPadDlg.h"
class CFormItemNumber : public CFormItem
{
public:
CFormItemNumber();
virtual ~CFormItemNumber();
/// Initializes the form item.
void Init(LPCTSTR pszCaption, ENumberFormat format, DWORD dwFlags = FIF_NORMAL)
{
CFormItem::Init(pszCaption, dwFlags);
SetFormat(format);
}
void Set(double dblVal) { m_dblVal = dblVal; }
void Get(double& dblVal) { dblVal = m_dblVal; }
void Get(int& nVal) { nVal = (int)m_dblVal; }
/// Returns the underlying value as an int.
int GetInt() {return (int)m_dblVal;}
/// Returns the underlying value as a double.
double GetDouble() {return m_dblVal;}
void SetFormat(ENumberFormat format) {m_format = format;}
/// Render the data as a string.
virtual LPCTSTR RenderData(LV_DISPINFO *pDispInfo);
/// Shows or hides the editor window.
virtual BOOL ShowEditor(CFormListCtrl* pForm, BOOL bShow, int iItem, int iSubItem);
protected:
double m_dblVal;
TCHAR m_szBuf[65],
m_szDec[8],
m_szSep[8];
ENumberFormat m_format;
int m_nDec,
m_nSep;
};
#endif // !defined(AFX_FORMITEMNUMBER_H__449CC45B_D140_4B9A_8AEC_473F1EB74319__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -