1 // ResizablePage.cpp : implementation file
\r
3 /////////////////////////////////////////////////////////////////////////////
\r
5 // This file is part of ResizableLib
\r
6 // http://sourceforge.net/projects/resizablelib
\r
8 // Copyright (C) 2000-2004 by Paolo Messina
\r
9 // http://www.geocities.com/ppescher - mailto:ppescher@hotmail.com
\r
11 // The contents of this file are subject to the Artistic License (the "License").
\r
12 // You may not use this file except in compliance with the License.
\r
13 // You may obtain a copy of the License at:
\r
14 // http://www.opensource.org/licenses/artistic-license.html
\r
16 // If you find this code useful, credits would be nice!
\r
18 /////////////////////////////////////////////////////////////////////////////
\r
21 #include "ResizablePage.h"
\r
24 #define new DEBUG_NEW
\r
26 static char THIS_FILE[] = __FILE__;
\r
29 /////////////////////////////////////////////////////////////////////////////
\r
32 IMPLEMENT_DYNCREATE(CResizablePage, CPropertyPage)
\r
34 CResizablePage::CResizablePage()
\r
38 CResizablePage::CResizablePage(UINT nIDTemplate, UINT nIDCaption)
\r
39 : CPropertyPage(nIDTemplate, nIDCaption)
\r
43 CResizablePage::CResizablePage(LPCTSTR lpszTemplateName, UINT nIDCaption)
\r
44 : CPropertyPage(lpszTemplateName, nIDCaption)
\r
48 CResizablePage::~CResizablePage()
\r
53 BEGIN_MESSAGE_MAP(CResizablePage, CPropertyPage)
\r
54 //{{AFX_MSG_MAP(CResizablePage)
\r
57 ON_WM_GETMINMAXINFO()
\r
63 /////////////////////////////////////////////////////////////////////////////
\r
64 // CResizablePage message handlers
\r
66 void CResizablePage::OnSize(UINT nType, int cx, int cy)
\r
68 CWnd::OnSize(nType, cx, cy);
\r
73 BOOL CResizablePage::OnEraseBkgnd(CDC* pDC)
\r
75 ClipChildren(pDC, FALSE);
\r
77 BOOL bRet = CPropertyPage::OnEraseBkgnd(pDC);
\r
79 ClipChildren(pDC, TRUE);
\r
84 void CResizablePage::OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI)
\r
89 BOOL CResizablePage::OnInitDialog()
\r
91 CPropertyPage::OnInitDialog();
\r
93 // set the initial size as the min track size
\r
96 SetMinTrackSize(rc.Size());
\r
98 return TRUE; // return TRUE unless you set the focus to a control
\r
99 // EXCEPTION: OCX Property Pages should return FALSE
\r
102 void CResizablePage::OnDestroy()
\r
104 // remove child windows
\r
105 RemoveAllAnchors();
\r
107 CPropertyPage::OnDestroy();
\r
110 LRESULT CResizablePage::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
\r
112 if (message != WM_NCCALCSIZE || wParam == 0)
\r
113 return CPropertyPage::WindowProc(message, wParam, lParam);
\r
115 LRESULT lResult = 0;
\r
116 HandleNcCalcSize(FALSE, (LPNCCALCSIZE_PARAMS)lParam, lResult);
\r
117 lResult = CPropertyPage::WindowProc(message, wParam, lParam);
\r
118 HandleNcCalcSize(TRUE, (LPNCCALCSIZE_PARAMS)lParam, lResult);
\r