//////////////////////////////////////////////////////////////////////
// InPlaceNumericEdit.h : header file
//
// MFC Grid Control - inplace editing class
//
//////////////////////////////////////////////////////////////////////

#if !defined(_INPLACENUMERICEDIT_H_)
#define _INPLACENUMERICEDIT_H_

#include "AMSEdit.h"

class CInPlaceNumericEdit : public CAMSNumericEdit
{
// Construction
public:
    CInPlaceNumericEdit(CWnd* pParent, CRect& rect, DWORD dwStyle, UINT nID,
						int nRow, int nColumn, double initValue, UINT nFirstChar, int digitPlaces, int decimalPlaces);

// Attributes
public:
 
// Operations
public:
    void EndEdit();
	void SetSeparators(TCHAR decimal, TCHAR group);

// Overrides
     // ClassWizard generated virtual function overrides
     //{{AFX_VIRTUAL(CInPlaceNumeriEdit)
	public:
	virtual BOOL PreTranslateMessage(MSG* pMsg);
	protected:
	virtual void PostNcDestroy();
	//}}AFX_VIRTUAL
 
// Implementation
public:
     virtual ~CInPlaceNumericEdit();
 
// Generated message map functions
protected:
    //{{AFX_MSG(CInPlaceNumericEdit)
    afx_msg void OnKillFocus(CWnd* pNewWnd);
    afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
    afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
	afx_msg UINT OnGetDlgCode();
	//}}AFX_MSG
    DECLARE_MESSAGE_MAP()

private:
	CString FormatValue(double value);

    int     m_nRow;
    int     m_nColumn;
    double  m_initValue;
    UINT    m_nLastChar;
    BOOL    m_bExitOnArrows;
    CRect   m_Rect;
	int m_digitPlaces;
	int m_decimalPlaces;

};
 
/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.

#endif // !defined(_INPLACENUMERICEDIT_H_)
