登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

面包会有的

... ...

 
 
 

日志

 
 

VC绘图练习(3):编写简单的响应代码  

2008-04-19 23:49:16|  分类: VC++ |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

当用户选择菜单“绘图”-“点”,此时,应将用户的选择保存下来,然后根据选择的菜单进行绘图,这里,为了保存用户选择,需要有一个变量,因此,现在增加一个成员变量。

m_nDrawType

CGraphicView下的子项,多了一个m_nDrawType
双击m_nDrawType,查看其代码,如下:

// GraphicView.h : interface of the CGraphicView class
//
/////////////////////////////////////////////////////////////////////////////

#if !defined(AFX_GRAPHICVIEW_H__504EE2A5_DDFD_49B3_8C96_70E7097FE6B5__INCLUDED_)
#define AFX_GRAPHICVIEW_H__504EE2A5_DDFD_49B3_8C96_70E7097FE6B5__INCLUDED_

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


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

// Attributes
public:
 CGraphicDoc* GetDocument();

// Operations
public:

// Overrides
 // ClassWizard generated virtual function overrides
 //{{AFX_VIRTUAL(CGraphicView)
 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 ~CGraphicView();
#ifdef _DEBUG
 virtual void AssertValid() const;
 virtual void Dump(CDumpContext& dc) const;
#endif

protected:

// Generated message map functions
protected:
 //{{AFX_MSG(CGraphicView)
  // NOTE - the ClassWizard will add and remove member functions here.
  //    DO NOT EDIT what you see in these blocks of generated code !
 //}}AFX_MSG
 DECLARE_MESSAGE_MAP()
private:
 UNIT m_nDrawType;
};

#ifndef _DEBUG  // debug version in GraphicView.cpp
inline CGraphicDoc* CGraphicView::GetDocument()
   { return (CGraphicDoc*)m_pDocument; }
#endif

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

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

#endif // !defined(AFX_GRAPHICVIEW_H__504EE2A5_DDFD_49B3_8C96_70E7097FE6B5__INCLUDED_)

 

 

 

  评论这张
 
阅读(782)| 评论(0)

历史上的今天

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2018