-
Notifications
You must be signed in to change notification settings - Fork 0
/
CreationWizard.cpp
executable file
·163 lines (131 loc) · 3.73 KB
/
CreationWizard.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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
// CreationWizard.cpp : implementation file
//
#include "stdafx.h"
#include "resource.h"
#include "CreationWizard.h"
#ifdef _DEBUG
#undef THIS_FILE
static char BASED_CODE THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CCreationWizard
IMPLEMENT_DYNAMIC(CCreationWizard, CPropertySheet)
CCreationWizard::CCreationWizard (NewDocMode mode, CWnd* pWndParent)
: CPropertySheet(IDS_PROPSHT_CAPTION, pWndParent)
{
// Add all of the property pages here. Note that
// the order that they appear in here will be
// the order they appear in on screen. By default,
// the first page of the set is the active one.
// One way to make a different property page the
// active one is to call SetActivePage().
for (int i = 0; i < NUM_RENDER_TYPES; i++)
m_pBackground[i] = NULL;
m_pTracks = NULL;
m_pDataCDInfo = NULL;
m_pStyle = NULL;
m_Page2a.m_nBkImageType = Cover;
m_Page2b.m_nBkImageType = Back;
m_Page2c.m_nBkImageType = Label;
m_Page2d.m_nBkImageType = Inlay;
switch (mode)
{
case AudioCD:
AddPage (&m_Page1);
break;
case DataCD:
AddPage (&m_PageDataCD);
break;
}
AddPage (&m_Page2a);
AddPage (&m_Page2b);
AddPage (&m_Page2c);
AddPage (&m_Page2d);
AddPage (&m_Page3);
SetWizardMode ();
m_psh.dwFlags |= PSH_WIZARDHASFINISH;
//m_psh.dwFlags |= PSH_WIZARD97 | /*PSH_WATERMARK |*/ PSH_HEADER | PSH_WIZARDHASFINISH;
////m_psh.pszbmWatermark = MAKEINTRESOURCE (IDB_WATERMARK);
//m_psh.pszbmHeader = MAKEINTRESOURCE (IDB_BITMAP_AUDIOCD);
//m_psh.hInstance = AfxGetInstanceHandle ();
}
CCreationWizard::~CCreationWizard()
{
}
BEGIN_MESSAGE_MAP(CCreationWizard, CPropertySheet)
//{{AFX_MSG_MAP(CCreationWizard)
// NOTE - the ClassWizard will add and remove mapping macros here.
//}}AFX_MSG_MAP
ON_MESSAGE(WM_COMMANDHELP, OnCommandHelp)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CCreationWizard message handlers
CTracksInfo& CCreationWizard::GetTracksInfo()
{
return *m_pTracks;
}
void CCreationWizard::SetTracksInfo(CTracksInfo &tracks)
{
m_pTracks = &tracks;
m_Page1.SetTracksInfo (tracks);
}
CDataCDInfo& CCreationWizard::GetDataCDInfo ()
{
return *m_pDataCDInfo;
}
void CCreationWizard::SetDataCDInfo (CDataCDInfo& info)
{
m_pDataCDInfo = &info;
m_PageDataCD.SetDataCDInfo (info);
}
CBackgroundInfo& CCreationWizard::GetBackgroundInfo(RenderType rt)
{
return *m_pBackground[rt];
}
CBackgroundInfo** CCreationWizard::GetBackgroundInfo()
{
return m_pBackground;
}
void CCreationWizard::SetBackgroundInfo(CBackgroundInfo &bkgrnd, RenderType rt)
{
m_pBackground[rt] = &bkgrnd;
switch (rt)
{
case Cover:
m_Page2a.SetBackgroundInfo (bkgrnd);
break;
case Back:
m_Page2b.SetBackgroundInfo (bkgrnd);
break;
case Label:
m_Page2c.SetBackgroundInfo (bkgrnd);
break;
case Inlay:
m_Page2d.SetBackgroundInfo (bkgrnd);
break;
}
}
CStyleTemplate& CCreationWizard::GetStyleTemplate()
{
if (m_pStyle == NULL)
return *(new CStyleTemplate ("Azur"));
return *m_pStyle;
}
void CCreationWizard::SetStyleTemplate(CStyleTemplate &style)
{
m_pStyle = &style;
m_Page3.SetStyleTemplate (style);
}
LRESULT CCreationWizard::OnCommandHelp (WPARAM wParam, LPARAM lParam)
{
HtmlHelp (/*AfxGetMainWnd ()->GetSafeHwnd (), AfxGetApp ()->m_pszHelpFilePath,*/
HH_HELP_CONTEXT, HID_CREATIONWIZARD);
return TRUE;
}
BOOL CCreationWizard::PreTranslateMessage (MSG* pMsg)
{
// disable the ESC key on the Creation Wizard
if (pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_ESCAPE)
pMsg->wParam = NULL;
return CPropertySheet::PreTranslateMessage(pMsg);
}