195 |
195 |
196 TAknWindowComponentLayout iconLayout = |
196 TAknWindowComponentLayout iconLayout = |
197 NMRLayoutManager::GetWindowComponentLayout( |
197 NMRLayoutManager::GetWindowComponentLayout( |
198 NMRLayoutManager::EMRLayoutTextEditorIcon ); |
198 NMRLayoutManager::EMRLayoutTextEditorIcon ); |
199 AknLayoutUtils::LayoutImage( iIcon, rect, iconLayout ); |
199 AknLayoutUtils::LayoutImage( iIcon, rect, iconLayout ); |
200 |
200 |
201 // Layouting lock icon |
201 // Layouting lock icon |
202 if( iLockIcon ) |
202 if( iLockIcon ) |
203 { |
203 { |
204 TAknWindowComponentLayout iconLayout( |
204 TAknWindowComponentLayout iconLayout( |
205 NMRLayoutManager::GetWindowComponentLayout( |
205 NMRLayoutManager::GetWindowComponentLayout( |
206 NMRLayoutManager::EMRLayoutSingleRowDColumnGraphic ) ); |
206 NMRLayoutManager::EMRLayoutSingleRowDColumnGraphic ) ); |
207 AknLayoutUtils::LayoutImage( iLockIcon, rect, iconLayout ); |
207 AknLayoutUtils::LayoutImage( iLockIcon, rect, iconLayout ); |
208 } |
208 } |
209 |
209 |
210 // Layouting label |
210 // Layouting label |
211 TAknLayoutText viewerLayoutText; |
211 TAknTextComponentLayout viewerLayoutText; |
|
212 |
212 if( iLockIcon ) |
213 if( iLockIcon ) |
213 { |
214 { |
214 viewerLayoutText = NMRLayoutManager::GetLayoutText( rect, |
215 viewerLayoutText = NMRLayoutManager::GetTextComponentLayout( |
215 NMRLayoutManager::EMRTextLayoutSingleRowEditorText ); |
216 NMRLayoutManager::EMRTextLayoutSingleRowEditorText ); |
216 } |
217 } |
217 else |
218 else |
218 { |
219 { |
219 viewerLayoutText = NMRLayoutManager::GetLayoutText( rect, |
220 viewerLayoutText = NMRLayoutManager::GetTextComponentLayout( |
220 NMRLayoutManager::EMRTextLayoutTextEditor ); |
221 NMRLayoutManager::EMRTextLayoutTextEditor ); |
221 } |
222 } |
222 |
223 |
223 TRect viewerRect( viewerLayoutText.TextRect() ); |
224 AknLayoutUtils::LayoutLabel( iLabel, rect, viewerLayoutText ); |
224 iLabel->SetRect( viewerRect ); |
225 TRect viewerRect( iLabel->Rect() ); |
225 |
226 |
226 // Move focus rect so that it's relative to field's position. |
227 // Move focus rect so that it's relative to field's position. |
227 viewerRect.Move( -Position() ); |
228 viewerRect.Move( -Position() ); |
228 SetFocusRect( viewerRect ); |
229 SetFocusRect( viewerRect ); |
229 |
|
230 // Setting font also for the label |
|
231 iLabel->SetFont( viewerLayoutText.Font() ); |
|
232 } |
230 } |
233 |
231 |
234 // --------------------------------------------------------------------------- |
232 // --------------------------------------------------------------------------- |
235 // CESMRViewerAlarmField::CountComponentControls() |
233 // CESMRViewerAlarmField::CountComponentControls() |
236 // --------------------------------------------------------------------------- |
234 // --------------------------------------------------------------------------- |
313 // --------------------------------------------------------------------------- |
311 // --------------------------------------------------------------------------- |
314 // |
312 // |
315 TBool CESMRViewerAlarmField::ExecuteGenericCommandL( TInt aCommand ) |
313 TBool CESMRViewerAlarmField::ExecuteGenericCommandL( TInt aCommand ) |
316 { |
314 { |
317 FUNC_LOG; |
315 FUNC_LOG; |
318 |
316 |
319 TBool retValue( EFalse ); |
317 TBool retValue( EFalse ); |
320 |
318 |
321 if( (aCommand == EAknCmdOpen) && IsLocked() ) |
319 if( (aCommand == EAknCmdOpen) && IsLocked() ) |
322 { |
320 { |
323 HandleTactileFeedbackL(); |
321 HandleTactileFeedbackL(); |
324 |
322 |
325 CESMRGlobalNote::ExecuteL( |
323 CESMRGlobalNote::ExecuteL( |
326 CESMRGlobalNote::EESMRUnableToEdit ); |
324 CESMRGlobalNote::EESMRUnableToEdit ); |
327 retValue = ETrue; |
325 retValue = ETrue; |
328 } |
326 } |
329 |
327 |
330 return retValue; |
328 return retValue; |
331 } |
329 } |
332 |
330 |
333 // EOF |
331 // EOF |