|
// AsNumericEdit.h : header file
//
#if !defined(_ASNUMERICEDIT_H_)
#define _ASNUMERICEDIT_H_
/////////////////////////////////////////////////////////////////////////////
// CAsNumericEdit window
class CAsNumericEdit : public CEdit
{
// Construction
public:
CAsNumericEdit();
// Attributes
public:
void SetMinValue(double minValue);
double GetMinValue() const;
void SetMaxValue(double maxValue);
double GetMaxValue() const;
void SetPrecision(int precision);
int GetPrecision() const;
void SetMinMaxCheckEnable(bool enable);
bool GetMinMaxCheckEnable() const;
void SetDecimalSeparator(char decimalSeparator);
char GetDecimalSeparator() const;
void SetValue(double value);
double GetValue();
double Validate();
CString FormatValue(double value);
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CAsNumericEdit)
public:
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CAsNumericEdit();
// Generated message map functions
protected:
//{{AFX_MSG(CAsNumericEdit)
afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
afx_msg void OnKillfocus();
//}}AFX_MSG
DECLARE_MESSAGE_MAP();
double ValidateString(const CString& valueStr);
double ValidateValue(double value);
int precision_;
double minValue_;
double maxValue_;
bool minMaxCheckEnable_;
char decimalSeparator_;
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(_ASNUMERICEDIT_H_)
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
For all Stefano's latest code, binaries and tutorials visit www.codemachines.com