]> git.saurik.com Git - apple/mdnsresponder.git/blob - Clients/PrinterSetupWizard/FirstPage.cpp
mDNSResponder-108.2.tar.gz
[apple/mdnsresponder.git] / Clients / PrinterSetupWizard / FirstPage.cpp
1 /*
2 * Copyright (c) 1997-2004 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22
23 Change History (most recent first):
24
25 $Log: FirstPage.cpp,v $
26 Revision 1.5 2005/07/07 17:53:20 shersche
27 Fix problems associated with the CUPS printer workaround fix.
28
29 Revision 1.4 2005/03/16 01:41:29 shersche
30 <rdar://problem/3989644> Remove info icon from first page
31
32 Revision 1.3 2005/01/25 08:58:08 shersche
33 <rdar://problem/3911084> Load icons at run-time from resource DLLs
34 Bug #: 3911084
35
36 Revision 1.2 2004/07/13 20:15:04 shersche
37 <rdar://problem/3726363> Load large font name from resource
38 Bug #: 3726363
39
40 Revision 1.1 2004/06/18 04:36:57 rpantos
41 First checked in
42
43
44 */
45
46 #include "stdafx.h"
47 #include "PrinterSetupWizardApp.h"
48 #include "PrinterSetupWizardSheet.h"
49 #include "FirstPage.h"
50
51 #include <DebugServices.h>
52
53
54 // CFirstPage dialog
55
56 IMPLEMENT_DYNAMIC(CFirstPage, CPropertyPage)
57 CFirstPage::CFirstPage()
58 : CPropertyPage(CFirstPage::IDD)
59 {
60 CString fontName;
61
62 m_psp.dwFlags &= ~(PSP_HASHELP);
63 m_psp.dwFlags |= PSP_DEFAULT|PSP_HIDEHEADER;
64
65 fontName.LoadString(IDS_LARGE_FONT);
66
67 // create the large font
68 m_largeFont.CreateFont(-16, 0, 0, 0,
69 FW_BOLD, FALSE, FALSE, 0, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS,
70 CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH, fontName);
71 }
72
73 CFirstPage::~CFirstPage()
74 {
75 }
76
77 void CFirstPage::DoDataExchange(CDataExchange* pDX)
78 {
79 CPropertyPage::DoDataExchange(pDX);
80 DDX_Control(pDX, IDC_GREETING, m_greeting);
81 }
82
83
84 BOOL
85 CFirstPage::OnSetActive()
86 {
87 CPrinterSetupWizardSheet * psheet;
88 CString greetingText;
89
90 psheet = reinterpret_cast<CPrinterSetupWizardSheet*>(GetParent());
91 require_quiet( psheet, exit );
92
93 psheet->SetWizardButtons(PSWIZB_NEXT);
94
95 m_greeting.SetFont(&m_largeFont);
96
97 greetingText.LoadString(IDS_GREETING);
98 m_greeting.SetWindowText(greetingText);
99
100 exit:
101
102 return CPropertyPage::OnSetActive();
103 }
104
105
106 BOOL
107 CFirstPage::OnKillActive()
108 {
109 CPrinterSetupWizardSheet * psheet;
110
111 psheet = reinterpret_cast<CPrinterSetupWizardSheet*>(GetParent());
112 require_quiet( psheet, exit );
113
114 psheet->SetLastPage(this);
115
116 exit:
117
118 return CPropertyPage::OnKillActive();
119 }
120
121
122 BEGIN_MESSAGE_MAP(CFirstPage, CPropertyPage)
123 END_MESSAGE_MAP()
124
125
126 // CFirstPage message handlers