NiceEdit.h
上传用户:szhuagan
上传日期:2021-05-27
资源大小:2676k
文件大小:2k
- // This file was created on March 21st 2001. By Robert Brault
- //
- //
- #if !defined(AFX_ColorEdit_H__E889B47D_AF6B_4066_B055_967508314A88__INCLUDED_)
- #define AFX_ColorEdit_H__E889B47D_AF6B_4066_B055_967508314A88__INCLUDED_
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
- // ColorEdit.h : header file
- //
- #include "Color.h" // File Holding (#define)'s for COLORREF Values
- #include "atltypes.h"
- #include "afxwin.h"
- /////////////////////////////////////////////////////////////////////////////
- // CNiceEdit window
- class CNiceEdit : public CEdit
- {
- // Construction
- public:
- CNiceEdit();
- // Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CNiceEdit)
- //}}AFX_VIRTUAL
- void SetBkColor(COLORREF crColor); // This Function is to set the BackGround Color for the Text and the Edit Box.
- void SetTextColor(COLORREF crColor); // This Function is to set the Color for the Text.
- BOOL SetReadOnly(BOOL flag = TRUE);
- virtual ~CNiceEdit();
- // Generated message map functions
- protected:
- //{{AFX_MSG(CNiceEdit)
- afx_msg HBRUSH CtlColor(CDC* pDC, UINT nCtlColor); // This Function Gets Called Every Time Your Window Gets Redrawn.
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
- protected:
- CBrush m_brBkgnd; // Holds Brush Color for the Edit Box
- COLORREF m_crBkColor; // Holds the Background Color for the Text
- COLORREF m_crTextColor; // Holds the Color for the Text;
- BOOL m_bHasEntered;
- // 边框颜色
- COLORREF m_crBorderColor;
- // 整个编辑框矩形域,包括滚动条
- CRect m_rcEntire;
- public:
- afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
- afx_msg void OnKillFocus(CWnd* pNewWnd);
- afx_msg void OnSetFocus(CWnd* pOldWnd);
- // 设置变宽颜色
- void SetBorderColor(COLORREF newValue);
- protected:
- // 初始边框颜色
- COLORREF m_crInitBorderColor;
- };
- /////////////////////////////////////////////////////////////////////////////
- //{{AFX_INSERT_LOCATION}}
- // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
- #endif // !defined(AFX_ColorEdit_H__E889B47D_AF6B_4066_B055_967508314A88__INCLUDED_)