]> git.saurik.com Git - apple/mdnsresponder.git/blob - Clients/PrinterSetupWizard/FirstPage.cpp
8d4b881ff65f4cc1c93cd19b0b26d54d6f625252
[apple/mdnsresponder.git] / Clients / PrinterSetupWizard / FirstPage.cpp
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 Change History (most recent first):
18
19 $Log: FirstPage.cpp,v $
20 Revision 1.6 2006/08/14 23:24:09 cheshire
21 Re-licensed mDNSResponder daemon source code under Apache License, Version 2.0
22
23 Revision 1.5 2005/07/07 17:53:20 shersche
24 Fix problems associated with the CUPS printer workaround fix.
25
26 Revision 1.4 2005/03/16 01:41:29 shersche
27 <rdar://problem/3989644> Remove info icon from first page
28
29 Revision 1.3 2005/01/25 08:58:08 shersche
30 <rdar://problem/3911084> Load icons at run-time from resource DLLs
31 Bug #: 3911084
32
33 Revision 1.2 2004/07/13 20:15:04 shersche
34 <rdar://problem/3726363> Load large font name from resource
35 Bug #: 3726363
36
37 Revision 1.1 2004/06/18 04:36:57 rpantos
38 First checked in
39
40
41 */
42
43 #include "stdafx.h"
44 #include "PrinterSetupWizardApp.h"
45 #include "PrinterSetupWizardSheet.h"
46 #include "FirstPage.h"
47
48 #include <DebugServices.h>
49
50
51 // CFirstPage dialog
52
53 IMPLEMENT_DYNAMIC(CFirstPage, CPropertyPage)
54 CFirstPage::CFirstPage()
55 : CPropertyPage(CFirstPage::IDD)
56 {
57 CString fontName;
58
59 m_psp.dwFlags &= ~(PSP_HASHELP);
60 m_psp.dwFlags |= PSP_DEFAULT|PSP_HIDEHEADER;
61
62 fontName.LoadString(IDS_LARGE_FONT);
63
64 // create the large font
65 m_largeFont.CreateFont(-16, 0, 0, 0,
66 FW_BOLD, FALSE, FALSE, 0, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS,
67 CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH, fontName);
68 }
69
70 CFirstPage::~CFirstPage()
71 {
72 }
73
74 void CFirstPage::DoDataExchange(CDataExchange* pDX)
75 {
76 CPropertyPage::DoDataExchange(pDX);
77 DDX_Control(pDX, IDC_GREETING, m_greeting);
78 }
79
80
81 BOOL
82 CFirstPage::OnSetActive()
83 {
84 CPrinterSetupWizardSheet * psheet;
85 CString greetingText;
86
87 psheet = reinterpret_cast<CPrinterSetupWizardSheet*>(GetParent());
88 require_quiet( psheet, exit );
89
90 psheet->SetWizardButtons(PSWIZB_NEXT);
91
92 m_greeting.SetFont(&m_largeFont);
93
94 greetingText.LoadString(IDS_GREETING);
95 m_greeting.SetWindowText(greetingText);
96
97 exit:
98
99 return CPropertyPage::OnSetActive();
100 }
101
102
103 BOOL
104 CFirstPage::OnKillActive()
105 {
106 CPrinterSetupWizardSheet * psheet;
107
108 psheet = reinterpret_cast<CPrinterSetupWizardSheet*>(GetParent());
109 require_quiet( psheet, exit );
110
111 psheet->SetLastPage(this);
112
113 exit:
114
115 return CPropertyPage::OnKillActive();
116 }
117
118
119 BEGIN_MESSAGE_MAP(CFirstPage, CPropertyPage)
120 END_MESSAGE_MAP()
121
122
123 // CFirstPage message handlers