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.
103 lines
3.2 KiB
C++
103 lines
3.2 KiB
C++
#pragma once
|
|
#include "IView.h"
|
|
//#include "SigmaView.h"
|
|
|
|
class CSigmaDoc;
|
|
class CSigmaView;
|
|
namespace NDrawView
|
|
{
|
|
|
|
enum class MouseButtons
|
|
{
|
|
Left = 0x100000,
|
|
None = 0,
|
|
Right = 0x200000,
|
|
Middle = 0x400000,
|
|
XButton1 = 0x800000,
|
|
XButton2 = 0x1000000,
|
|
};
|
|
|
|
#define ITEM_VIEW 1001 //ͼÐÎä¯ÀÀ
|
|
#define ITEM_PRINT 1002 //´òÓ¡ÉèÖÃ
|
|
|
|
class CItemBase : public CObject
|
|
{
|
|
public:
|
|
CItemBase(CSigmaDoc * ppDoc);
|
|
virtual ~CItemBase(void);
|
|
|
|
void SetType(long type);
|
|
long GetType(void);
|
|
|
|
COLORREF m_BackColor = RGB(0, 0, 0);
|
|
|
|
void SetDoc(CSigmaDoc * ppDoc);
|
|
CSigmaDoc * GetDrawDoc(void);
|
|
CSigmaView * GetDrawView(void);
|
|
CXyDC * GetDC(void) const;
|
|
CDC* GetScreenDC();
|
|
void SetScreenDC(CDC* pDC);
|
|
CDC* GetImgDC();
|
|
|
|
void DrawCrossPoint(CXyDC* pDC, double x, double y);
|
|
void DrawLineScreen(int x1, int y1, int x2, int y2);
|
|
void DrawLineReal(double x1, double y1, double x2, double y2);
|
|
|
|
CPoint2D CenterPoint(void);
|
|
dfPoint GetReal(CPoint point);
|
|
CRect GetNegativeRect(CRect* pRect);
|
|
|
|
BOOL IsCaptureState(void);
|
|
BOOL IsPopupRightMenu(void);
|
|
void EnablePopupRightMenu(BOOL bPopup);
|
|
void EnableRButtonCancel(BOOL bEnable);
|
|
|
|
void InvalidateRect(CRect8 rect);
|
|
void SetStatusBarLengthInfo(double x1, double y1, double x2, double y2, BYTE*& destBuffer, int& destLen);
|
|
|
|
virtual void OnLButtonDblClk(UINT nFlags, CPoint point);
|
|
virtual void OnLButtonDown(CDC *pDC, UINT nFlags, CPoint point, int vk);
|
|
virtual void OnLButtonUp(CDC *pDC, UINT nFlags, CPoint point, int vk);
|
|
virtual int OnMouseMove(CDC *pDC, UINT nFlags, CPoint point);
|
|
virtual void OnMouseMoveStatus(CDC *pDC, UINT nFlags, CPoint point, BYTE*& destBuffer, int& destLen);
|
|
virtual void OnRButtonDblClk(UINT nFlags, CPoint point);
|
|
virtual void OnRButtonDown(UINT nFlags, CPoint point);
|
|
virtual BOOL OnRButtonUp(UINT nFlags, CPoint point);
|
|
virtual void OnMouseWheel(uint32_t button, int32_t clicks, int32_t x, int32_t y, int32_t delta);
|
|
virtual BOOL OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
|
|
virtual BOOL OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags);
|
|
virtual BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
|
|
virtual void OnDraw(CXyDC* pDC);
|
|
virtual void OnDraw(CXyDC* pXyDC, CDC* pDC);
|
|
//º¯Êý¹¦ÄÜ:»æÖƸ¨Í¼ÐÎ ÀýÈç»æÖÆÖ±Ïß¶Îʱ ÒÑ»æÖƳöµÄÖ±Ïß¶Î ¾ÍÊǸ¨ÖúͼÐΡ£
|
|
//×¢:ÒòΪˢÐÂȫͼʱ »á½«¸¨ÖúͼÐβÁµô ËùÒÔÒªÖØÐ»æÖƳöÀ´
|
|
virtual void DrawAssistant(CDC * pDC, int mouseX, int mouseY);
|
|
virtual int GetSubMenu();
|
|
|
|
virtual void OnOK(void);
|
|
virtual void OnCancel(void);
|
|
|
|
void SetHDC(HDC hdc);
|
|
////ÊôÐÔÏî
|
|
//virtual BOOL InitPropertyGrid(CXTPPropertyGrid& grid);
|
|
//virtual BOOL OnGridItemChangeValue(CXTPPropertyGridItem* pItem);
|
|
//virtual void OnInplaceButtonDown(CXTPPropertyGridItem* pItem);
|
|
|
|
static CString GetFloatFormatString(BOOL bIsE=FALSE);
|
|
CString info;
|
|
|
|
protected:
|
|
//IView * m_pView = nullptr;
|
|
CSigmaDoc * m_pDoc = nullptr;
|
|
long m_type = 0; //µ±ÎªÔö¼Ó״̬ʱ,²ÅÆð×÷ÓÃ
|
|
BOOL m_bPopupRightMenu = FALSE; //ΪÁ˽ûֹһЩÇé¿öϵ¯³öÓÒ¼ü²Ëµ¥
|
|
BOOL m_bEnableRButtonCancel = FALSE; //µ±Êó±ê°´ÏÂʱÊÇ·ñÈ¡Ïûµ±Ç°µÄ²åÈë״̬
|
|
CPoint2D m_point;
|
|
HDC m_hdc;
|
|
CDC* m_pScreenDC = nullptr;
|
|
};
|
|
|
|
}//namespace
|
|
|
|
using namespace NDrawView;
|