79 { |
79 { |
80 FUNC_LOG; |
80 FUNC_LOG; |
81 iLabel = CMRLabel::NewL(); |
81 iLabel = CMRLabel::NewL(); |
82 iLabel->SetParent( this ); |
82 iLabel->SetParent( this ); |
83 CESMRField::ConstructL( iLabel ); // ownership transfered |
83 CESMRField::ConstructL( iLabel ); // ownership transfered |
84 |
84 |
85 iIcon = CMRImage::NewL( NMRBitmapManager::EMRBitmapPriorityNormal ); |
85 iIcon = CMRImage::NewL( NMRBitmapManager::EMRBitmapPriorityNormal ); |
86 iIcon->SetParent( this ); |
86 iIcon->SetParent( this ); |
87 |
87 |
88 HBufC* priorityText = StringLoader::LoadLC( |
88 HBufC* priorityText = StringLoader::LoadLC( |
89 R_QTN_CALENDAR_MEETING_OPT_PRIORITY_NORMAL, |
89 R_QTN_CALENDAR_MEETING_OPT_PRIORITY_NORMAL, |
90 iEikonEnv ); |
90 iEikonEnv ); |
91 iLabel->SetTextL( *priorityText ); |
91 iLabel->SetTextL( *priorityText ); |
92 CleanupStack::PopAndDestroy( priorityText ); |
92 CleanupStack::PopAndDestroy( priorityText ); |
180 FUNC_LOG; |
180 FUNC_LOG; |
181 TRect rect = Rect(); |
181 TRect rect = Rect(); |
182 TAknLayoutRect rowLayoutRect = |
182 TAknLayoutRect rowLayoutRect = |
183 NMRLayoutManager::GetFieldRowLayoutRect( rect, 1 ); |
183 NMRLayoutManager::GetFieldRowLayoutRect( rect, 1 ); |
184 rect = rowLayoutRect.Rect(); |
184 rect = rowLayoutRect.Rect(); |
185 |
185 |
186 TAknWindowComponentLayout iconLayout = |
186 TAknWindowComponentLayout iconLayout = |
187 NMRLayoutManager::GetWindowComponentLayout( |
187 NMRLayoutManager::GetWindowComponentLayout( |
188 NMRLayoutManager::EMRLayoutTextEditorIcon ); |
188 NMRLayoutManager::EMRLayoutTextEditorIcon ); |
189 AknLayoutUtils::LayoutImage( iIcon, rect, iconLayout ); |
189 AknLayoutUtils::LayoutImage( iIcon, rect, iconLayout ); |
190 |
190 |
191 // Layouting lock icon |
191 // Layouting lock icon |
192 if( iLockIcon ) |
192 if( iLockIcon ) |
193 { |
193 { |
194 TAknWindowComponentLayout iconLayout( |
194 TAknWindowComponentLayout iconLayout( |
195 NMRLayoutManager::GetWindowComponentLayout( |
195 NMRLayoutManager::GetWindowComponentLayout( |
196 NMRLayoutManager::EMRLayoutSingleRowDColumnGraphic ) ); |
196 NMRLayoutManager::EMRLayoutSingleRowDColumnGraphic ) ); |
197 AknLayoutUtils::LayoutImage( iLockIcon, rect, iconLayout ); |
197 AknLayoutUtils::LayoutImage( iLockIcon, rect, iconLayout ); |
198 } |
198 } |
199 |
199 |
200 // Layouting label |
200 // Layouting label |
201 TAknLayoutText viewerLayoutText; |
201 TAknTextComponentLayout viewerLayoutText; |
|
202 |
202 if( iLockIcon ) |
203 if( iLockIcon ) |
203 { |
204 { |
204 viewerLayoutText = NMRLayoutManager::GetLayoutText( rect, |
205 viewerLayoutText = NMRLayoutManager::GetTextComponentLayout( |
205 NMRLayoutManager::EMRTextLayoutSingleRowEditorText ); |
206 NMRLayoutManager::EMRTextLayoutSingleRowEditorText ); |
206 } |
207 } |
207 else |
208 else |
208 { |
209 { |
209 viewerLayoutText = NMRLayoutManager::GetLayoutText( rect, |
210 viewerLayoutText = NMRLayoutManager::GetTextComponentLayout( |
210 NMRLayoutManager::EMRTextLayoutTextEditor ); |
211 NMRLayoutManager::EMRTextLayoutTextEditor ); |
211 } |
212 } |
212 |
213 |
213 TRect viewerRect( viewerLayoutText.TextRect() ); |
214 AknLayoutUtils::LayoutLabel( iLabel, rect, viewerLayoutText ); |
214 iLabel->SetRect( viewerRect ); |
215 TRect viewerRect( iLabel->Rect() ); |
215 |
216 |
216 // Move focus rect so that it's relative to field's position. |
217 // Move focus rect so that it's relative to field's position. |
217 viewerRect.Move( -Position() ); |
218 viewerRect.Move( -Position() ); |
218 SetFocusRect( viewerRect ); |
219 SetFocusRect( viewerRect ); |
219 |
|
220 // Setting font also for the label |
|
221 iLabel->SetFont( viewerLayoutText.Font() ); |
|
222 } |
220 } |
223 |
221 |
224 // --------------------------------------------------------------------------- |
222 // --------------------------------------------------------------------------- |
225 // CESMRViewerPriorityField::CountComponentControls() |
223 // CESMRViewerPriorityField::CountComponentControls() |
226 // --------------------------------------------------------------------------- |
224 // --------------------------------------------------------------------------- |
271 // |
269 // |
272 void CESMRViewerPriorityField::SetOutlineFocusL( TBool aFocus ) |
270 void CESMRViewerPriorityField::SetOutlineFocusL( TBool aFocus ) |
273 { |
271 { |
274 FUNC_LOG; |
272 FUNC_LOG; |
275 CESMRField::SetOutlineFocusL ( aFocus ); |
273 CESMRField::SetOutlineFocusL ( aFocus ); |
276 |
274 |
277 iLabel->SetFocus( aFocus ); |
275 iLabel->SetFocus( aFocus ); |
278 } |
276 } |
279 |
277 |
280 // --------------------------------------------------------------------------- |
278 // --------------------------------------------------------------------------- |
281 // CESMRViewerPriorityField::LockL() |
279 // CESMRViewerPriorityField::LockL() |
282 // --------------------------------------------------------------------------- |
280 // --------------------------------------------------------------------------- |