etrade_edit_control.h 1.31 KB
#ifndef __my_edit_control_h__
#define __my_edit_control_h__

class CEditBox : public CEdit
{
	DECLARE_DYNAMIC( CEditBox )

public:
	CEditBox();
	~CEditBox();

private:
	COLORREF	m_clrBackground;
	COLORREF	m_clrFrame;
	COLORREF	m_clrText;
	COLORREF	m_clrDisabledBackground;
	COLORREF	m_clrDisabledBack;
	COLORREF	m_clrDisabledText;

	CBrush		m_brushBk;

public:
	void SetBackgroundColor( COLORREF clr ) { m_clrBackground = clr; }
	void SetFrameColor( COLORREF clr ) { m_clrFrame = clr; }
	void SetTextColor( COLORREF clr ) { m_clrText = clr; }
	void SetDisabledColor( COLORREF clrBack, COLORREF clrText ) {
		m_clrDisabledBack = clrBack;
		m_clrDisabledText = clrText;
	}
	
	COLORREF GetBackgroundColor() const { return m_clrBackground; }
	COLORREF GetFrameColor() const { return m_clrFrame; }
	COLORREF GetTextColor() const { return m_clrText; }
	COLORREF GetDisabledColor( COLORREF& clrBack, COLORREF& clrText ) const {
		clrBack = m_clrDisabledBack;
		clrText = m_clrDisabledText;
	}

protected:
	afx_msg HBRUSH	CtlColor( CDC *pDC, UINT nCtlColor );
	afx_msg void	OnNcPaint();

	DECLARE_MESSAGE_MAP()
public:
	afx_msg void OnKillFocus(CWnd* pNewWnd);

private:
	bool CheckCardNum(CString &num);
	bool GetCardName(CString &num, CString &name);

public:
	void SetEditRed(bool is_red);

	bool is_edit_red_;
};

#endif // __my_edit_control_h__