|
1 /* |
|
2 * Copyright (c) 2007-2007 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of the License "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include <coemain.h> |
|
20 #include <testappmngui.rsg> |
|
21 |
|
22 #include "testappmnguiAppView.h" |
|
23 |
|
24 // Standard construction sequence |
|
25 CtestappmnguiAppView* CtestappmnguiAppView::NewL(const TRect& aRect) |
|
26 { |
|
27 CtestappmnguiAppView* self = CtestappmnguiAppView::NewLC(aRect); |
|
28 CleanupStack::Pop(self); |
|
29 return self; |
|
30 } |
|
31 |
|
32 CtestappmnguiAppView* CtestappmnguiAppView::NewLC(const TRect& aRect) |
|
33 { |
|
34 CtestappmnguiAppView* self = new (ELeave) CtestappmnguiAppView; |
|
35 CleanupStack::PushL(self); |
|
36 self->ConstructL(aRect); |
|
37 return self; |
|
38 } |
|
39 |
|
40 CtestappmnguiAppView::CtestappmnguiAppView() |
|
41 { |
|
42 // no implementation required |
|
43 } |
|
44 |
|
45 CtestappmnguiAppView::~CtestappmnguiAppView() |
|
46 { |
|
47 // no implementation required |
|
48 } |
|
49 |
|
50 void CtestappmnguiAppView::ConstructL(const TRect& aRect) |
|
51 { |
|
52 // Create a window for this application view |
|
53 CreateWindowL(); |
|
54 |
|
55 // Set the windows size |
|
56 SetRect(aRect); |
|
57 |
|
58 // Activate the window, which makes it ready to be drawn |
|
59 ActivateL(); |
|
60 } |
|
61 |
|
62 // Draw this application's view to the screen |
|
63 void CtestappmnguiAppView::Draw(const TRect& /*aRect*/) const |
|
64 { |
|
65 // Get the standard graphics context |
|
66 CWindowGc& gc = SystemGc(); |
|
67 |
|
68 // Gets the control's extent |
|
69 TRect rect = Rect(); |
|
70 |
|
71 // Clears the screen |
|
72 gc.Clear(rect); |
|
73 } |
|
74 |
|
75 |