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.4 2004/07/13 20:15:04 shersche
27 <rdar://problem/3726363> Load large font name from resource
30 Revision 1.3 2004/07/12 06:59:03 shersche
31 <rdar://problem/3723695> Use resource strings for Yes/No
34 Revision 1.2 2004/06/26 23:27:12 shersche
35 support for installing multiple printers of the same name
37 Revision 1.1 2004/06/18 04:36:57 rpantos
44 #include "PrinterSetupWizardApp.h"
45 #include "PrinterSetupWizardSheet.h"
46 #include "FourthPage.h"
51 IMPLEMENT_DYNAMIC(CFourthPage
, CPropertyPage
)
52 CFourthPage::CFourthPage()
53 : CPropertyPage(CFourthPage::IDD
),
58 m_psp
.dwFlags
&= ~(PSP_HASHELP
);
59 m_psp
.dwFlags
|= PSP_DEFAULT
|PSP_HIDEHEADER
;
61 fontName
.LoadString(IDS_LARGE_FONT
);
63 // create the large font
64 m_largeFont
.CreateFont(-16, 0, 0, 0,
65 FW_BOLD
, FALSE
, FALSE
, 0, DEFAULT_CHARSET
, OUT_DEFAULT_PRECIS
,
66 CLIP_DEFAULT_PRECIS
, DEFAULT_QUALITY
, DEFAULT_PITCH
, fontName
);
69 CFourthPage::~CFourthPage()
73 void CFourthPage::DoDataExchange(CDataExchange
* pDX
)
75 CPropertyPage::DoDataExchange(pDX
);
76 DDX_Control(pDX
, IDC_GOODBYE
, m_goodbye
);
77 DDX_Control(pDX
, IDC_PRINTER_NAME
, m_printerNameCtrl
);
78 DDX_Control(pDX
, IDC_PRINTER_MANUFACTURER
, m_printerManufacturerCtrl
);
79 DDX_Control(pDX
, IDC_PRINTER_MODEL
, m_printerModelCtrl
);
80 DDX_Control(pDX
, IDC_PRINTER_PORT
, m_printerPortCtrl
);
81 DDX_Control(pDX
, IDC_PRINTER_DEFAULT
, m_printerDefault
);
85 BEGIN_MESSAGE_MAP(CFourthPage
, CPropertyPage
)
89 // CFourthPage message handlers
91 CFourthPage::OnInitPage()
98 CFourthPage::OnSetActive()
100 CPrinterSetupWizardSheet
* psheet
;
105 psheet
= reinterpret_cast<CPrinterSetupWizardSheet
*>(GetParent());
106 require_quiet( psheet
, exit
);
108 printer
= psheet
->GetSelectedPrinter();
109 require_quiet( psheet
, exit
);
111 psheet
->SetWizardButtons(PSWIZB_BACK
|PSWIZB_FINISH
);
113 if (m_initialized
== false)
115 m_initialized
= true;
119 m_goodbye
.SetFont(&m_largeFont
);
121 goodbyeText
.LoadString(IDS_GOODBYE
);
122 m_goodbye
.SetWindowText(goodbyeText
);
124 m_printerNameCtrl
.SetWindowText( printer
->actualName
);
125 m_printerManufacturerCtrl
.SetWindowText ( printer
->manufacturer
);
126 m_printerModelCtrl
.SetWindowText ( printer
->model
);
127 m_printerPortCtrl
.SetWindowText ( printer
->portName
);
131 defaultText
.LoadString(IDS_YES
);
135 defaultText
.LoadString(IDS_NO
);
138 m_printerDefault
.SetWindowText ( defaultText
);
142 return CPropertyPage::OnSetActive();