Click here to Skip to main content
15,893,508 members
Articles / Desktop Programming / ATL

CM_ConfigBuilder 1.2g: Visual Studio 6/Visual Studio 2005/Visual Studio 2008 Code Generator for Application Settings Graphic Management

Rate me:
Please Sign up or sign in to vote.
4.94/5 (126 votes)
12 Feb 2008CPOL17 min read 697.8K   9.8K   262  
CM_ConfigBuilder generates and compiles the required files to manage your application's settings/preferences and to store/retrieve them in XML format.
// 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.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Web Developer
Italy Italy
For all Stefano's latest code, binaries and tutorials visit www.codemachines.com

Comments and Discussions