Click here to Skip to main content
15,894,410 members
Articles / Desktop Programming / MFC

SolidGraph CAD System

Rate me:
Please Sign up or sign in to vote.
4.97/5 (78 votes)
12 Sep 20062 min read 375.7K   29.8K   209  
A SolidGraph CAD system source code.
// ReportCreatorView.h : interface of the CReportCreatorView class
//
/////////////////////////////////////////////////////////////////////////////

#if !defined(AFX_REPORTCREATORVIEW_H__FD25583C_8991_4117_853F_4264E9678998__INCLUDED_)
#define AFX_REPORTCREATORVIEW_H__FD25583C_8991_4117_853F_4264E9678998__INCLUDED_

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

#include "ReportEditor/ReportEditor.h"
#include "ReportEditor/HorzRuler.h"
#include "ReportEditor/VertRuler.h"
#include "ReportEditor/CornerBox.h"

#include "ReportCreatorDoc.h"

#include "Dialogs//ReportPagesPreviewDlg.h"
struct MyEditor
{
	CReportEditor* editor;
	CHorzRuler*    Horz_Ruler;
	CVertRuler*    Vert_Ruler;
	CCornerBox*    Corner_Box;
	MyEditor()
	{
		editor = NULL;
		Horz_Ruler = NULL;
		Vert_Ruler = NULL;
		Corner_Box = NULL;
	};
};

//class CReportPagesPreviewDlg;

class CReportCreatorView : public CView
{
	friend class CReportPagesPreviewDlg;
protected: // create from serialization only
	CReportCreatorView();
	DECLARE_DYNCREATE(CReportCreatorView)

// Attributes
public:
	CReportCreatorDoc* GetDocument();

	void AddPage(CDiagramEntityContainer* cont, bool vertiacal, bool repaint=true);
	int  GetCurrentPage();
	void SetCurrentPage(int);

// Operations
public:

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CReportCreatorView)
	public:
	virtual void OnDraw(CDC* pDC);  // overridden to draw this view
	virtual void OnPrint(CDC* pDC, CPrintInfo*);
	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 ~CReportCreatorView();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:

// Generated message map functions
protected:
	//{{AFX_MSG(CReportCreatorView)
	afx_msg BOOL OnEraseBkgnd(CDC* pDC);
	afx_msg void OnSize(UINT nType, int cx, int cy);
	afx_msg void OnButtonSettings();
	afx_msg void OnButtonGrid();
	afx_msg void OnUpdateButtonGrid(CCmdUI* pCmdUI);
	afx_msg void OnButtonMargin();
	afx_msg void OnUpdateButtonMargin(CCmdUI* pCmdUI);
	afx_msg void OnButtonSnap();
	afx_msg void OnUpdateButtonSnap(CCmdUI* pCmdUI);
	afx_msg void OnButtonAddBox();
	afx_msg void OnButtonAddLabel();
	afx_msg void OnButtonAddLine();
	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 OnEditUndo();
	afx_msg void OnUpdateEditUndo(CCmdUI* pCmdUI);
	afx_msg void OnZoomIn();
	afx_msg void OnZoomOut();
	afx_msg void OnButtonAlignBottom();
	afx_msg void OnUpdateButtonAlignBottom(CCmdUI* pCmdUI);
	afx_msg void OnButtonAlignLeft();
	afx_msg void OnUpdateButtonAlignLeft(CCmdUI* pCmdUI);
	afx_msg void OnButtonAlignRight();
	afx_msg void OnUpdateButtonAlignRight(CCmdUI* pCmdUI);
	afx_msg void OnButtonAlignTop();
	afx_msg void OnUpdateButtonAlignTop(CCmdUI* pCmdUI);
	afx_msg void OnButtonSameSize();
	afx_msg void OnUpdateButtonSameSize(CCmdUI* pCmdUI);
	afx_msg void OnButtonZoomToFit();
	afx_msg void OnButtonProperties();
	afx_msg void OnButtonAddPicture();
	afx_msg void OnDestroy();
	afx_msg void OnDelete();
	afx_msg void OnInsert();
	//}}AFX_MSG

	LRESULT OnEditorHScroll( WPARAM, LPARAM );
	LRESULT OnEditorVScroll( WPARAM, LPARAM );
	LRESULT OnEditorZoom( WPARAM, LPARAM );
	LRESULT OnEditorMouse( WPARAM z, LPARAM );
	LRESULT OnRulerMeasurements( WPARAM, LPARAM );

	DECLARE_MESSAGE_MAP()

private:
	CReportPagesPreviewDlg* m_pages_preview_dlg;
public:
	void SetPagesPreviewDlg(CReportPagesPreviewDlg* nppd) {m_pages_preview_dlg = nppd;};
private:
	// Private data
	std::vector<MyEditor>	m_editors;
	int                     m_current_editor;

	int				m_screenResolutionX;

	void			SaveSettings();
public:
	int  GetPagesCount() {return (int)m_editors.size();};
	virtual void OnPrepareDC(CDC* pDC, CPrintInfo* pInfo = NULL);

	afx_msg void OnReportAddPage();

	void   InsertPictureToPage(int,HENHMETAFILE,float leftPerc=0.0, 
											float topPerc=0.0,
											float WidthPerc=100.0, 
											float HeightPerc=100.0);
};

#ifndef _DEBUG  // debug version in ReportCreatorView.cpp
inline CReportCreatorDoc* CReportCreatorView::GetDocument()
   { return (CReportCreatorDoc*)m_pDocument; }
#endif

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

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

#endif // !defined(AFX_REPORTCREATORVIEW_H__FD25583C_8991_4117_853F_4264E9678998__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 has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions