⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 minieditview.h

📁 c++从入门到精通
💻 H
字号:
// miniEditView.h : interface of the CMiniEditView class
//
/////////////////////////////////////////////////////////////////////////////

#if !defined(AFX_MINIEDITVIEW_H__F5904105_036C_4665_8E16_104A6EF24FEA__INCLUDED_)
#define AFX_MINIEDITVIEW_H__F5904105_036C_4665_8E16_104A6EF24FEA__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000


class CMiniEditView : public CView
{
protected: // create from serialization only
	CMiniEditView();
	DECLARE_DYNCREATE(CMiniEditView)
	
// Attributes
public:
	CMiniEditDoc* GetDocument();

// Operations
public:

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CMiniEditView)
	public:
	virtual void OnDraw(CDC* pDC);  // overridden to draw this view
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	protected:
	//}}AFX_VIRTUAL

// Implementation
public:
	void PositionCaret(CDC*pDC);
	virtual ~CMiniEditView();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:
		
	int iLCount; //纪录文本总行数
	int m_nTextPos; //记录当前光标的位置x轴方向。以一个字符宽度为单位
	CPoint p; //当单击鼠标左键时记录当前坐标
	CString m_strText;//存放光标所在当前行的字符串
	int m_nCellHeight; //字符高度,单位是象素
	int m_nCellWidth; //字符宽度单位是象素
	int nPosy; //光标的当前行
	CRect rectClient; //客户区矩形
	POSITION pos; //位置变量
// Generated message map functions
protected:
	//{{AFX_MSG(CMiniEditView)
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
	afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
	afx_msg void OnSetFocus(CWnd* pOldWnd);
	afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
	afx_msg void OnFileNew();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

#ifndef _DEBUG  // debug version in miniEditView.cpp
inline CMiniEditDoc* CMiniEditView::GetDocument()
   { return (CMiniEditDoc*)m_pDocument; }
#endif

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_MINIEDITVIEW_H__F5904105_036C_4665_8E16_104A6EF24FEA__INCLUDED_)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -