|
1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // Part of the MVS Application for TechView |
|
15 // |
|
16 |
|
17 #include "MVSMultipleScreenDialog.h" |
|
18 #include "MVSApp.hrh" |
|
19 |
|
20 |
|
21 void CMVSMultipleScreenDialog::SetupDialogLD(TInt aScreenNumber,CMVSAppUi* aAppUi) |
|
22 { |
|
23 CMVSMultipleScreenDialog* dialog = new (ELeave) CMVSMultipleScreenDialog(aScreenNumber, |
|
24 aAppUi); |
|
25 dialog->ExecuteLD(R_MVS_DIALOG_MULTIPLESCREEN); |
|
26 } |
|
27 |
|
28 |
|
29 void CMVSMultipleScreenDialog::PreLayoutDynInitL() |
|
30 { |
|
31 // Get a downcasted pointer to the controls |
|
32 CEikNumberEditor* myScreenControl = static_cast<CEikNumberEditor*>(Control(EMVSCmdMultiScreen)); |
|
33 |
|
34 //Now seed the controls with appropriate values |
|
35 if(myScreenControl) |
|
36 { |
|
37 myScreenControl->SetNumber(iScreenNumber); |
|
38 myScreenControl->SetMinimumAndMaximum(0, ControlEnv()->WsSession().NumberOfScreens() - 1); |
|
39 } |
|
40 } |
|
41 |
|
42 |
|
43 CMVSMultipleScreenDialog::CMVSMultipleScreenDialog(TInt aScreenNumber, |
|
44 CMVSAppUi* aAppUi) |
|
45 : iScreenNumber(aScreenNumber),iAppUi(aAppUi) |
|
46 { |
|
47 } |
|
48 |
|
49 |
|
50 TBool CMVSMultipleScreenDialog::OkToExitL(TInt aButtonId) |
|
51 { |
|
52 if(aButtonId == EMVSButtonCancel) |
|
53 { |
|
54 return ETrue; |
|
55 } |
|
56 |
|
57 //set the desired screen for output |
|
58 iScreenNumber = static_cast<CEikNumberEditor*>(Control(EMVSCmdMultiScreen))->Number(); |
|
59 |
|
60 iAppUi->SetOutputScreen(iScreenNumber); |
|
61 return ETrue; |
|
62 } |