OSDN Git Service

Fix build error and show fold icon at submodule directory
[tortoisegit/TortoiseGitJp.git] / ext / ResizableLib / ResizablePage.cpp
1 // ResizablePage.cpp : implementation file\r
2 //\r
3 /////////////////////////////////////////////////////////////////////////////\r
4 //\r
5 // This file is part of ResizableLib\r
6 // http://sourceforge.net/projects/resizablelib\r
7 //\r
8 // Copyright (C) 2000-2004 by Paolo Messina\r
9 // http://www.geocities.com/ppescher - mailto:ppescher@hotmail.com\r
10 //\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
15 //\r
16 // If you find this code useful, credits would be nice!\r
17 //\r
18 /////////////////////////////////////////////////////////////////////////////\r
19 \r
20 #include "stdafx.h"\r
21 #include "ResizablePage.h"\r
22 \r
23 #ifdef _DEBUG\r
24 #define new DEBUG_NEW\r
25 #undef THIS_FILE\r
26 static char THIS_FILE[] = __FILE__;\r
27 #endif\r
28 \r
29 /////////////////////////////////////////////////////////////////////////////\r
30 // CResizablePage\r
31 \r
32 IMPLEMENT_DYNCREATE(CResizablePage, CPropertyPage)\r
33 \r
34 CResizablePage::CResizablePage()\r
35 {\r
36 }\r
37 \r
38 CResizablePage::CResizablePage(UINT nIDTemplate, UINT nIDCaption)\r
39         : CPropertyPage(nIDTemplate, nIDCaption)\r
40 {\r
41 }\r
42 \r
43 CResizablePage::CResizablePage(LPCTSTR lpszTemplateName, UINT nIDCaption)\r
44         : CPropertyPage(lpszTemplateName, nIDCaption)\r
45 {\r
46 }\r
47 \r
48 CResizablePage::~CResizablePage()\r
49 {\r
50 }\r
51 \r
52 \r
53 BEGIN_MESSAGE_MAP(CResizablePage, CPropertyPage)\r
54         //{{AFX_MSG_MAP(CResizablePage)\r
55         ON_WM_SIZE()\r
56         ON_WM_ERASEBKGND()\r
57         ON_WM_GETMINMAXINFO()\r
58         ON_WM_DESTROY()\r
59         //}}AFX_MSG_MAP\r
60 END_MESSAGE_MAP()\r
61 \r
62 \r
63 /////////////////////////////////////////////////////////////////////////////\r
64 // CResizablePage message handlers\r
65 \r
66 void CResizablePage::OnSize(UINT nType, int cx, int cy) \r
67 {\r
68         CWnd::OnSize(nType, cx, cy);\r
69         \r
70         ArrangeLayout();\r
71 }\r
72 \r
73 BOOL CResizablePage::OnEraseBkgnd(CDC* pDC) \r
74 {\r
75         ClipChildren(pDC, FALSE);\r
76 \r
77         BOOL bRet = CPropertyPage::OnEraseBkgnd(pDC);\r
78 \r
79         ClipChildren(pDC, TRUE);\r
80 \r
81         return bRet;\r
82 }\r
83 \r
84 void CResizablePage::OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI) \r
85 {\r
86         MinMaxInfo(lpMMI);\r
87 }\r
88 \r
89 BOOL CResizablePage::OnInitDialog() \r
90 {\r
91         CPropertyPage::OnInitDialog();\r
92         \r
93         // set the initial size as the min track size\r
94         CRect rc;\r
95         GetWindowRect(&rc);\r
96         SetMinTrackSize(rc.Size());\r
97 \r
98         return TRUE;  // return TRUE unless you set the focus to a control\r
99                       // EXCEPTION: OCX Property Pages should return FALSE\r
100 }\r
101 \r
102 void CResizablePage::OnDestroy() \r
103 {\r
104         // remove child windows\r
105         RemoveAllAnchors();\r
106 \r
107         CPropertyPage::OnDestroy();\r
108 }\r
109 \r
110 LRESULT CResizablePage::WindowProc(UINT message, WPARAM wParam, LPARAM lParam) \r
111 {\r
112         if (message != WM_NCCALCSIZE || wParam == 0)\r
113                 return CPropertyPage::WindowProc(message, wParam, lParam);\r
114 \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
119         return lResult;\r
120 }\r