You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
1.0 KiB
C++

#pragma once
#include "item.h"
namespace NItem
{
class CItemCurveArc;
/**
* 弧线、弓形、扇形绘制类
*/
class CItemArc :
public CItem
{
friend class CItemCurveArc;
public:
CItemArc(CSigmaDoc * ppDoc);
~CItemArc(void);
void OnLButtonDown(CDC* pDC, UINT nFlags, CPoint point, int vk) override;
int OnMouseMove(CDC* pDC, UINT nFlags, CPoint point) override;
virtual BOOL DoSelectEnd(void);
BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message) override;
BOOL OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags) override;
BOOL OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags) override;
protected:
int m_state;
BOOL m_bDoSelectEnd;
double m_dCurveWidth;
CSize8 m_size;
public:
int GetState(void);
void SetState(int state);
void Draw(CRect8 rect, CPoint2D ptStart, CPoint2D ptEnd);
CArc* CreateArc(void);
private:
CRect8 RectArc;
CPoint2D PointStart, PointMiddle, PointEnd;
int loop;
BOOL m_bDrawCtrl; //当CTRL键按下时,画另一方向
int m_nDrawType;
bool m_bFirst; //在鼠标移动事件处理函数,是否第一次画圆弧。
};
};