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

📄 dynamicpropsheet.h

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

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

#include	"DynamicWndEx.h"
#pragma warning(disable: 4100)

class CDynamicPropPage;

/*
 * CDynamicPropSheet
 * ====================
 * Dynamic property sheet.
 */

class AFX_EXT_CLASS CDynamicPropSheet : public CPropertySheet, public CDynamicWndEx
{
	DECLARE_DYNCREATE(CDynamicPropSheet);

	enum { flDefault = flAntiFlicker|flSizeIcon|flSWPCopyBits };

	friend class CDynamicPropPage;

private:
	Position	m_PagePos;
	bool		m_bHasPos;

public:
	CDynamicPropSheet(Freedom fd = fdAll, UINT nFlags = flDefault);
	CDynamicPropSheet(UINT nIDCaption, CWnd* pParentWnd = NULL, UINT iSelectPage = 0, Freedom fd = fdAll, UINT nFlags = flDefault);
	CDynamicPropSheet(LPCTSTR pszCaption, CWnd* pParentWnd = NULL, UINT iSelectPage = 0, Freedom fd = fdAll, UINT nFlags = flDefault);
	CDynamicPropSheet(UINT sheetAutoPosID, UINT nIDCaption, CWnd* pParentWnd = NULL, UINT iSelectPage = 0, Freedom fd = fdAll, UINT nFlags = flDefault);
	CDynamicPropSheet(UINT sheetAutoPosID, LPCTSTR pszCaption, CWnd* pParentWnd = NULL, UINT iSelectPage = 0, Freedom fd = fdAll, UINT nFlags = flDefault);
	CDynamicPropSheet(LPCTSTR lpszSheetAutoPosID, UINT nIDCaption, CWnd* pParentWnd = NULL, UINT iSelectPage = 0, Freedom fd = fdAll, UINT nFlags = flDefault);
	CDynamicPropSheet(LPCTSTR lpszSheetAutoPosID, LPCTSTR pszCaption, CWnd* pParentWnd = NULL, UINT iSelectPage = 0, Freedom fd = fdAll, UINT nFlags = flDefault);
	virtual ~CDynamicPropSheet() { DoOnDestroy(); }

	// ops
public:
	virtual void AddPage( CDynamicPropPage & rPage );
	virtual void RemovePage( CDynamicPropPage & rPage );
	void AddPage( CDynamicPropPage *pPage ) { ASSERT(pPage != NULL); AddPage(*pPage); }
	void RemovePage( CDynamicPropPage *pPage ) { ASSERT(pPage != NULL); RemovePage(*pPage); }
	void RemovePage( int nPage );

	BOOL IsWizard() const { return (m_psh.dwFlags & PSH_WIZARD) != 0; }

	// events
protected:
	virtual void OnInitPage(CDynamicPropPage & rPage);
	virtual void OnSetActive(CDynamicPropPage & rPage, BOOL bStatus) { if(IsWindow() && IsWizard()) Layout(); }
	virtual void OnKillActive(CDynamicPropPage & rPage, BOOL bStatus) {}

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

// Implementation
public:

	// Generated message map functions
protected:
	//{{AFX_MSG(CDynamicPropSheet)
	virtual BOOL OnInitDialog();
	afx_msg void OnClose();
	afx_msg void OnDestroy();
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	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 void OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI);
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP();
	DECLARE_DYNAMIC_MAP();
};

/*
 * CDynamicPropPage
 * ===================
 * The page for our sheet.
 */

class AFX_EXT_CLASS CDynamicPropPage : public CPropertyPage, public CDynamicWnd
{
	DECLARE_DYNCREATE(CDynamicPropPage)

	friend class CDynamicPropSheet;

	enum { flDefault = flAntiFlicker };

private:
	CDynamicPropSheet	*m_pSheet;
	bool						m_bFirstHit;

public:
	CDynamicPropPage() : CDynamicWnd(fdAll,flDefault), m_pSheet(NULL), m_bFirstHit(false) {}
	CDynamicPropPage(UINT nID, UINT nIDCaption = 0) : CPropertyPage(nID,nIDCaption), CDynamicWnd(fdAll,flDefault), m_pSheet(NULL), m_bFirstHit(false) {}
	CDynamicPropPage(LPCTSTR lpszID, UINT nIDCaption = 0) : CPropertyPage(lpszID,nIDCaption), CDynamicWnd(fdAll,flDefault), m_pSheet(NULL), m_bFirstHit(false) {}
	virtual ~CDynamicPropPage() { DoOnDestroy(); }

