www.pudn.com > mischat.rar > mischatView.h
// mischatView.h : interface of the CmischatView class
//
#pragma once
class CDraw;
class CCurve;
class CmischatDoc;
class CmischatView : public CView
{
friend class CPropertiesViewBar;
protected: // create from serialization only
CmischatView();
DECLARE_DYNCREATE(CmischatView)
// Attributes
public:
CmischatDoc* GetDocument() const;
// Overrides
public:
virtual void OnDraw(CDC* pDC); // overridden to draw this view
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
virtual BOOL PreTranslateMessage(MSG* pMsg);
// Implementation
public:
virtual ~CmischatView();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
private:
CImage imgOriginal;
int m_nViewWidth; // Workspace width in pixels
int m_nViewHeight; // Workspace height in pixels
int m_nHScrollPos; // Horizontal scroll position
int m_nVScrollPos; // Vertical scroll position
int m_nHPageSize; // Horizontal page size
int m_nVPageSize; // Vertical page size
CRectTracker m_tracker;
bool isSelected;//当前绘图对象是否处于选中状态
bool isGroupSelected;//当前绘图对象是否处于多选状态
CRect m_rect,m_rect2;//记录绘图对象移动前后的位置
CPoint topLeft;
CPoint rightBottom;
bool beginTrack;
CCurve* pCurve;
CDraw* pDraw;
CDraw* pDrawSelect;//当前处于选中状态的绘图对象
POSITION pSelect;//当前处于选中状态的绘图对象的POSITION
CList psList;
CRect editRect;
CEdit m_wndEdit;
private:
void InitScroll(int cx, int cy);
void drawListContent(CDC* pdc);
void AddToTail(CDraw * pdw);
void MoveDraw(CDC* pdc);
void DrawGroupSelect(CDC* pdc);
void MoveGroupDraw(CDC* pdc);
CRect GetGroupSelectOutSide(CDC* pdc);
public:
void Load(LPCTSTR fileName);
void clearAll();
void Draw(CDraw* pdw);
void SaveCurDraw(CBCGPProp*pProp);
// Generated message map functions
protected:
//afx_msg void OnFilePrintPreview();
DECLARE_MESSAGE_MAP()
afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
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 int OnCreate(LPCREATESTRUCT lpCreateStruct);
};
#ifndef _DEBUG // debug version in mischatView.cpp
inline CmischatDoc* CmischatView::GetDocument() const
{ return reinterpret_cast(m_pDocument); }
#endif