Click here to Skip to main content
15,860,943 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.
#if !defined(AFX_FORMEDITOR_H__A091E95A_B0E7_411A_8EB2_48FFD201651D__INCLUDED_)
#define AFX_FORMEDITOR_H__A091E95A_B0E7_411A_8EB2_48FFD201651D__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// Machine generated IDispatch wrapper class(es) created by Microsoft Visual C++

// NOTE: Do not modify the contents of this file.  If this class is regenerated by
//  Microsoft Visual C++, your modifications will be overwritten.


// Dispatch interfaces referenced by this interface
class CScript;
class CFormEditorItemDetails;
class CFormEditorItemCollection;

/////////////////////////////////////////////////////////////////////////////
// CFormEditor wrapper class

class CFormEditor : public CWnd
{
protected:
	DECLARE_DYNCREATE(CFormEditor)
public:
	CLSID const& GetClsid()
	{
		static CLSID const clsid
			= { 0xe78fc0e6, 0x1c8e, 0x11d6, { 0xb6, 0xa6, 0xb8, 0x64, 0xd1, 0x4c, 0xd0, 0x46 } };
		return clsid;
	}
	virtual BOOL Create(LPCTSTR lpszClassName,
		LPCTSTR lpszWindowName, DWORD dwStyle,
		const RECT& rect,
		CWnd* pParentWnd, UINT nID,
		CCreateContext* pContext = NULL)
	{ return CreateControl(GetClsid(), lpszWindowName, dwStyle, rect, pParentWnd, nID); }

    BOOL Create(LPCTSTR lpszWindowName, DWORD dwStyle,
		const RECT& rect, CWnd* pParentWnd, UINT nID,
		CFile* pPersist = NULL, BOOL bStorage = FALSE,
		BSTR bstrLicKey = NULL)
	{ return CreateControl(GetClsid(), lpszWindowName, dwStyle, rect, pParentWnd, nID,
		pPersist, bStorage, bstrLicKey); }

// Attributes
public:

// Operations
public:
	void About();
	void SelectAll();
	void SelectNone();
	void New();
	void NewEx(long Width, long Height, unsigned long BackColor, unsigned long ForeColor);
	CString ShowInsertDialog();
	LPDISPATCH Insert(LPCTSTR ProgID);
	LPDISPATCH InsertEx(LPCTSTR ProgID, long Left, long Top, long Width, long Height);
	void Delete();
	void Cut();
	void Copy();
	void Paste();
	void Undo();
	void Redo();
	void SetTabOrder();
	void RefreshState();
	void LoadFromFile(LPCTSTR FileName);
	void SaveToFile(LPCTSTR FileName);
	BOOL ValidateScript();
	void MoveLeft();
	void MoveRight();
	void MoveUp();
	void MoveDown();
	void AlignLeft();
	void AlignRight();
	void AlignTop();
	void AlignBottom();
	void FormAlignHCenter();
	void FormAlignVCenter();
	void FormAlignBoth();
	void SizeWidthToLargest();
	void SizeHeightToLargest();
	void SizeToLargest();
	void SizeWidthToSmallest();
	void SizeHeightToSmallest();
	void SizeToSmallest();
	void SpaceHorizontally();
	void SpaceVertically();
	void Properties();
	void Expose(LPCTSTR Name, LPDISPATCH pDisp);
	void DDUnlock(long Data1_High, long Data1_Low, long Data2_High, long Data2_Low);
	CScript GetScript();
	BOOL GetBorderVisible();
	void SetBorderVisible(BOOL bNewValue);
	unsigned long GetBackColor();
	void SetBackColor(unsigned long newValue);
	long GetFormWidth();
	void SetFormWidth(long nNewValue);
	long GetFormHeight();
	void SetFormHeight(long nNewValue);
	unsigned long GetFormBackColor();
	void SetFormBackColor(unsigned long newValue);
	unsigned long GetFormForeColor();
	void SetFormForeColor(unsigned long newValue);
	long GetGridWidth();
	void SetGridWidth(long nNewValue);
	long GetGridHeight();
	void SetGridHeight(long nNewValue);
	BOOL GetGridVisible();
	void SetGridVisible(BOOL bNewValue);
	unsigned long GetDragFrameBackColor();
	void SetDragFrameBackColor(unsigned long newValue);
	unsigned long GetDragFrameForeColor();
	void SetDragFrameForeColor(unsigned long newValue);
	unsigned long GetTabNumberBackColor();
	void SetTabNumberBackColor(unsigned long newValue);
	unsigned long GetTabNumberForeColor();
	void SetTabNumberForeColor(unsigned long newValue);
	void SendToBack();
	void BringToFront();
	CFormEditorItemDetails GetItemDetails(LPDISPATCH pDisp);
	void GetItemPosition(LPDISPATCH pDisp, long* pLeft, long* pTop, long* pWidth, long* pHeight, long* pTabNumber);
	void SetItemPosition(LPDISPATCH pDisp, long Left, long Top, long Width, long Height, long TabNumber);
	CFormEditorItemCollection GetItems();
	CFormEditorItemCollection GetSelectedItems();
};

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

#endif // !defined(AFX_FORMEDITOR_H__A091E95A_B0E7_411A_8EB2_48FFD201651D__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