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.6 2005/02/08 21:45:06 shersche
27 <rdar://problem/3947490> Default to Generic PostScript or PCL if unable to match driver
29 Revision 1.5 2005/01/06 08:17:08 shersche
30 Display the selected protocol ("Raw", "LPR", "IPP") rather than the port name
32 Revision 1.4 2004/07/13 20:15:04 shersche
33 <rdar://problem/3726363> Load large font name from resource
36 Revision 1.3 2004/07/12 06:59:03 shersche
37 <rdar://problem/3723695> Use resource strings for Yes/No
40 Revision 1.2 2004/06/26 23:27:12 shersche
41 support for installing multiple printers of the same name
43 Revision 1.1 2004/06/18 04:36:57 rpantos
50 #include "PrinterSetupWizardApp.h"
51 #include "PrinterSetupWizardSheet.h"
52 #include "FourthPage.h"
57 IMPLEMENT_DYNAMIC(CFourthPage
, CPropertyPage
)
58 CFourthPage::CFourthPage()
59 : CPropertyPage(CFourthPage::IDD
),
64 m_psp
.dwFlags
&= ~(PSP_HASHELP
);
65 m_psp
.dwFlags
|= PSP_DEFAULT
|PSP_HIDEHEADER
;
67 fontName
.LoadString(IDS_LARGE_FONT
);
69 // create the large font
70 m_largeFont
.CreateFont(-16, 0, 0, 0,
71 FW_BOLD
, FALSE
, FALSE
, 0, DEFAULT_CHARSET
, OUT_DEFAULT_PRECIS
,
72 CLIP_DEFAULT_PRECIS
, DEFAULT_QUALITY
, DEFAULT_PITCH
, fontName
);
75 CFourthPage::~CFourthPage()
79 void CFourthPage::DoDataExchange(CDataExchange
* pDX
)
81 CPropertyPage::DoDataExchange(pDX
);
82 DDX_Control(pDX
, IDC_GOODBYE
, m_goodbye
);
83 DDX_Control(pDX
, IDC_PRINTER_NAME
, m_printerNameCtrl
);
84 DDX_Control(pDX
, IDC_PRINTER_MANUFACTURER
, m_printerManufacturerCtrl
);
85 DDX_Control(pDX
, IDC_PRINTER_MODEL
, m_printerModelCtrl
);
86 DDX_Control(pDX
, IDC_PRINTER_PROTOCOL
, m_printerProtocolCtrl
);
87 DDX_Control(pDX
, IDC_PRINTER_DEFAULT
, m_printerDefault
);
91 BEGIN_MESSAGE_MAP(CFourthPage
, CPropertyPage
)
95 // CFourthPage message handlers
97 CFourthPage::OnInitPage()
104 CFourthPage::OnSetActive()
106 CPrinterSetupWizardSheet
* psheet
;
111 psheet
= reinterpret_cast<CPrinterSetupWizardSheet
*>(GetParent());
112 require_quiet( psheet
, exit
);
114 printer
= psheet
->GetSelectedPrinter();
115 require_quiet( psheet
, exit
);
117 psheet
->SetWizardButtons(PSWIZB_BACK
|PSWIZB_FINISH
);
119 if (m_initialized
== false)
121 m_initialized
= true;
125 m_goodbye
.SetFont(&m_largeFont
);
127 goodbyeText
.LoadString(IDS_GOODBYE
);
128 m_goodbye
.SetWindowText(goodbyeText
);
130 m_printerNameCtrl
.SetWindowText( printer
->actualName
);
131 m_printerManufacturerCtrl
.SetWindowText ( printer
->manufacturer
);
132 m_printerModelCtrl
.SetWindowText ( printer
->displayModelName
);
134 Service
* service
= printer
->services
.front();
135 require_quiet( service
, exit
);
136 m_printerProtocolCtrl
.SetWindowText ( service
->protocol
);
140 defaultText
.LoadString(IDS_YES
);
144 defaultText
.LoadString(IDS_NO
);
147 m_printerDefault
.SetWindowText ( defaultText
);
151 return CPropertyPage::OnSetActive();