1 /* -*- Mode: C; tab-width: 4 -*-
2  *
3  * Copyright (c) 1997-2004 Apple Computer, Inc. All rights reserved.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  *     http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 #include "stdafx.h"
19 #include "PrinterSetupWizardApp.h"
20 #include "PrinterSetupWizardSheet.h"
21 #include "FirstPage.h"
22 
23 #include <DebugServices.h>
24 
25 
26 // CFirstPage dialog
27 
IMPLEMENT_DYNAMIC(CFirstPage,CPropertyPage)28 IMPLEMENT_DYNAMIC(CFirstPage, CPropertyPage)
29 CFirstPage::CFirstPage()
30 	: CPropertyPage(CFirstPage::IDD)
31 {
32 	CString fontName;
33 
34 	m_psp.dwFlags &= ~(PSP_HASHELP);
35 	m_psp.dwFlags |= PSP_DEFAULT|PSP_HIDEHEADER;
36 
37 	fontName.LoadString(IDS_LARGE_FONT);
38 
39 	// create the large font
40 	m_largeFont.CreateFont(-16, 0, 0, 0,
41 		FW_BOLD, FALSE, FALSE, 0, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS,
42 		CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH, fontName);
43 }
44 
~CFirstPage()45 CFirstPage::~CFirstPage()
46 {
47 }
48 
DoDataExchange(CDataExchange * pDX)49 void CFirstPage::DoDataExchange(CDataExchange* pDX)
50 {
51 	CPropertyPage::DoDataExchange(pDX);
52 	DDX_Control(pDX, IDC_GREETING, m_greeting);
53 }
54 
55 
56 BOOL
OnSetActive()57 CFirstPage::OnSetActive()
58 {
59 	CPrinterSetupWizardSheet * psheet;
60 	CString greetingText;
61 
62 	psheet = reinterpret_cast<CPrinterSetupWizardSheet*>(GetParent());
63 	require_quiet( psheet, exit );
64 
65 	psheet->SetWizardButtons(PSWIZB_NEXT);
66 
67 	m_greeting.SetFont(&m_largeFont);
68 
69 	greetingText.LoadString(IDS_GREETING);
70 	m_greeting.SetWindowText(greetingText);
71 
72 exit:
73 
74 	return CPropertyPage::OnSetActive();
75 }
76 
77 
78 BOOL
OnKillActive()79 CFirstPage::OnKillActive()
80 {
81 	CPrinterSetupWizardSheet * psheet;
82 
83 	psheet = reinterpret_cast<CPrinterSetupWizardSheet*>(GetParent());
84 	require_quiet( psheet, exit );
85 
86 	psheet->SetLastPage(this);
87 
88 exit:
89 
90 	return CPropertyPage::OnKillActive();
91 }
92 
93 
94 BEGIN_MESSAGE_MAP(CFirstPage, CPropertyPage)
95 END_MESSAGE_MAP()
96 
97 
98 // CFirstPage message handlers
99