Click here to Skip to main content
15,896,539 members
Articles / Desktop Programming / MFC

UMLEditor - revisiting the vector editor

Rate me:
Please Sign up or sign in to vote.
4.99/5 (156 votes)
5 Jul 2006Public Domain8 min read 378.2K   37.1K   326  
An UML editor with code-generation capabilities derived from CDiagramEditor.
// UMLEditorDemoView.h : interface of the CUMLEditorDemoView class
//
/////////////////////////////////////////////////////////////////////////////

#if !defined(AFX_UMLEDITORDEMOVIEW_H__63E4EB35_F4EC_429C_BCB2_479078E01003__INCLUDED_)
#define AFX_UMLEDITORDEMOVIEW_H__63E4EB35_F4EC_429C_BCB2_479078E01003__INCLUDED_

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

#include "UMLEditor/UMLEditor.h"

class CUMLEditorDemoView : public CView
{
protected:
	CUMLEditorDemoView();
	DECLARE_DYNCREATE(CUMLEditorDemoView)

// Attributes
public:
	CUMLEditorDemoDoc* GetDocument();

// Operations
public:

// Overrides
	//{{AFX_VIRTUAL(CUMLEditorDemoView)
	public:
	virtual void OnDraw(CDC* pDC);  // overridden to draw this view
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	virtual void OnInitialUpdate();
	protected:
	virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
	virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
	virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
	//}}AFX_VIRTUAL

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

protected:

// Generated message map functions
protected:
	//{{AFX_MSG(CUMLEditorDemoView)
	afx_msg void OnButtonClass();
	afx_msg void OnButtonLink();
	afx_msg void OnSize(UINT nType, int cx, int cy);
	afx_msg BOOL OnEraseBkgnd(CDC* pDC);
	afx_msg void OnButtonNote();
	afx_msg void OnButtonPackage();
	afx_msg void OnButtonLabel();
	afx_msg void OnButtonInterface();
	afx_msg void OnButtonDisplayProperties();
	afx_msg void OnEditUndo();
	afx_msg void OnUpdateEditUndo(CCmdUI* pCmdUI);
	afx_msg void OnEditCopy();
	afx_msg void OnUpdateEditCopy(CCmdUI* pCmdUI);
	afx_msg void OnEditCut();
	afx_msg void OnUpdateEditCut(CCmdUI* pCmdUI);
	afx_msg void OnEditPaste();
	afx_msg void OnUpdateEditPaste(CCmdUI* pCmdUI);
	afx_msg void OnExport();
	afx_msg void OnFlipLink();
	afx_msg void OnUpdateFlipLink(CCmdUI* pCmdUI);
	afx_msg void OnProperty();
	afx_msg void OnZoom100();
	afx_msg void OnZoom150();
	afx_msg void OnZoom200();
	afx_msg void OnZoom25();
	afx_msg void OnZoom50();
	afx_msg void OnSnap();
	afx_msg void OnUpdateSnap(CCmdUI* pCmdUI);
	afx_msg void OnShowGrid();
	afx_msg void OnUpdateShowGrid(CCmdUI* pCmdUI);
	afx_msg void OnImport();
	afx_msg void OnUpdateImport(CCmdUI* pCmdUI);
	afx_msg void OnEditDelete();
	afx_msg void OnUpdateEditDelete(CCmdUI* pCmdUI);
	afx_msg void OnButtonTemplate();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()

private:
	CUMLEditor	m_editor;
	int			m_screenResolutionX;
	BOOL		m_onlyh;
};

#ifndef _DEBUG  // debug version in UMLEditorDemoView.cpp
inline CUMLEditorDemoDoc* CUMLEditorDemoView::GetDocument()
   { return (CUMLEditorDemoDoc*)m_pDocument; }
#endif

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

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

#endif // !defined(AFX_UMLEDITORDEMOVIEW_H__63E4EB35_F4EC_429C_BCB2_479078E01003__INCLUDED_)

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under A Public Domain dedication


Written By
Software Developer (Senior) Abstrakt Mekanik AB
Sweden Sweden
45 years old, married, three kids.

Started with computers more than 20 years ago on a CBM-64.

Read Theoretical Philosophy at the University of Lund.

Working as a C++ consultant developer.

Science-fiction freak. Enjoy vintage punkrock.

Comments and Discussions