查看单个帖子
旧 2007-07-22, 04:27 PM   #2
yogy
高级会员
 
注册日期: 06-11
帖子: 1527
精华: 15
现金: 6353 标准币
资产: 6353 标准币
yogy 向着好的方向发展
默认 回复: Draw line sample

2.DrawLineView.h
// DrawLineView.h : interface of the CDrawLineView class
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_DRAWLINEVIEW_H__92BA1170_1137_4E72_A93C_9FBD819536CA__INCLUDED_)
#define AFX_DRAWLINEVIEW_H__92BA1170_1137_4E72_A93C_9FBD819536CA__INCLUDED_

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


class CDrawLineView : public CView
{
protected: // create from serialization only
int m_Drag;
HCURSOR m_HCursor;
CPoint m_pPrev;
CPoint m_pOrigin;

CDrawLineView();
DECLARE_DYNCREATE(CDrawLineView)

// Attributes
public:
CDrawLineDoc* GetDocument();

// Operations
public:

// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CDrawLineView)
public:
virtual void OnDraw(CDC* pDC); // overridden to draw this view
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
protected:
virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
//}}AFX_VIRTUAL

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

protected:

// Generated message map functions
protected:
//{{AFX_MSG(CDrawLineView)
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};

#ifndef _DEBUG // debug version in DrawLineView.cpp
inline CDrawLineDoc* CDrawLineView::GetDocument()
{ return (CDrawLineDoc*)m_pDocument; }
#endif

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

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

#endif // !defined(AFX_DRAWLINEVIEW_H__92BA1170_1137_4E72_A93C_9FBD819536CA__INCLUDED_)
yogy离线中   回复时引用此帖