1 #if !defined(AFX_RESIZABLEPAGE_H__INCLUDED_)
2 #define AFX_RESIZABLEPAGE_H__INCLUDED_
6 #endif // _MSC_VER > 1000
8 // ResizablePage.h : header file
10 /////////////////////////////////////////////////////////////////////////////
12 // Copyright (C) 2000 by Paolo Messina
13 // (ppescher@yahoo.com)
15 // Free for non-commercial use.
16 // You may change the code to your needs,
17 // provided that credits to the original
18 // author is given in the modified files.
20 /////////////////////////////////////////////////////////////////////////////
22 // useful compatibility constants (the only one required is NOANCHOR)
24 #if !defined(__SIZE_ANCHORS_)
25 #define __SIZE_ANCHORS_
29 TOP_LEFT(0,0), TOP_CENTER(50,0), TOP_RIGHT(100,0),
30 MIDDLE_LEFT(0,50), MIDDLE_CENTER(50,50), MIDDLE_RIGHT(100,50),
31 BOTTOM_LEFT(0,100), BOTTOM_CENTER(50,100), BOTTOM_RIGHT(100,100);
33 #endif // !defined(__SIZE_ANCHORS_)
35 /////////////////////////////////////////////////////////////////////////////
36 // CResizablePage window
38 class CResizablePage
: public CPropertyPage
40 DECLARE_DYNCREATE(CResizablePage
)
45 CResizablePage(UINT nIDTemplate
, UINT nIDCaption
= 0);
46 CResizablePage(LPCTSTR lpszTemplateName
, UINT nIDCaption
= 0);
53 CString m_sSection
; // section name and
54 CString m_sEntry
; // entry for save/restore
56 BOOL m_bInitDone
; // if all internal vars initialized
58 CPtrList m_plLayoutList
; // list of repositionable controls
72 // bottom-right corner
77 Layout(HWND hw
, SIZE tl_t
, SIZE tl_m
,
78 SIZE br_t
, SIZE br_m
, BOOL hscroll
, BOOL refresh
)
82 adj_hscroll
= hscroll
;
83 need_refresh
= refresh
;
97 // ClassWizard generated virtual function overrides
98 //{{AFX_VIRTUAL(CResizablePage)
103 virtual ~CResizablePage();
108 void ArrangeLayout();
110 // callable from derived classes
112 void AddAnchor(HWND wnd
, CSize tl_type
,
113 CSize br_type
= NOANCHOR
); // add anchors to a control
114 void AddAnchor(UINT ctrl_ID
, CSize tl_type
,
115 CSize br_type
= NOANCHOR
) // add anchors to a control
117 AddAnchor(::GetDlgItem(*this, ctrl_ID
), tl_type
, br_type
);
120 // Generated message map functions
122 //{{AFX_MSG(CResizablePage)
123 virtual BOOL
OnInitDialog();
124 afx_msg
void OnSize(UINT nType
, int cx
, int cy
);
126 DECLARE_MESSAGE_MAP()
129 /////////////////////////////////////////////////////////////////////////////
131 //{{AFX_INSERT_LOCATION}}
132 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
134 #endif // !defined(AFX_RESIZABLEPAGE_H__INCLUDED_)