checkvw.h

来自「讲mfc的书」· C头文件 代码 · 共 60 行

H
60
字号
// checkvw.h : interface of the CCheckerView class
//
/////////////////////////////////////////////////////////////////////////////

class CCheckerView : public CView
{
protected: // create from serialization only
	CCheckerView();
	DECLARE_DYNCREATE(CCheckerView)

// Attributes
public:
	CCheckerDoc* GetDocument();
	COLORREF m_background;
// Operations
public:
	void DrawCell(CDC *dc,CCheckerDoc *doc,int x,int y);

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CCheckerView)
	public:
	virtual void OnDraw(CDC* pDC);  // overridden to draw this view
	virtual void OnPrepareDC(CDC* pDC, CPrintInfo* pInfo = NULL);
	protected:
	virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
	virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
	virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
	virtual void OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint);
	//}}AFX_VIRTUAL

// Implementation
public:
	virtual ~CCheckerView();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:
    BOOL Screen2Grid(CPoint &pt);
	BOOL Grid2Screen(CPoint &pt);
	// Generated message map functions
protected:
	//{{AFX_MSG(CCheckerView)
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnStatus();
	afx_msg void OnBackground();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

#ifndef _DEBUG  // debug version in checkvw.cpp
inline CCheckerDoc* CCheckerView::GetDocument()
   { return (CCheckerDoc*)m_pDocument; }
#endif

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

⌨️ 快捷键说明

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