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