Скачиваний:
11
Добавлен:
01.05.2014
Размер:
3.38 Кб
Скачать
// lab22View.h : interface of the CLab22View class
//
/////////////////////////////////////////////////////////////////////////////

#if !defined(AFX_LAB22VIEW_H__87A78227_31E8_43A7_9A91_1E94AE7403AA__INCLUDED_)
#define AFX_LAB22VIEW_H__87A78227_31E8_43A7_9A91_1E94AE7403AA__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000


class CLab22View : public CScrollView
{
protected: // create from serialization only
	CLab22View();
	DECLARE_DYNCREATE(CLab22View)

// Attributes
public:
	CLab22Doc* GetDocument();

protected:
	CPoint m_FirstPoint;      // First point recorded for an element
    CPoint m_SecondPoint;     // Second point recorded for an element
	CPoint m_MoveLastPoint;
	CString StringData;		  	
    Shape* m_pTempElement; // Pointer to temporary element
	Shape* m_pSelected;
	int SelectedIndex;

	bool CaretCreated;
	bool doMove;			//Флаг, true если будем двигать

	int m_Scale;
	bool doLine;			//Флаг, true если рисуем связь

	Shape* first;
	Shape* second;			//Первый и второй элементы при проведении связи

// Operations
public:

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CLab22View)
	public:
	virtual void OnDraw(CDC* pDC);  // overridden to draw this view
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	virtual void OnPrepareDC(CDC* pDC, CPrintInfo* pInfo = 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 OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint);
	//}}AFX_VIRTUAL

// Implementation
public:
	virtual ~CLab22View();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:
	Shape* CreateElement();				//Создает указатель на фигуру в зависимости от тек. состояния
	Shape* SelectElement(CPoint aPoint);	//возвращает элемент из контейнера на которы йнаведен курсор

	void ShowCursor(CDC* pDC);				//рисование каретки для ввода текста

	void ResetScrollSizes();				//пересчитываем размер раб. области для ползунков
	
	void printLine(CPoint First,CPoint Second);

// Generated message map functions
protected:
	//{{AFX_MSG(CLab22View)
	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 OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
	afx_msg void OnRButtonUp(UINT nFlags, CPoint point);
	afx_msg void OnFigureDelete();
	afx_msg void OnScale();
	afx_msg void OnConteinerGraphview();
	afx_msg void OnElementsAddline();
	afx_msg void OnUpdateElementsAddline(CCmdUI* pCmdUI);
	afx_msg void OnFigureDeleteline();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

#ifndef _DEBUG  // debug version in lab22View.cpp
inline CLab22Doc* CLab22View::GetDocument()
   { return (CLab22Doc*)m_pDocument; }
#endif

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_LAB22VIEW_H__87A78227_31E8_43A7_9A91_1E94AE7403AA__INCLUDED_)
Соседние файлы в папке lab22