2 * Copyright (c) 1997-2004 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
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
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.
21 * @APPLE_LICENSE_HEADER_END@
23 Change History (most recent first):
25 $Log: FourthPage.cpp,v $
26 Revision 1.7 2005/07/07 17:53:20 shersche
27 Fix problems associated with the CUPS printer workaround fix.
29 Revision 1.6 2005/02/08 21:45:06 shersche
30 <rdar://problem/3947490> Default to Generic PostScript or PCL if unable to match driver
32 Revision 1.5 2005/01/06 08:17:08 shersche
33 Display the selected protocol ("Raw", "LPR", "IPP") rather than the port name
35 Revision 1.4 2004/07/13 20:15:04 shersche
36 <rdar://problem/3726363> Load large font name from resource
39 Revision 1.3 2004/07/12 06:59:03 shersche
40 <rdar://problem/3723695> Use resource strings for Yes/No
43 Revision 1.2 2004/06/26 23:27:12 shersche
44 support for installing multiple printers of the same name
46 Revision 1.1 2004/06/18 04:36:57 rpantos
53 #include "PrinterSetupWizardApp.h"
54 #include "PrinterSetupWizardSheet.h"
55 #include "FourthPage.h"
60 IMPLEMENT_DYNAMIC(CFourthPage
, CPropertyPage
)
61 CFourthPage::CFourthPage()
62 : CPropertyPage(CFourthPage::IDD
),
67 m_psp
.dwFlags
&= ~(PSP_HASHELP
);
68 m_psp
.dwFlags
|= PSP_DEFAULT
|PSP_HIDEHEADER
;
70 fontName
.LoadString(IDS_LARGE_FONT
);
72 // create the large font
73 m_largeFont
.CreateFont(-16, 0, 0, 0,
74 FW_BOLD
, FALSE
, FALSE
, 0, DEFAULT_CHARSET
, OUT_DEFAULT_PRECIS
,
75 CLIP_DEFAULT_PRECIS
, DEFAULT_QUALITY
, DEFAULT_PITCH
, fontName
);
78 CFourthPage::~CFourthPage()
82 void CFourthPage::DoDataExchange(CDataExchange
* pDX
)
84 CPropertyPage::DoDataExchange(pDX
);
85 DDX_Control(pDX
, IDC_GOODBYE
, m_goodbye
);
86 DDX_Control(pDX
, IDC_PRINTER_NAME
, m_printerNameCtrl
);
87 DDX_Control(pDX
, IDC_PRINTER_MANUFACTURER
, m_printerManufacturerCtrl
);
88 DDX_Control(pDX
, IDC_PRINTER_MODEL
, m_printerModelCtrl
);
89 DDX_Control(pDX
, IDC_PRINTER_PROTOCOL
, m_printerProtocolCtrl
);
90 DDX_Control(pDX
, IDC_PRINTER_DEFAULT
, m_printerDefault
);
94 BEGIN_MESSAGE_MAP(CFourthPage
, CPropertyPage
)
98 // CFourthPage message handlers
100 CFourthPage::OnInitPage()
107 CFourthPage::OnSetActive()
109 CPrinterSetupWizardSheet
* psheet
;
114 psheet
= reinterpret_cast<CPrinterSetupWizardSheet
*>(GetParent());
115 require_quiet( psheet
, exit
);
117 printer
= psheet
->GetSelectedPrinter();
118 require_quiet( psheet
, exit
);
120 psheet
->SetWizardButtons(PSWIZB_BACK
|PSWIZB_FINISH
);
122 if (m_initialized
== false)
124 m_initialized
= true;
128 m_goodbye
.SetFont(&m_largeFont
);
130 goodbyeText
.LoadString(IDS_GOODBYE
);
131 m_goodbye
.SetWindowText(goodbyeText
);
133 m_printerNameCtrl
.SetWindowText( printer
->actualName
);
134 m_printerManufacturerCtrl
.SetWindowText ( printer
->manufacturer
);
135 m_printerModelCtrl
.SetWindowText ( printer
->displayModelName
);
137 Service
* service
= printer
->services
.front();
138 require_quiet( service
, exit
);
139 m_printerProtocolCtrl
.SetWindowText ( service
->protocol
);
143 defaultText
.LoadString(IDS_YES
);
147 defaultText
.LoadString(IDS_NO
);
150 m_printerDefault
.SetWindowText ( defaultText
);
154 return CPropertyPage::OnSetActive();
159 CFourthPage::OnKillActive()
161 CPrinterSetupWizardSheet
* psheet
;
163 psheet
= reinterpret_cast<CPrinterSetupWizardSheet
*>(GetParent());
164 require_quiet( psheet
, exit
);
166 psheet
->SetLastPage(this);
170 return CPropertyPage::OnKillActive();