	CDynamicPropSheet *GetSheet() const { return m_pSheet; }

// Dialog Data
	//{{AFX_DATA(CDynamicPropPage)
		// NOTE - ClassWizard will add data members here.
		//    DO NOT EDIT what you see in these blocks of generated code !
	//}}AFX_DATA


// Overrides
	// ClassWizard generate virtual function overrides
	//{{AFX_VIRTUAL(CDynamicPropPage)
	public:
	virtual BOOL OnSetActive();
	virtual BOOL OnKillActive();
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:
	// Generated message map functions
	//{{AFX_MSG(CDynamicPropPage)
	afx_msg void OnSize(UINT nType, int cx, int cy);
	afx_msg void OnTimer(UINT nIDEvent);
	virtual BOOL OnInitDialog();
	afx_msg void OnDestroy();
	afx_msg void OnSizing(UINT fwSide, LPRECT pRect);
	afx_msg void OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI);
	afx_msg void OnParentNotify(UINT message, LPARAM lParam);
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()

};

//////////////////////////////////////////////////////////////////////
// inlines
//////////////////////////////////////////////////////////////////////

inline CDynamicPropSheet::CDynamicPropSheet(Freedom fd, UINT nFlags)
:	CDynamicWndEx(fd,nFlags),
	m_bHasPos(false)
{
}

inline CDynamicPropSheet::CDynamicPropSheet(UINT nIDCaption, CWnd* pParentWnd, UINT iSelectPage, Freedom fd, UINT nFlags)
:	CPropertySheet(nIDCaption,pParentWnd,iSelectPage),
	CDynamicWndEx(fd,nFlags),
	m_bHasPos(false)
{
}

inline CDynamicPropSheet::CDynamicPropSheet(LPCTSTR pszCaption, CWnd* pParentWnd, UINT iSelectPage, Freedom fd, UINT nFlags)
:	CPropertySheet(pszCaption,pParentWnd,iSelectPage),
	CDynamicWndEx(fd,nFlags),
	m_bHasPos(false)
{
}

inline CDynamicPropSheet::CDynamicPropSheet(UINT sheetAutoPosID, UINT nIDCaption, CWnd* pParentWnd, UINT iSelectPage, Freedom fd, UINT nFlags)
:	CPropertySheet(nIDCaption,pParentWnd,iSelectPage),
	CDynamicWndEx(fd,nFlags),
	m_bHasPos(false)
{
	if(sheetAutoPosID)
		ActivateAutoPos(sheetAutoPosID);
}

inline CDynamicPropSheet::CDynamicPropSheet(UINT sheetAutoPosID, LPCTSTR pszCaption, CWnd* pParentWnd, UINT iSelectPage, Freedom fd, UINT nFlags)
:	CPropertySheet(pszCaption,pParentWnd,iSelectPage),
	CDynamicWndEx(fd,nFlags),
	m_bHasPos(false)
{
	if(sheetAutoPosID)
		ActivateAutoPos(sheetAutoPosID);
}

inline CDynamicPropSheet::CDynamicPropSheet(LPCTSTR lpszSheetAutoPosID, UINT nIDCaption, CWnd* pParentWnd, UINT iSelectPage, Freedom fd, UINT nFlags)
:	CPropertySheet(nIDCaption,pParentWnd,iSelectPage),
	CDynamicWndEx(fd,nFlags),
	m_bHasPos(false)
{
	if(lpszSheetAutoPosID && *lpszSheetAutoPosID)
		ActivateAutoPos(lpszSheetAutoPosID);
}

inline CDynamicPropSheet::CDynamicPropSheet(LPCTSTR lpszSheetAutoPosID, LPCTSTR pszCaption, CWnd* pParentWnd, UINT iSelectPage, Freedom fd, UINT nFlags)
:	CPropertySheet(pszCaption,pParentWnd,iSelectPage),
	CDynamicWndEx(fd,nFlags),
	m_bHasPos(false)
{
	if(lpszSheetAutoPosID && *lpszSheetAutoPosID)
		ActivateAutoPos(lpszSheetAutoPosID);
}

#pragma warning(default: 4100)

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

#endif // !defined(AFX_CDYNAMICPROPSHEET_H__82427297_6456_11D3_802D_000000000000__INCLUDED_)

⌨️ 快捷键说明

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