OSDN Git Service

fix some build error
[tortoisegit/TortoiseGitJp.git] / src / TortoiseMerge / Settings.cpp
1 // TortoiseMerge - a Diff/Patch program\r
2 \r
3 // Copyright (C) 2006 - Stefan Kueng\r
4 \r
5 // This program is free software; you can redistribute it and/or\r
6 // modify it under the terms of the GNU General Public License\r
7 // as published by the Free Software Foundation; either version 2\r
8 // of the License, or (at your option) any later version.\r
9 \r
10 // This program is distributed in the hope that it will be useful,\r
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of\r
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
13 // GNU General Public License for more details.\r
14 \r
15 // You should have received a copy of the GNU General Public License\r
16 // along with this program; if not, write to the Free Software Foundation,\r
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.\r
18 //\r
19 #include "stdafx.h"\r
20 #include "Settings.h"\r
21 #include "SetMainPage.h"\r
22 #include "SetColorPage.h"\r
23 \r
24 IMPLEMENT_DYNAMIC(CSettings, CPropertySheet)\r
25 CSettings::CSettings(UINT nIDCaption, CWnd* pParentWnd, UINT iSelectPage)\r
26         :CPropertySheet(nIDCaption, pParentWnd, iSelectPage)\r
27 {\r
28 }\r
29 \r
30 CSettings::CSettings(LPCTSTR pszCaption, CWnd* pParentWnd, UINT iSelectPage)\r
31         :CPropertySheet(pszCaption, pParentWnd, iSelectPage)\r
32 {\r
33         AddPropPages();\r
34 }\r
35 \r
36 CSettings::~CSettings()\r
37 {\r
38         RemovePropPages();\r
39 }\r
40 \r
41 void CSettings::AddPropPages()\r
42 {\r
43         m_pMainPage = new CSetMainPage();\r
44         m_pColorPage = new CSetColorPage();\r
45 \r
46         AddPage(m_pMainPage);\r
47         AddPage(m_pColorPage);\r
48 }\r
49 \r
50 void CSettings::RemovePropPages()\r
51 {\r
52         delete m_pMainPage;\r
53         delete m_pColorPage;\r
54 }\r
55 \r
56 void CSettings::SaveData()\r
57 {\r
58         m_pMainPage->SaveData();\r
59         m_pColorPage->SaveData();\r
60 }\r
61 \r
62 BOOL CSettings::IsReloadNeeded() const\r
63 {\r
64         BOOL bReload = FALSE;\r
65         bReload = (m_pMainPage->m_bReloadNeeded || bReload);\r
66         bReload = (m_pColorPage->m_bReloadNeeded || bReload);\r
67         return bReload;\r
68 }\r
69 \r
70 BEGIN_MESSAGE_MAP(CSettings, CPropertySheet)\r
71 END_MESSAGE_MAP()\r
72 \r
73 \r
74 // CSettings message handlers\r
75 \r
76 BOOL CSettings::OnInitDialog()\r
77 {\r
78         BOOL bResult = CPropertySheet::OnInitDialog();\r
79         return bResult;\r
80 }\r