EditWnd.h
资源名称:超酷的Edit窗体.rar [点击查看]
上传用户:gtl066
上传日期:2007-06-15
资源大小:33k
文件大小:3k
源码类别:
Delphi控件源码
开发平台:
Visual C++
- #if !defined(AFX_EDITWND_H__46012F8D_540A_43AF_9FF1_C1C8F27F2627__INCLUDED_)
- #define AFX_EDITWND_H__46012F8D_540A_43AF_9FF1_C1C8F27F2627__INCLUDED_
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
- // EditWnd.h : header file
- //
- /////////////////////////////////////////////////////////////////////////////
- // CEditWnd window
- class CEditWnd : public CWnd
- {
- // Construction
- public:
- CEditWnd();
- DECLARE_DYNCREATE( CEditWnd )
- // Attributes
- public:
- // Operations
- public:
- void GetString(CString &strWnd);
- // Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CEditWnd)
- public:
- virtual BOOL PreTranslateMessage(MSG* pMsg);
- protected:
- virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
- //}}AFX_VIRTUAL
- // Implementation
- public:
- virtual ~CEditWnd();
- // Generated message map functions
- protected:
- //{{AFX_MSG(CEditWnd)
- afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
- afx_msg void OnPaint();
- afx_msg void OnSetFocus(CWnd* pOldWnd);
- afx_msg void OnKillFocus(CWnd* pNewWnd);
- afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
- afx_msg UINT OnGetDlgCode();
- afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
- afx_msg void OnSize(UINT nType, int cx, int cy);
- afx_msg void OnContextMenu(CWnd* pWnd, CPoint point);
- afx_msg void OnMouseMove(UINT nFlags, CPoint point);
- afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
- private:
- private:
- int PosFromChar(UINT nChar); // 通过指定的字符获得其x轴的位置
- int CharFromPos(int nPosX); // 通过给定的x轴的位置获得相应的字符
- void CutString(); // 剪切字符串
- void PasteString(); // 粘贴字符串
- void CopyString(); // 拷贝字符串
- void MakeBKGround(CDC *pDC, COLORREF clrBegin, COLORREF clrEnd, CRect rect); // 生成窗口背景
- CString m_strEdit; // 当前包含的文本。
- CString m_strSelect; // 当前选择的文本。
- CPoint m_ptCursor; // 当前光标的位置。
- CPoint m_ptTxtBegin; // 文本的起始位置。
- CPoint m_ptFirst; // 鼠标左键按下时的第一点位置。
- CPoint m_ptSecond; // 鼠标当前的位置。
- int m_nCharPos; // 当前光标处于第几个字符的后面,从0开始计数。
- int m_nShowChar; // 在编辑框中第一个显示的字符,从0开始计数。
- int m_nMaxShowChars; // 在编辑框中一次最多显示的字符数量 。
- int m_nSelectBegin; // 选择的字符的起始位置。
- int m_nSelectEnd; // 选择的字符的终止位置。
- CBitmap m_BmpBK; // 背景图片。
- CFont m_TxtFont; // 文本的字体。
- TEXTMETRIC m_tm; // 文本字体的信息。
- CRect m_rcWnd; // 窗口的大小。
- bool m_bLBtDown; // 鼠标左键按下。
- int m_nShiftBegin; // shift键第一次时光标所在的字符的位置。
- };
- /////////////////////////////////////////////////////////////////////////////
- //{{AFX_INSERT_LOCATION}}
- // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
- #endif // !defined(AFX_EDITWND_H__46012F8D_540A_43AF_9FF1_C1C8F27F2627__INCLUDED_)
English
