⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dynamicdialog.h

📁 枚举主机网络设备
💻 H
字号:
#if !defined(AFX_CDYNAMICDIALOG_H__E8F2A005_63C6_11D3_802B_000000000000__INCLUDED_)
#define AFX_CDYNAMICDIALOG_H__E8F2A005_63C6_11D3_802B_000000000000__INCLUDED_

#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
// CDynamicDialog.h : header file
//

#include	"DynamicWndEx.h"

/*
 * CDynamicDialog
 * =================
 * A new resizable dialog.
 * This should be the base-class for your normal dialogs.
 * This class supports:
 * - A sizing icon
 * - AutoPositioning (stores last position automatically and stuff)
 * - Anti-Flickering system.
 * - And of course, it provides
 *   the Dynamic child control system DcCS by codex design
 */
#include "dib256.h"

class AFX_EXT_CLASS CDynamicDialog : public CDialog, public CDynamicWndEx
{
	DECLARE_DYNAMIC(CDynamicDialog);

public:
	enum { flDefault = flAntiFlicker|flSizeIcon };

public:
	CDynamicDialog(UINT idd = 0, CWnd* pParent = NULL, Freedom fd = fdAll, UINT nFlags = flDefault);
	CDynamicDialog(LPCTSTR lpszTemplateName, CWnd* pParent = NULL, Freedom fd = fdAll, UINT nFlags = flDefault);
	virtual ~CDynamicDialog() { DoOnDestroy(); }

	enum {
		BITMAP_TILE = 0,		// tile the bitmap to fill the dialog
		BITMAP_STRETCH,			// stretch the bitmap so it fits to the dialog
		BITMAP_CENTER			// center the bitmap inside the dialog
	};
public:
	BOOL	SetBitmap(UINT uResource, int Type = CDynamicDialog::BITMAP_TILE);
	BOOL	SetBitmap(HINSTANCE hResourceInstance,CString strResource, int Type = CDynamicDialog::BITMAP_TILE);
protected:
	CDIBitmap	m_bmpBackground;
	int			m_nType;		// see enum above
	CBrush		m_HollowBrush;
	CBrush		m_brEditBrush;
private:
	void	CommonConstruct();

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CDynamicDialog)
	public:
		virtual BOOL DestroyWindow();
	protected:
		virtual BOOL OnInitDialog();
	//}}AFX_VIRTUAL

protected:
	// Generated message map functions
	//{{AFX_MSG(CDynamicDialog)
	afx_msg void OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI);
	afx_msg void OnDestroy();
	afx_msg void OnParentNotify(UINT message, LPARAM lParam);
	afx_msg void OnSize(UINT nType, int cx, int cy);
	afx_msg void OnSizing(UINT fwSide, LPRECT pRect);
	afx_msg void OnTimer(UINT nIDEvent);
	afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
	afx_msg BOOL OnEraseBkgnd(CDC* pDC);
	afx_msg void OnPaletteChanged(CWnd* pFocusWnd);
	afx_msg BOOL OnQueryNewPalette();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP();
};

/*
 * CDynamicChildDlg
 * ===================
 * Use this dialog class instead of CDynamicDialog if
 * you create dialogs which you want to embedd as child
 * controls.
 * In that case, this dialog is far more straight forward.
 * This class provides:
 * - NO sizing icon
 * - NO auto anti-flickering (since the dialog itself won't be moved by hand)
 * - NO auto-positioning
 * - But of course, it provides
 *   the Dynamic child control system DcCS by codex design
 */

class AFX_EXT_CLASS CDynamicChildDlg : public CDynamicDialog
{
	DECLARE_DYNAMIC(CDynamicChildDlg);

public:
	enum	{ flDefault = flAntiFlicker };

public:
	CDynamicChildDlg(UINT idd = 0, CWnd* pParent = NULL, Freedom fd = fdAll, UINT nFlags = flDefault);
	CDynamicChildDlg(LPCTSTR lpszTemplateName, CWnd* pParent = NULL, Freedom fd = fdAll, UINT nFlags = flDefault);
	virtual ~CDynamicChildDlg() { DoOnDestroy(); }
};

/////////////////////////////////////////////////////////////////////////////
// CDynamicDialog Inlines
/////////////////////////////////////////////////////////////////////////////

inline CDynamicDialog::CDynamicDialog(UINT idd, CWnd* pParent, Freedom fd, UINT nFlags)
:	CDialog(idd,pParent),
	CDynamicWndEx(fd,nFlags)
{
	if(idd)
		ActivateAutoPos(idd);
}

inline CDynamicDialog::CDynamicDialog(LPCTSTR lpszTemplateName, CWnd* pParent, Freedom fd, UINT nFlags)
:	CDialog(lpszTemplateName,pParent),
	CDynamicWndEx(fd,nFlags)
{
	if(lpszTemplateName && *lpszTemplateName)
		ActivateAutoPos(lpszTemplateName);
}

/////////////////////////////////////////////////////////////////////////////
// CDynamicChildDlg Inlines
/////////////////////////////////////////////////////////////////////////////

inline CDynamicChildDlg::CDynamicChildDlg(UINT idd, CWnd* pParent, Freedom fd, UINT nFlags)
:	CDynamicDialog(idd,pParent,fd,nFlags)
{
	m_bUseScrollPos	=	true;		// if you create scollbars I will use them ;)
	NoAutoPos();						// not in this case....
}

inline CDynamicChildDlg::CDynamicChildDlg(LPCTSTR lpszTemplateName, CWnd* pParent, Freedom fd, UINT nFlags)
:	CDynamicDialog(lpszTemplateName,pParent,fd,nFlags)
{
	m_bUseScrollPos	=	true;		// if you create scollbars I will use them ;)
	NoAutoPos();						// not in this case....
}

//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_CDYNAMICDIALOG_H__E8F2A005_63C6_11D3_802B_000000000000__INCLUDED_)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -