forked from sabrogden/Ditto
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathOptionsSheet.cpp
139 lines (112 loc) · 3.2 KB
/
OptionsSheet.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
// OptionsSheet.cpp : implementation file
//
#include "stdafx.h"
#include "CP_Main.h"
#include "OptionsSheet.h"
#include "OptionsKeyBoard.h"
#include "OptionsGeneral.h"
#include "OptionsQuickPaste.h"
#include "OptionsStats.h"
#include "OptionsTypes.h"
#include "About.h"
#include "OptionFriends.h"
#include "OptionsCopyBuffers.h"
#include "Misc.h"
#include "QuickPasteKeyboard.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// COptionsSheet
IMPLEMENT_DYNAMIC(COptionsSheet, CPropertySheet)
COptionsSheet::COptionsSheet(LPCTSTR pszCaption, CWnd* pParentWnd, UINT iSelectPage)
:CPropertySheet(pszCaption, pParentWnd, iSelectPage)
{
m_themeChanged = FALSE;
m_pKeyBoardOptions = NULL;
m_pGeneralOptions = NULL;
//m_pQuickPasteOptions = NULL;
m_pCopyBuffers = NULL;
m_pStats = NULL;
m_pTypes = NULL;
m_pAbout = NULL;
m_pFriends = NULL;
m_pCopyBuffers = NULL;
m_pQuickPasteShortCuts = NULL;
m_pUtilites = NULL;
m_hWndParent = NULL;
EnableStackedTabs(TRUE);
m_pGeneralOptions = new COptionsGeneral;
m_pKeyBoardOptions = new COptionsKeyBoard;
//m_pQuickPasteOptions = new COptionsQuickPaste;
m_pQuickPasteShortCuts = new CQuickPasteKeyboard;
m_pCopyBuffers = new COptionsCopyBuffers;
m_pStats = new COptionsStats;
m_pTypes = new COptionsTypes;
m_pAbout = new CAbout;
AddPage(m_pGeneralOptions);
AddPage(m_pTypes);
AddPage(m_pKeyBoardOptions);
AddPage(m_pCopyBuffers);
//AddPage(m_pQuickPasteOptions);
AddPage(m_pQuickPasteShortCuts);
if(g_Opt.GetAllowFriends())
{
m_pFriends = new COptionFriends;
AddPage(m_pFriends);
}
AddPage(m_pStats);
AddPage(m_pAbout);
}
COptionsSheet::~COptionsSheet()
{
delete m_pGeneralOptions;
delete m_pKeyBoardOptions;
//delete m_pQuickPasteOptions;
delete m_pCopyBuffers;
delete m_pStats;
delete m_pTypes;
delete m_pAbout;
delete m_pFriends;
delete m_pUtilites;
delete m_pQuickPasteShortCuts;
}
BEGIN_MESSAGE_MAP(COptionsSheet, CPropertySheet)
//{{AFX_MSG_MAP(COptionsSheet)
// NOTE - the ClassWizard will add and remove mapping macros here.
ON_WM_DESTROY()
ON_WM_NCDESTROY()
//ON_WM_CLOSE()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// COptionsSheet message handlers
void COptionsSheet::OnDestroy()
{
CPropertySheet::OnDestroy();
}
void COptionsSheet::SetNotifyWnd(HWND hWnd)
{
m_hWndParent = hWnd;
}
BOOL COptionsSheet::OnInitDialog()
{
m_bModeless = FALSE;
m_nFlags |= WF_CONTINUEMODAL;
HICON b = (HICON)LoadImage(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDR_MAINFRAME), IMAGE_ICON, 64, 64, LR_SHARED);
SetIcon(b, TRUE);
BOOL bResult = CPropertySheet::OnInitDialog();
SetWindowText(_T("Options"));
theApp.m_Language.UpdateOptionsSheet(this);
::ShowWindow(::GetDlgItem(m_hWnd, ID_APPLY_NOW), SW_HIDE);
m_bModeless = TRUE;
m_nFlags &= ~WF_CONTINUEMODAL;
return bResult;
}
void COptionsSheet::OnNcDestroy()
{
CPropertySheet::OnNcDestroy();
::PostMessage(m_hWndParent, WM_OPTIONS_CLOSED, m_themeChanged, 0);
}