📄 graphview.h
字号:
// GraphView.h : interface of the CGraphView class
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_GRAPHVIEW_H__8AB1988A_8D0E_461A_AB2C_D18D950D4528__INCLUDED_)
#define AFX_GRAPHVIEW_H__8AB1988A_8D0E_461A_AB2C_D18D950D4528__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "Line.h"
#include "Element.h"
#include "Circle.h"
#include "Line.h"
#include "Ellipse.h"
#include "RGBDialog.h"
#include "Triangle.h"
#include "Translate.h"
#include "Scale.h"
#include "Rotate.h"
#include "RGBFill.h"
class CGraphView : public CView
{
protected: // create from serialization only
CGraphView();
DECLARE_DYNCREATE(CGraphView)
// Attributes
public:
CGraphDoc* GetDocument();
Element *m_ept;
Element *m_ep[50];//图元指针数组,用来记录每个图元的地址
bool m_bBegin;//确认绘图开始
int count;//用来指示当前的图元在数组中存放的下标
enum DType{dtLine,dtCircle,dtEllipse,dtNone,dtTriangle}m_type;
COLORREF m_color;//为图元本身的前颜色
bool Fill,SetColor;//Fill是用来确认填充
int iR,iG,iB,tx,ty;//RGB的三个分量
CPoint innerPoint;//为填充图元的一个内部点
//int iPeak;//指示三角形的顶点,0,1,2
enum Transform{tfTranslate,tfScale,tfRotate,tfNone}m_transform;
float sx,sy,a;CPoint refpt;
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CGraphView)
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 ~CGraphView();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
// Generated message map functions
protected:
//{{AFX_MSG(CGraphView)
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 void OnLine();
afx_msg void OnFillColour();
afx_msg void OnCircle();
afx_msg void OnEllipse();
afx_msg void OnAColour();
afx_msg void OnTriangle();
afx_msg void OnTranslate();
afx_msg void OnScale();
afx_msg void OnRotate();
afx_msg void OnButton32788Ellipse();
afx_msg void OnButton32789Circle();
afx_msg void OnButton32791Triangle();
afx_msg void OnButton32792Line();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
#ifndef _DEBUG // debug version in GraphView.cpp
inline CGraphDoc* CGraphView::GetDocument()
{ return (CGraphDoc*)m_pDocument; }
#endif
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_GRAPHVIEW_H__8AB1988A_8D0E_461A_AB2C_D18D950D4528__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -