summaryrefslogtreecommitdiff
path: root/src/msvc6/testrunner/DynamicWindow/cdxCDynamicDialog.h
blob: d8883136c4019a299069782052e9fd9919254978 (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
#if !defined(AFX_CDXCDYNAMICDIALOG_H__E8F2A005_63C6_11D3_802B_000000000000__INCLUDED_)
#define AFX_CDXCDYNAMICDIALOG_H__E8F2A005_63C6_11D3_802B_000000000000__INCLUDED_

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

#include	"cdxCDynamicWndEx.h"

/*
 * cdxCDynamicDialog
 * =================
 * 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
 */

class cdxCDynamicDialog : public CDialog, public cdxCDynamicWndEx
{
	DECLARE_DYNAMIC(cdxCDynamicDialog);

public:
	enum { flDefault = flAntiFlicker|flSizeIcon };

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

public:
	virtual BOOL DestroyWindow();

protected:
	virtual BOOL OnInitDialog();
	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);

	DECLARE_MESSAGE_MAP();
};

/*
 * cdxCDynamicChildDlg
 * ===================
 * Use this dialog class instead of cdxCDynamicDialog 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 cdxCDynamicChildDlg : public cdxCDynamicDialog
{
	DECLARE_DYNAMIC(cdxCDynamicChildDlg);

public:
	enum { flDefault = flAntiFlicker };

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

/////////////////////////////////////////////////////////////////////////////
// cdxCDynamicDialog Inlines
/////////////////////////////////////////////////////////////////////////////

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

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

/////////////////////////////////////////////////////////////////////////////
// cdxCDynamicChildDlg Inlines
/////////////////////////////////////////////////////////////////////////////

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

inline cdxCDynamicChildDlg::cdxCDynamicChildDlg(LPCTSTR lpszTemplateName, CWnd* pParent, Freedom fd, UINT nFlags)
:	cdxCDynamicDialog(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_CDXCDYNAMICDIALOG_H__E8F2A005_63C6_11D3_802B_000000000000__INCLUDED_)