The class CHertzEdit is derived from CEdit. It contains three member variables. The variable bNegativAllowed
is a status flag that signals that the control allows negative values or not. It can only be set during the construction. The variable m_dValue
saves the value of the control as number while the variable m_strValue
contains the value as formatted string including the unit.
CHertzEdit::CHertzEdit()
{
m_dValue=0.0;
m_bNegativAllowed=TRUE;
m_strValue= _T("");
}
CHertzEdit::CHertzEdit(BOOL bNegativAllowed)
{
m_bNegativAllowed=bNegativAllowed;
m_dValue=0.0;
m_strValue= _T("");
}
CHertzEdit::CHertzEdit(const CHertzEdit& he)
{
m_bNegativAllowed=he.m_bNegativAllowed;
m_dValue=he.m_dValue;
m_strValue=he.m_strValue;
}
CHertzEdit::~CHertzEdit()
{
}
BEGIN_MESSAGE_MAP(CHertzEdit, CEdit)
//{{AFX_MSG_MAP(CHertzEdit)
ON_WM_CHAR()
ON_WM_KILLFOCUS()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()