1 /* |
|
2 * Copyright (c) 2006-2009 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 "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: container |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 #include "BCTestCmDlgcontainer.h" |
|
27 |
|
28 #define KAknAtListGray TRgb(0xaaaaaa) |
|
29 |
|
30 // ======== MEMBER FUNCTIONS ======== |
|
31 |
|
32 // --------------------------------------------------------------------------- |
|
33 // C++ default Constructor |
|
34 // --------------------------------------------------------------------------- |
|
35 // |
|
36 CBCTestCmDlgContainer::CBCTestCmDlgContainer() |
|
37 { |
|
38 } |
|
39 |
|
40 // --------------------------------------------------------------------------- |
|
41 // Destructor |
|
42 // --------------------------------------------------------------------------- |
|
43 // |
|
44 CBCTestCmDlgContainer::~CBCTestCmDlgContainer() |
|
45 { |
|
46 ResetControl(); |
|
47 } |
|
48 |
|
49 // --------------------------------------------------------------------------- |
|
50 // Symbian 2nd Constructor |
|
51 // --------------------------------------------------------------------------- |
|
52 // |
|
53 void CBCTestCmDlgContainer::ConstructL( const TRect& aRect ) |
|
54 { |
|
55 CreateWindowL(); |
|
56 SetRect( aRect ); |
|
57 ActivateL(); |
|
58 } |
|
59 |
|
60 // ---------------------------------------------------------------------------- |
|
61 // CBCTestCmDlgContainer::Draw |
|
62 // Fills the window's rectangle. |
|
63 // ---------------------------------------------------------------------------- |
|
64 // |
|
65 void CBCTestCmDlgContainer::Draw( const TRect& aRect ) const |
|
66 { |
|
67 CWindowGc& gc = SystemGc(); |
|
68 gc.SetPenStyle( CGraphicsContext::ENullPen ); |
|
69 gc.SetBrushColor( KAknAtListGray ); |
|
70 gc.SetBrushStyle( CGraphicsContext::ESolidBrush ); |
|
71 gc.DrawRect( aRect ); |
|
72 } |
|
73 |
|
74 // --------------------------------------------------------------------------- |
|
75 // CBCTestCmDlgContainer::CountComponentControls |
|
76 // --------------------------------------------------------------------------- |
|
77 // |
|
78 TInt CBCTestCmDlgContainer::CountComponentControls() const |
|
79 { |
|
80 if ( iControl ) |
|
81 { |
|
82 return 1; |
|
83 } |
|
84 else |
|
85 { |
|
86 return 0; |
|
87 } |
|
88 } |
|
89 |
|
90 // --------------------------------------------------------------------------- |
|
91 // CBCTestCmDlgContainer::ComponentControl |
|
92 // --------------------------------------------------------------------------- |
|
93 // |
|
94 CCoeControl* CBCTestCmDlgContainer::ComponentControl( TInt ) const |
|
95 { |
|
96 return iControl; |
|
97 } |
|
98 |
|
99 // --------------------------------------------------------------------------- |
|
100 // CBCTestCmDlgContainer::SetControl |
|
101 // --------------------------------------------------------------------------- |
|
102 // |
|
103 void CBCTestCmDlgContainer::SetControl( CCoeControl* aControl ) |
|
104 { |
|
105 iControl = aControl; |
|
106 if ( iControl ) |
|
107 { |
|
108 // You can change the position and size |
|
109 iControl->SetExtent( Rect().iTl, Rect().Size() ); |
|
110 iControl->ActivateL(); |
|
111 DrawNow(); |
|
112 } |
|
113 } |
|
114 |
|
115 // --------------------------------------------------------------------------- |
|
116 // CBCTestCmDlgContainer::ResetControl |
|
117 // --------------------------------------------------------------------------- |
|
118 // |
|
119 void CBCTestCmDlgContainer::ResetControl() |
|
120 { |
|
121 delete iControl; |
|
122 iControl = NULL; |
|
123 } |
|
124 |
|
125 // end of file |
|