56 CESMRPriorityField::~CESMRPriorityField() |
56 CESMRPriorityField::~CESMRPriorityField() |
57 { |
57 { |
58 FUNC_LOG; |
58 FUNC_LOG; |
59 iArray.ResetAndDestroy(); |
59 iArray.ResetAndDestroy(); |
60 iArray.Close(); |
60 iArray.Close(); |
61 |
61 |
62 delete iIcon; |
62 delete iIcon; |
63 } |
63 } |
64 |
64 |
65 // --------------------------------------------------------------------------- |
65 // --------------------------------------------------------------------------- |
66 // CESMRPriorityField::NewL |
66 // CESMRPriorityField::NewL |
67 // --------------------------------------------------------------------------- |
67 // --------------------------------------------------------------------------- |
80 // CESMRPriorityField::ConstructL |
80 // CESMRPriorityField::ConstructL |
81 // --------------------------------------------------------------------------- |
81 // --------------------------------------------------------------------------- |
82 // |
82 // |
83 void CESMRPriorityField::ConstructL() |
83 void CESMRPriorityField::ConstructL() |
84 { |
84 { |
85 FUNC_LOG; |
85 FUNC_LOG; |
86 iLabel = CMRLabel::NewL(); |
86 iLabel = CMRLabel::NewL(); |
87 iLabel->SetParent( this ); |
87 iLabel->SetParent( this ); |
88 CESMRField::ConstructL( iLabel ); // ownership transfered |
88 CESMRField::ConstructL( iLabel ); // ownership transfered |
89 |
89 |
90 iIcon = CMRImage::NewL( NMRBitmapManager::EMRBitmapPriorityNormal ); |
90 iIcon = CMRImage::NewL( NMRBitmapManager::EMRBitmapPriorityNormal ); |
96 // --------------------------------------------------------------------------- |
96 // --------------------------------------------------------------------------- |
97 // |
97 // |
98 void CESMRPriorityField::InitializeL() |
98 void CESMRPriorityField::InitializeL() |
99 { |
99 { |
100 FUNC_LOG; |
100 FUNC_LOG; |
101 NMRColorManager::SetColor( *iLabel, |
101 NMRColorManager::SetColor( *iLabel, |
102 NMRColorManager::EMRMainAreaTextColor ); |
102 NMRColorManager::EMRMainAreaTextColor ); |
103 } |
103 } |
104 |
104 |
105 // --------------------------------------------------------------------------- |
105 // --------------------------------------------------------------------------- |
106 // CESMRPriorityField::InternalizeL |
106 // CESMRPriorityField::InternalizeL |
142 iIndex = i; |
142 iIndex = i; |
143 UpdateTextL ( iIndex ); |
143 UpdateTextL ( iIndex ); |
144 } |
144 } |
145 } |
145 } |
146 // reader |
146 // reader |
147 CleanupStack::PopAndDestroy(); // codescanner::cleanup |
147 CleanupStack::PopAndDestroy(); // codescanner::cleanup |
148 } |
148 } |
149 |
149 |
150 // --------------------------------------------------------------------------- |
150 // --------------------------------------------------------------------------- |
151 // CESMRPriorityField::ExternalizeL |
151 // CESMRPriorityField::ExternalizeL |
152 // --------------------------------------------------------------------------- |
152 // --------------------------------------------------------------------------- |
191 FUNC_LOG; |
191 FUNC_LOG; |
192 TRect rect = Rect(); |
192 TRect rect = Rect(); |
193 TAknLayoutRect rowLayoutRect = |
193 TAknLayoutRect rowLayoutRect = |
194 NMRLayoutManager::GetFieldRowLayoutRect( rect, 1 ); |
194 NMRLayoutManager::GetFieldRowLayoutRect( rect, 1 ); |
195 rect = rowLayoutRect.Rect(); |
195 rect = rowLayoutRect.Rect(); |
196 |
196 |
197 TAknWindowComponentLayout iconLayout = |
197 TAknWindowComponentLayout iconLayout = |
198 NMRLayoutManager::GetWindowComponentLayout( |
198 NMRLayoutManager::GetWindowComponentLayout( |
199 NMRLayoutManager::EMRLayoutTextEditorIcon ); |
199 NMRLayoutManager::EMRLayoutTextEditorIcon ); |
200 AknLayoutUtils::LayoutImage( iIcon, rect, iconLayout ); |
200 AknLayoutUtils::LayoutImage( iIcon, rect, iconLayout ); |
201 |
201 |
202 TAknLayoutRect bgLayoutRect = |
202 TAknLayoutRect bgLayoutRect = |
203 NMRLayoutManager::GetLayoutRect( |
203 NMRLayoutManager::GetLayoutRect( |
204 rect, NMRLayoutManager::EMRLayoutTextEditorBg ); |
204 rect, NMRLayoutManager::EMRLayoutTextEditorBg ); |
205 TRect bgRect( bgLayoutRect.Rect() ); |
205 TRect bgRect( bgLayoutRect.Rect() ); |
206 // Move focus rect so that it's relative to field's position. |
206 // Move focus rect so that it's relative to field's position. |
207 bgRect.Move( -Position() ); |
207 bgRect.Move( -Position() ); |
208 SetFocusRect( bgRect ); |
208 SetFocusRect( bgRect ); |
209 |
209 |
210 TAknLayoutText labelLayout = |
210 TAknTextComponentLayout editorLayout = |
211 NMRLayoutManager::GetLayoutText( |
211 NMRLayoutManager::GetTextComponentLayout( |
212 rect, NMRLayoutManager::EMRTextLayoutTextEditor ); |
212 NMRLayoutManager::EMRTextLayoutTextEditor ); |
213 iLabel->SetRect( labelLayout.TextRect() ); |
213 |
|
214 AknLayoutUtils::LayoutLabel( iLabel, rect, editorLayout ); |
214 } |
215 } |
215 |
216 |
216 // --------------------------------------------------------------------------- |
217 // --------------------------------------------------------------------------- |
217 // CESMRPriorityField::CountComponentControls() |
218 // CESMRPriorityField::CountComponentControls() |
218 // --------------------------------------------------------------------------- |
219 // --------------------------------------------------------------------------- |
379 { |
380 { |
380 FUNC_LOG; |
381 FUNC_LOG; |
381 CESMRPriority* priority = iArray[ aIndex ]; |
382 CESMRPriority* priority = iArray[ aIndex ]; |
382 iLabel->SetTextL ( priority->Text ( ) ); |
383 iLabel->SetTextL ( priority->Text ( ) ); |
383 |
384 |
384 NMRBitmapManager::TMRBitmapId bitmapId( |
385 NMRBitmapManager::TMRBitmapId bitmapId( |
385 NMRBitmapManager::EMRBitmapPriorityNormal ); |
386 NMRBitmapManager::EMRBitmapPriorityNormal ); |
386 |
387 |
387 switch ( priority->Id() ) |
388 switch ( priority->Id() ) |
388 { |
389 { |
389 case EFSCalenMRPriorityLow: |
390 case EFSCalenMRPriorityLow: |