projView.h
上传用户:ywlong9188
上传日期:2022-05-31
资源大小:2656k
文件大小:7k
- // ProjView.h : interface of the CProjView class
- //
- /////////////////////////////////////////////////////////////////////////////
- #define HINT_UPDATE_WINDOW 0
- #define HINT_UPDATE_DRAWOBJ 1
- #define HINT_UPDATE_SELECTION 2
- #define HINT_DELETE_SELECTION 3
- //#define HINT_UPDATE_OLE_ITEMS 4
- class CDrawObj;
- class CProjView : public CScrollView
- {
- protected: // create from serialization only
- CProjView();
- DECLARE_DYNCREATE(CProjView)
- private:
- void LoopSearch(CDrawObjList& list,int nTemp);
- // Attributes
- public:
- // enum{ IDD=IDD_FORM_VIEW};
- public:
- CProjDoc* GetDocument();
- void SetPageSize(CSize size);
- CRect GetInitialPosition();
- CDrawObjList* m_pActive;
- CRectTracker m_tracker;
- BOOL m_bCursor;
- CPoint m_prePoint;
- // Operations
- public:
- void DocToClient(CRect& rect);
- void DocToClient(CPoint& point);
- void ClientToDoc(CPoint& point);
- void ClientToDoc(CRect& rect);
- void Select(CDrawObj* pObj, BOOL bAdd = FALSE);
- void SelectWithinRect(CRect rect, BOOL bAdd = FALSE);
- void Deselect(CDrawObj* pObj);
- void CloneSelection();
- void InvalObj(CDrawObj* pObj);
- void Remove(CDrawObj* pObj);
- void PasteNative(COleDataObject& dataObject);
- void PasteEmbedded(COleDataObject& dataObject, CPoint point );
- // Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CProjView)
- public:
- virtual void OnDraw(CDC* pDC); // overridden to draw this view
- virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
- virtual void OnPrepareDC(CDC* pDC, CPrintInfo* pInfo = NULL);
- virtual BOOL DestroyWindow();
- protected:
- virtual void OnInitialUpdate(); // called first time after construct
- virtual void OnActivateView(BOOL bActivate, CView* pActivateView, CView* pDeactiveView);
- //}}AFX_VIRTUAL
- // Implementation
- protected:
-
- // added for drop-target functionality
- //COleDropTarget m_dropTarget; // for drop target functionality
- CPoint m_dragPoint; // current position
- CSize m_dragSize; // size of dragged object
- CSize m_dragOffset; // offset between pt and drag object corner
- DROPEFFECT m_prevDropEffect;
- BOOL m_bDragDataAcceptable;
- BOOL GetObjectInfo(COleDataObject* pDataObject,
- CSize* pSize, CSize* pOffset);
- // end of drop-target additions
-
- public:
- virtual ~CProjView();
- #ifdef _DEBUG
- virtual void AssertValid() const;
- virtual void Dump(CDumpContext& dc) const;
- #endif
-
- virtual void OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint);
-
- void DrawGrid(CDC* pDC);
- CDrawObjList m_selection;
- CDrawObjList m_backup;
- BOOL m_bGrid;
- COLORREF m_gridColor;
- BOOL m_bActive; // is the view active?
- int nTemp;
- BOOL m_bRun;
- public:
- virtual BOOL IsSelected(const CObject* pDocItem) const;
- // Generated message map functions
- protected:
- protected:
- // Generated message map functions
- protected:
- //{{AFX_MSG(CProjView)
- afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
- afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
- afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
- afx_msg void OnMouseMove(UINT nFlags, CPoint point);
- afx_msg void OnContextMenu(CWnd* pWnd, CPoint point);
- afx_msg void OnViewGrid();
- afx_msg void OnCancelEdit();
- afx_msg void OnUpdateViewGrid(CCmdUI* pCmdUI);
- afx_msg void OnObjectMovetofront();
- afx_msg void OnUpdateObjectMovetofront(CCmdUI* pCmdUI);
- afx_msg void OnObjectMovetoback();
- afx_msg void OnUpdateObjectMovetoback(CCmdUI* pCmdUI);
- afx_msg void OnObjectMoveforward();
- afx_msg void OnUpdateObjectMoveforward(CCmdUI* pCmdUI);
- afx_msg void OnObjectLinecolor();
- afx_msg void OnUpdateObjectLinecolor(CCmdUI* pCmdUI);
- afx_msg void OnObjectFillColor();
- afx_msg void OnUpdateObjectFillColor(CCmdUI* pCmdUI);
- afx_msg void OnEditSelectAll();
- afx_msg void OnEditClear();
- afx_msg void OnUpdateAnySelect(CCmdUI* pCmdUI);
- afx_msg void OnUpdateEditSelectAll(CCmdUI* pCmdUI);
- afx_msg void OnEditProperties();
- afx_msg void OnUpdateEditProperties(CCmdUI* pCmdUI);
- afx_msg void OnEditPaste();
- afx_msg void OnUpdateEditPaste(CCmdUI* pCmdUI);
- afx_msg void OnEditCut();
- afx_msg void OnUpdateEditCut(CCmdUI* pCmdUI);
- afx_msg void OnEditCopy();
- afx_msg void OnUpdateEditCopy(CCmdUI* pCmdUI);
- afx_msg void OnDrawSelection();
- afx_msg void OnUpdateDrawSelection(CCmdUI* pCmdUI);
- afx_msg void OnDrawRect();
- afx_msg void OnUpdateDrawRect(CCmdUI* pCmdUI);
- afx_msg void OnDrawPolygon();
- afx_msg void OnUpdateDrawPolygon(CCmdUI* pCmdUI);
- afx_msg void OnDrawLine();
- afx_msg void OnUpdateDrawLine(CCmdUI* pCmdUI);
- afx_msg void OnDrawEllipse();
- afx_msg void OnUpdateDrawEllipse(CCmdUI* pCmdUI);
- afx_msg void OnObjectMoveback();
- afx_msg void OnUpdateObjectMoveback(CCmdUI* pCmdUI);
- afx_msg BOOL OnEraseBkgnd(CDC* pDC);
- afx_msg void OnSize(UINT nType, int cx, int cy);
- afx_msg void OnDrawText();
- afx_msg void OnUpdateDrawText(CCmdUI* pCmdUI);
- afx_msg void OnDrawBarGraph();
- afx_msg void OnUpdateDrawBarGraph(CCmdUI* pCmdUI);
- afx_msg void OnDrawClock();
- afx_msg void OnUpdateDrawClock(CCmdUI* pCmdUI);
- afx_msg void OnTimer(UINT nIDEvent);
- afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
- afx_msg void OnDrawAnimateTag();
- afx_msg void OnUpdateDrawAnimateTag(CCmdUI* pCmdUI);
- afx_msg void OnUpdateDrawCursor(CCmdUI* pCmdUI);
- afx_msg void OnDrawCursor();
- afx_msg void OnRunRun();
- afx_msg void OnUpdateRunRun(CCmdUI* pCmdUI);
- afx_msg void OnRunStop();
- afx_msg void OnUpdateRunStop(CCmdUI* pCmdUI);
- afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
- afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
- afx_msg void OnDrawIsa();
- afx_msg void OnUpdateDrawIsa(CCmdUI* pCmdUI);
- afx_msg void OnDrawLoop();
- afx_msg void OnUpdateDrawLoop(CCmdUI* pCmdUI);
- afx_msg void OnObjectMerge();
- afx_msg void OnUpdateObjectMerge(CCmdUI* pCmdUI);
- afx_msg void OnObjectLib();
- afx_msg void OnUpdateObjectLib(CCmdUI* pCmdUI);
- afx_msg void OnDrawLib();
- afx_msg void OnUpdateDrawLib(CCmdUI* pCmdUI);
- afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
- afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
- afx_msg void OnObjectSplit();
- afx_msg void OnUpdateObjectSplit(CCmdUI* pCmdUI);
- afx_msg void OnDrawButton();
- afx_msg void OnUpdateDrawButton(CCmdUI* pCmdUI);
- //}}AFX_MSG
- afx_msg void OnEditRotate();
- afx_msg void OnUpdateEditRotate(CCmdUI* pCmdUI);
-
- afx_msg void OnAlign( UINT nID );
- afx_msg void OnUpdateAlign( CCmdUI* pCmdUI );
- DECLARE_MESSAGE_MAP()
- };
- #ifndef _DEBUG // debug version in ProjView.cpp
- inline CProjDoc* CProjView::GetDocument()
- { return (CProjDoc*)m_pDocument; }
- #endif
- /////////////////////////////////////////////////////////////////////////////