// drawerView.h : interface of the CDrawerView class // ///////////////////////////////////////////////////////////////////////////// #if !defined(AFX_DRAWERVIEW_H__05EB7259_BB5B_11D2_AEA2_00C06D163C2E__INCLUDED_) #define AFX_DRAWERVIEW_H__05EB7259_BB5B_11D2_AEA2_00C06D163C2E__INCLUDED_ #if _MSC_VER >= 1000 #pragma once #endif // _MSC_VER >= 1000 #include "polyline.h" // Include the polyline spec. #include "stdafx.h" class CDrawerView : public CScrollView { protected: // create from serialization only CDrawerView(); DECLARE_DYNCREATE(CDrawerView) // Attributes public: CDrawerDoc* GetDocument(); // Operations public: // Overrides // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(CDrawerView) public: virtual void OnDraw(CDC* pDC); // overridden to draw this view virtual BOOL PreCreateWindow(CREATESTRUCT& cs); protected: virtual void OnInitialUpdate(); // called first time after construct virtual BOOL OnPreparePrinting(CPrintInfo* pInfo); virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo); virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo); //}}AFX_VIRTUAL // Implementation public: virtual ~CDrawerView(); #ifdef _DEBUG virtual void AssertValid() const; virtual void Dump(CDumpContext& dc) const; #endif protected: enum ClickState { clickCreate, clickSelect, clickRemove }; ClickState clickState; CList drawList; CString pathName; const CSize m_sizeEllipse; // Size of the circles used for control points // Creating points helper variables bool startNewPolyLine; PolyLine newPolyLine; // Moving point helper variables bool isMovingPoint; // Boolean to determine if the user is moving a point. PolyLine* draggingPolyLine; int draggingPoint; Point currentMousePoint; // Helpers void clearDrawList(); void save(); // Generated message map functions protected: //{{AFX_MSG(CDrawerView) afx_msg void OnPolylineCreate(); afx_msg void OnUpdatePolylineCreate(CCmdUI* pCmdUI); afx_msg void OnPolylineRemove(); afx_msg void OnUpdatePolylineRemove(CCmdUI* pCmdUI); afx_msg void OnPolylineSelect(); afx_msg void OnUpdatePolylineSelect(CCmdUI* pCmdUI); afx_msg void OnFileNew(); afx_msg void OnFileOpen(); afx_msg void OnFileSave(); afx_msg void OnFileSaveAs(); afx_msg void OnLButtonDown(UINT nFlags, CPoint point); afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags); afx_msg void OnRButtonDown(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 OnPolylinePointRemove(); //}}AFX_MSG DECLARE_MESSAGE_MAP() }; #ifndef _DEBUG // debug version in drawerView.cpp inline CDrawerDoc* CDrawerView::GetDocument() { return (CDrawerDoc*)m_pDocument; } #endif ///////////////////////////////////////////////////////////////////////////// //{{AFX_INSERT_LOCATION}} // Microsoft Developer Studio will insert additional declarations immediately before the previous line. #endif // !defined(AFX_DRAWERVIEW_H__05EB7259_BB5B_11D2_AEA2_00C06D163C2E__INCLUDED_)