📄 shape.h
字号:
#pragma once
//////////////////////////////////////////////////////
// CShape
// Note: this class really should be divided into a
// hierarchy with a "CShape" abstract base class and
// several derived classes "CCircle", "CSquare", etc.
//
// However, the following "everything-in-one-class"
// implementation is easier to understand and very
// straightfoward, given the limited scope of this
// sample project.
class CShape : public CObject
{
DECLARE_SERIAL( CShape )
public:
enum SHAPE { SQUARE = 0, CIRCLE = 1 };
enum { HALF_SIZE = 70 };
CShape( CPoint ptCenter, COLORREF crColor, SHAPE shape );
void Draw( CDC* pDC ) const;
void DrawAt( CDC* pDC, int x, int y ) const;
CString GetShapeName() const;
protected:
CShape(); // for serialization only
virtual void Serialize(CArchive& ar);
public:
CPoint m_ptCenter;
COLORREF m_crColor;
SHAPE m_shape;
};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -