📄 mydrawview.h
字号:
// MyDrawView.h : interface of the CMyDrawView class
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_MYDRAWVIEW_H__971B815D_A3A7_4630_A121_9E10E6D45DCC__INCLUDED_)
#define AFX_MYDRAWVIEW_H__971B815D_A3A7_4630_A121_9E10E6D45DCC__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "Line.h"
#include "LineProperties.h"
#include "Ellipse.h"
#include "Rectangle.h"
#include "Arc.h"
#include "Text.h"
class CMyDrawView : public CView
{
protected: // create from serialization only
CMyDrawView();
DECLARE_DYNCREATE(CMyDrawView)
// Attributes
public:
CMyDrawDoc* GetDocument();
CPtrList m_ObjectList; // 绘图对象的链表
CRectTracker m_tracker;
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CMyDrawView)
public:
virtual void OnDraw(CDC* pDC); // overridden to draw this view
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
protected:
//}}AFX_VIRTUAL
// Implementation
public:
void DrawLine(CDC* pDC,CLine* pLine);
void DrawArc(CDC* pDC,CArc* pArc);
void DrawEllipse(CDC *pDC, CEllipse *pEllipse);
void DrawRectangle(CDC *pDC, CRectangle *pRectangle);
void DrawMyText(CDC *pDC, CText *pText);
void ClearSelection();
virtual ~CMyDrawView();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
// Generated message map functions
protected:
//{{AFX_MSG(CMyDrawView)
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
afx_msg void OnButtonLine();
afx_msg void OnButtonEllipse();
afx_msg void OnButtonRectangle();
afx_msg void OnButtonArc();
afx_msg void OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags);
afx_msg void OnButtonText();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
#ifndef _DEBUG // debug version in MyDrawView.cpp
inline CMyDrawDoc* CMyDrawView::GetDocument()
{ return (CMyDrawDoc*)m_pDocument; }
#endif
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_MYDRAWVIEW_H__971B815D_A3A7_4630_A121_9E10E6D45DCC__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -