summaryrefslogtreecommitdiff
path: root/src/msvc6/testrunner/DynamicWindow/cdxCDynamicPropSheet.h
blob: 73ea35080da9f4931c88aca67de031606931d7cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
#if !defined(AFX_CDXCDYNAMICPROPSHEET_H__82427297_6456_11D3_802D_000000000000__INCLUDED_)
#define AFX_CDXCDYNAMICPROPSHEET_H__82427297_6456_11D3_802D_000000000000__INCLUDED_

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

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

class cdxCDynamicPropPage;

/*
 * cdxCDynamicPropSheet
 * ====================
 * Dynamic property sheet.
 */

class cdxCDynamicPropSheet : public CPropertySheet, public cdxCDynamicWndEx
{
	DECLARE_DYNCREATE(cdxCDynamicPropSheet);

	enum { flDefault = flAntiFlicker|flSizeIcon|flSWPCopyBits };

	friend class cdxCDynamicPropPage;

private:
	Position	m_PagePos;
	bool		m_bHasPos;

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

	// ops
public:
	virtual void AddPage( cdxCDynamicPropPage & rPage );
	virtual void RemovePage( cdxCDynamicPropPage & rPage );
	void AddPage( cdxCDynamicPropPage *pPage ) { ASSERT(pPage != NULL); AddPage(*pPage); }
	void RemovePage( cdxCDynamicPropPage *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(cdxCDynamicPropPage & rPage);
	virtual void OnSetActive(cdxCDynamicPropPage & rPage, BOOL bStatus) { if(IsWindow() && IsWizard()) Layout(); }
	virtual void OnKillActive(cdxCDynamicPropPage & rPage, BOOL bStatus) {}

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

// Implementation
public:

	// Generated message map functions
protected:
	//{{AFX_MSG(cdxCDynamicPropSheet)
	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();
};

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

class cdxCDynamicPropPage : public CPropertyPage, public cdxCDynamicWnd
{
	DECLARE_DYNCREATE(cdxCDynamicPropPage)

	friend class cdxCDynamicPropSheet;

	enum { flDefault = flAntiFlicker };

private:
	cdxCDynamicPropSheet	*m_pSheet;
	bool						m_bFirstHit;

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

	cdxCDynamicPropSheet *GetSheet() const { return m_pSheet; }

// Dialog Data
	//{{AFX_DATA(cdxCDynamicPropPage)
		// 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(cdxCDynamicPropPage)
	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(cdxCDynamicPropPage)
	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 cdxCDynamicPropSheet::cdxCDynamicPropSheet(Freedom fd, UINT nFlags)
:	cdxCDynamicWndEx(fd,nFlags),
	m_bHasPos(false)
{
}

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

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

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

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

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

inline cdxCDynamicPropSheet::cdxCDynamicPropSheet(LPCTSTR lpszSheetAutoPosID, LPCTSTR pszCaption, CWnd* pParentWnd, UINT iSelectPage, Freedom fd, UINT nFlags)
:	CPropertySheet(pszCaption,pParentWnd,iSelectPage),
	cdxCDynamicWndEx(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_CDXCDYNAMICPROPSHEET_H__82427297_6456_11D3_802D_000000000000__INCLUDED_)