www.pudn.com > RMS2000_C.rar > DrawVw.h
// DrawVw.h : interface of the CDrawView class
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_DRAWVW_H__57AF06D8_3F92_4DB7_BA94_D0616183DBE2__INCLUDED_)
#define AFX_DRAWVW_H__57AF06D8_3F92_4DB7_BA94_D0616183DBE2__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#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 CDrawItem;
//class CDrawObj;
#include "Express.h"
#include "gifshare.h"
class CDrawView : public CScrollView
{
protected: // create from serialization only
CDrawView();
DECLARE_DYNCREATE(CDrawView)
int m_NumCols,m_NumRows;
int m_PageHeight,m_PageWidth;
// Attributes
public:
CGif89a *gif;
CMapVariabile m_VarsMap;
CExpression m_expression;
BOOL m_warn;
BOOL m_bActive;
COLORREF m_gridColor;
BOOL m_bGrid;
CDrawObjList m_selection;
CDrawDoc* GetDocument();
// m_pSelection holds the selection to the current CDrawItem.
// For many applications, such a member variable isn't adequate to
// represent a selection, such as a multiple selection or a selection
// of objects that are not CDrawItem objects. This selection
// mechanism is provided just to help you get started.
// TODO: replace this selection mechanism with one appropriate to your app.
CDrawItem* m_pSelection;
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CDrawView)
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 Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL);
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);
virtual void OnPrint(CDC* pDC, CPrintInfo* pInfo);
virtual void OnEndPrintPreview(CDC* pDC, CPrintInfo* pInfo, POINT point, CPreviewView* pView);
//}}AFX_VIRTUAL
// Implementation
public:
virtual BOOL IsSelected(const CObject* pDocItem) const;// Container support
void PasteEmbedded(COleDataObject& dataObject, CPoint point);
void PasteNative(COleDataObject& dataObject);
virtual void OnActivateView(BOOL bActivate,CView* pActiveView,CView* pDeactiveView);
CRect GetInitialPosition();
void SetPageSize(CSize size);
void DrawGrid(CDC* pDC);
void SelectWithinRect(CRect rect,BOOL bAdd=FALSE);
void Deselect(CDrawObj* pObj);
void CloneSelection();
void Select(CDrawObj* pObj,BOOL bAdd = FALSE);
void Remove(CDrawObj* pObj);
void DocToClient(CRect& rect);
void DocToClient(CPoint& point);
void ClientToDoc(CPoint& point);
void ClientToDoc(CRect& rect);
void InvalObj(CDrawObj* pObj);
virtual ~CDrawView();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
virtual void OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint);
static CLIPFORMAT m_cfDraw;
static CLIPFORMAT m_cfObjectDescriptor;
protected:
// Generated message map functions
protected:
afx_msg void OnContextMenu(CWnd*, CPoint point);
//{{AFX_MSG(CDrawView)
afx_msg void OnDestroy();
afx_msg void OnSetFocus(CWnd* pOldWnd);
afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg void OnInsertObject();
afx_msg void OnCancelEditCntr();
afx_msg void OnDrawSelect();
afx_msg void OnDrawRect();
afx_msg void OnUpdateDrawSelect(CCmdUI* pCmdUI);
afx_msg void OnUpdateDrawRect(CCmdUI* pCmdUI);
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
afx_msg void OnDrawCircle();
afx_msg void OnDrawEllipse();
afx_msg void OnDrawLine();
afx_msg void OnDrawRoundrect();
afx_msg void OnEditProperties();
afx_msg void OnObjectMoveback();
afx_msg void OnObjectMoveforward();
afx_msg void OnObjectMovetoback();
afx_msg void OnObjectMovetofront();
afx_msg void OnUpdateObjectMoveback(CCmdUI* pCmdUI);
afx_msg void OnUpdateObjectMoveforward(CCmdUI* pCmdUI);
afx_msg void OnUpdateObjectMovetoback(CCmdUI* pCmdUI);
afx_msg void OnUpdateObjectMovetofront(CCmdUI* pCmdUI);
afx_msg void OnObjectFillcolor();
afx_msg void OnObjectLinecolor();
afx_msg void OnUpdateObjectFillcolor(CCmdUI* pCmdUI);
afx_msg void OnUpdateObjectLinecolor(CCmdUI* pCmdUI);
afx_msg void OnViewGrid();
afx_msg void OnUpdateViewGrid(CCmdUI* pCmdUI);
afx_msg void OnViewShowobjects();
afx_msg void OnUpdateViewShowobjects(CCmdUI* pCmdUI);
afx_msg void OnEditClear();
afx_msg void OnEditCopy();
afx_msg void OnEditCut();
afx_msg void OnEditPaste();
afx_msg void OnEditSelectAll();
afx_msg void OnUpdateEditClear(CCmdUI* pCmdUI);
afx_msg void OnUpdateEditCopy(CCmdUI* pCmdUI);
afx_msg void OnUpdateEditCut(CCmdUI* pCmdUI);
afx_msg void OnUpdateEditPaste(CCmdUI* pCmdUI);
afx_msg void OnUpdateEditSelectAll(CCmdUI* pCmdUI);
afx_msg void OnDrawBkbmp();
afx_msg void OnEditLock();
afx_msg void OnUpdateEditLock(CCmdUI* pCmdUI);
afx_msg void OnEditDelzero();
afx_msg void OnDrawText();
afx_msg void OnUpdateDrawText(CCmdUI* pCmdUI);
afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
afx_msg void OnObjectTextcolor();
afx_msg void OnUpdateObjectTextcolor(CCmdUI* pCmdUI);
afx_msg void OnDrawPencil();
afx_msg void OnUpdateDrawPencil(CCmdUI* pCmdUI);
afx_msg void OnSelectRun();
afx_msg void OnSelectEdit();
afx_msg void OnUpdateSelectRun(CCmdUI* pCmdUI);
afx_msg void OnUpdateSelectEdit(CCmdUI* pCmdUI);
afx_msg void OnRtuTelctrl();
afx_msg void OnUpdateRtuTelctrl(CCmdUI* pCmdUI);
afx_msg void OnDrawHpipe();
afx_msg void OnUpdateDrawHpipe(CCmdUI* pCmdUI);
afx_msg void OnUpdateDrawCircle(CCmdUI* pCmdUI);
afx_msg void OnUpdateDrawEllipse(CCmdUI* pCmdUI);
afx_msg void OnUpdateDrawLine(CCmdUI* pCmdUI);
afx_msg void OnUpdateDrawRoundrect(CCmdUI* pCmdUI);
afx_msg void OnDrawVpipe();
afx_msg void OnUpdateDrawVpipe(CCmdUI* pCmdUI);
afx_msg void OnDrawBmp();
afx_msg void OnUpdateDrawBmp(CCmdUI* pCmdUI);
afx_msg void OnDrawLiquid();
afx_msg void OnUpdateDrawLiquid(CCmdUI* pCmdUI);
afx_msg void OnTimer(UINT nIDEvent);
afx_msg void OnDrawPump();
afx_msg void OnUpdateDrawPump(CCmdUI* pCmdUI);
afx_msg void OnDrawLadder();
afx_msg void OnUpdateDrawLadder(CCmdUI* pCmdUI);
afx_msg void OnDrawSpos();
afx_msg void OnUpdateDrawSpos(CCmdUI* pCmdUI);
afx_msg void OnDrawMeter();
afx_msg void OnDrawCur();
afx_msg void OnEditUnlock();
afx_msg void OnUpdateEditUnlock(CCmdUI* pCmdUI);
//}}AFX_MSG
afx_msg LRESULT OnRtuData(WPARAM ui ,LPARAM lo);
DECLARE_MESSAGE_MAP()
};
#ifndef _DEBUG // debug version in DrawVw.cpp
inline CDrawDoc* CDrawView::GetDocument()
{ return (CDrawDoc*)m_pDocument; }
#endif
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_DRAWVW_H__57AF06D8_3F92_4DB7_BA94_D0616183DBE2__INCLUDED_)