Click here to Skip to main content
15,860,844 members
Articles / Desktop Programming / WTL

Form Designer

26 Jul 2021CPOL24 min read 349.7K   82.5K   230  
Component for adding scriptable forms capabilities to an application.
// MFCDemoView.h : interface of the CMFCDemoView class
//
// Author : David Shepherd
//			Copyright (c) 2002, DaeDoe-Software
//
/////////////////////////////////////////////////////////////////////////////

//{{AFX_INCLUDES()
//}}AFX_INCLUDES
#include "formeditor.h"
#include "formviewer.h"
#include "simplescripteditor.h"

#if !defined(AFX_MFCDEMOVIEW_H__1DCF031A_0EC7_465B_996E_891EFB9BCF3E__INCLUDED_)
#define AFX_MFCDEMOVIEW_H__1DCF031A_0EC7_465B_996E_891EFB9BCF3E__INCLUDED_

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

class CMFCDemoView : public CView
{
private:
	// application accelerators
	HACCEL m_hAccel;

	// objects to expose
	CComPtr<IDispatch> m_spClass1;
	CComPtr<IDispatch> m_spClass2;

	// form editor state
	BOOL m_FES_Busy;
	BOOL m_FES_Modified;
	BOOL m_FES_CanPaste;
	BOOL m_FES_CanUndo;
	BOOL m_FES_CanRedo;
	long m_FES_ItemCount;
	long m_FES_SelectedItemCount;

	// returns the temporary file name
	CString GetTempFileName();

protected: // create from serialization only
	CMFCDemoView();
	DECLARE_DYNCREATE(CMFCDemoView)

public:
	//{{AFX_DATA(CMFCDemoView)
	//}}AFX_DATA
	CTabCtrl	m_Tab;
	CFormEditor	m_FormEditor;
	CFormViewer	m_FormViewer;
	CSimpleScriptEditor	m_SimpleScriptEditor;

// Attributes
public:
	CMFCDemoDoc* GetDocument();

// Operations
public:

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CMFCDemoView)
	public:
	virtual void OnDraw(CDC* pDC);  // overridden to draw this view
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	virtual BOOL PreTranslateMessage(MSG* pMsg);
	protected:
	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);
	//}}AFX_VIRTUAL

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

protected:

