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