// Generated message map functions
protected:
	//{{AFX_MSG(CMFCDemoView)
	afx_msg void OnStateChangedFormeditor(BOOL Busy, BOOL Modified, BOOL CanPaste, BOOL CanUndo, BOOL CanRedo, long ItemCount, long SelectedItemCount);
	afx_msg void OnEditExistingEventHandlerFormeditor();
	afx_msg void OnEditScriptErrorFormeditor(LPCTSTR Source, long Number, LPCTSTR Description);
	afx_msg void OnModifiedStateChangedSimplescripteditor(BOOL Modified);
	afx_msg void OnSelchangeTab(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnNew();
	afx_msg void OnUpdateNew(CCmdUI* pCmdUI);
	afx_msg void OnOpen();
	afx_msg void OnUpdateOpen(CCmdUI* pCmdUI);
	afx_msg void OnSave();
	afx_msg void OnUpdateSave(CCmdUI* pCmdUI);
	afx_msg void OnSaveAs();
	afx_msg void OnUpdateSaveAs(CCmdUI* pCmdUI);
	afx_msg void OnCut();
	afx_msg void OnUpdateCut(CCmdUI* pCmdUI);
	afx_msg void OnCopy();
	afx_msg void OnUpdateCopy(CCmdUI* pCmdUI);
	afx_msg void OnPaste();
	afx_msg void OnUpdatePaste(CCmdUI* pCmdUI);
	afx_msg void OnUndo();
	afx_msg void OnUpdateUndo(CCmdUI* pCmdUI);
	afx_msg void OnRedo();
	afx_msg void OnUpdateRedo(CCmdUI* pCmdUI);
	afx_msg void OnAbout();
	afx_msg void OnUpdateAbout(CCmdUI* pCmdUI);
	afx_msg void OnFrame();
	afx_msg void OnUpdateFrame(CCmdUI* pCmdUI);
	afx_msg void OnRectangle();
	afx_msg void OnUpdateRectangle(CCmdUI* pCmdUI);
	afx_msg void OnPicture();
	afx_msg void OnUpdatePicture(CCmdUI* pCmdUI);
	afx_msg void OnLabel();
	afx_msg void OnUpdateLabel(CCmdUI* pCmdUI);
	afx_msg void OnButton();
	afx_msg void OnUpdateButton(CCmdUI* pCmdUI);
	afx_msg void OnCheck();
	afx_msg void OnUpdateCheck(CCmdUI* pCmdUI);
	afx_msg void OnRadio();
	afx_msg void OnUpdateRadio(CCmdUI* pCmdUI);
	afx_msg void OnText();
	afx_msg void OnUpdateText(CCmdUI* pCmdUI);
	afx_msg void OnCombo();
	afx_msg void OnUpdateCombo(CCmdUI* pCmdUI);
	afx_msg void OnList();
	afx_msg void OnUpdateList(CCmdUI* pCmdUI);
	afx_msg void OnHScroll();
	afx_msg void OnUpdateHScroll(CCmdUI* pCmdUI);
	afx_msg void OnVScroll();
	afx_msg void OnUpdateVScroll(CCmdUI* pCmdUI);
	afx_msg void OnSpin();
	afx_msg void OnUpdateSpin(CCmdUI* pCmdUI);
	afx_msg void OnSlider();
	afx_msg void OnUpdateSlider(CCmdUI* pCmdUI);
	afx_msg void OnProgress();
	afx_msg void OnUpdateProgress(CCmdUI* pCmdUI);
	afx_msg void OnActivex();
	afx_msg void OnUpdateActivex(CCmdUI* pCmdUI);
	afx_msg void OnDelete();
	afx_msg void OnUpdateDelete(CCmdUI* pCmdUI);
	afx_msg void OnGrid();
	afx_msg void OnUpdateGrid(CCmdUI* pCmdUI);
	afx_msg void OnGridSettings();
	afx_msg void OnUpdateGridSettings(CCmdUI* pCmdUI);
	afx_msg void OnTab();
	afx_msg void OnUpdateTab(CCmdUI* pCmdUI);
	afx_msg void OnSelectAll();
	afx_msg void OnUpdateSelectAll(CCmdUI* pCmdUI);
	afx_msg void OnUnselectAll();
	afx_msg void OnUpdateUnselectAll(CCmdUI* pCmdUI);
	afx_msg void OnProperties();
	afx_msg void OnUpdateProperties(CCmdUI* pCmdUI);
	afx_msg void OnLeft();
	afx_msg void OnUpdateLeft(CCmdUI* pCmdUI);
	afx_msg void OnRight();
	afx_msg void OnUpdateRight(CCmdUI* pCmdUI);
	afx_msg void OnUp();
	afx_msg void OnUpdateUp(CCmdUI* pCmdUI);
	afx_msg void OnDown();
	afx_msg void OnUpdateDown(CCmdUI* pCmdUI);
	afx_msg void OnLayoutSendtoback();
	afx_msg void OnUpdateLayoutSendtoback(CCmdUI* pCmdUI);
	afx_msg void OnLayoutBringtofront();
	afx_msg void OnUpdateLayoutBringtofront(CCmdUI* pCmdUI);
	afx_msg void OnAlignLeft();
	afx_msg void OnUpdateAlignLeft(CCmdUI* pCmdUI);
	afx_msg void OnAlignRight();
	afx_msg void OnUpdateAlignRight(CCmdUI* pCmdUI);
	afx_msg void OnAlignTop();
	afx_msg void OnUpdateAlignTop(CCmdUI* pCmdUI);
	afx_msg void OnAlignBottom();
	afx_msg void OnUpdateAlignBottom(CCmdUI* pCmdUI);
	afx_msg void OnSpaceHorz();
	afx_msg void OnUpdateSpaceHorz(CCmdUI* pCmdUI);
	afx_msg void OnSpaceVert();
	afx_msg void OnUpdateSpaceVert(CCmdUI* pCmdUI);
	afx_msg void OnSizeLargestWidth();
	afx_msg void OnUpdateSizeLargestWidth(CCmdUI* pCmdUI);
	afx_msg void OnSizeLargestHeight();
	afx_msg void OnUpdateSizeLargestHeight(CCmdUI* pCmdUI);
	afx_msg void OnSizeLargest();
	afx_msg void OnUpdateSizeLargest(CCmdUI* pCmdUI);
	afx_msg void OnSizeSmallestWidth();
	afx_msg void OnUpdateSizeSmallestWidth(CCmdUI* pCmdUI);
	afx_msg void OnSizeSmallestHeight();
	afx_msg void OnUpdateSizeSmallestHeight(CCmdUI* pCmdUI);
	afx_msg void OnSizeSmallest();
	afx_msg void OnUpdateSizeSmallest(CCmdUI* pCmdUI);
	afx_msg void OnCenterHorz();
	afx_msg void OnUpdateCenterHorz(CCmdUI* pCmdUI);
	afx_msg void OnCenterVert();
	afx_msg void OnUpdateCenterVert(CCmdUI* pCmdUI);
	afx_msg void OnCenter();
	afx_msg void OnUpdateCenter(CCmdUI* pCmdUI);
	afx_msg void OnValidateScript();
	afx_msg void OnUpdateValidateScript(CCmdUI* pCmdUI);
	afx_msg void OnPreviewAutoSize();
	afx_msg void OnUpdatePreviewAutoSize(CCmdUI* pCmdUI);
	afx_msg void OnPreview();
	afx_msg void OnUpdatePreview(CCmdUI* pCmdUI);
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	afx_msg void OnSize(UINT nType, int cx, int cy);
	afx_msg BOOL OnEraseBkgnd(CDC* pDC);
	DECLARE_EVENTSINK_MAP()
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

#ifndef _DEBUG  // debug version in MFCDemoView.cpp
inline CMFCDemoDoc* CMFCDemoView::GetDocument()
   { return (CMFCDemoDoc*)m_pDocument; }
#endif

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

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

#endif // !defined(AFX_MFCDEMOVIEW_H__1DCF031A_0EC7_465B_996E_891EFB9BCF3E__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 The Code Project Open License (CPOL)


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

Comments and Discussions