125 AknLayoutUtils::LayoutImage( iIcon, rect, iconLayout ); |
125 AknLayoutUtils::LayoutImage( iIcon, rect, iconLayout ); |
126 |
126 |
127 // Layouting lock icon |
127 // Layouting lock icon |
128 if( iLockIcon ) |
128 if( iLockIcon ) |
129 { |
129 { |
130 TAknWindowComponentLayout iconLayout( |
130 TAknWindowComponentLayout iconLayout( |
131 NMRLayoutManager::GetWindowComponentLayout( |
131 NMRLayoutManager::GetWindowComponentLayout( |
132 NMRLayoutManager::EMRLayoutSingleRowDColumnGraphic ) ); |
132 NMRLayoutManager::EMRLayoutSingleRowDColumnGraphic ) ); |
133 AknLayoutUtils::LayoutImage( iLockIcon, rect, iconLayout ); |
133 AknLayoutUtils::LayoutImage( iLockIcon, rect, iconLayout ); |
134 } |
134 } |
135 |
135 |
136 // Layouting label |
136 // Layouting label |
137 TAknLayoutText viewerLayoutText; |
137 TAknTextComponentLayout viewerLayoutText; |
|
138 |
138 if( iLockIcon ) |
139 if( iLockIcon ) |
139 { |
140 { |
140 viewerLayoutText = NMRLayoutManager::GetLayoutText( rect, |
141 viewerLayoutText = NMRLayoutManager::GetTextComponentLayout( |
141 NMRLayoutManager::EMRTextLayoutSingleRowEditorText ); |
142 NMRLayoutManager::EMRTextLayoutSingleRowEditorText ); |
142 } |
143 } |
143 else |
144 else |
144 { |
145 { |
145 viewerLayoutText = NMRLayoutManager::GetLayoutText( rect, |
146 viewerLayoutText = NMRLayoutManager::GetTextComponentLayout( |
146 NMRLayoutManager::EMRTextLayoutTextEditor ); |
147 NMRLayoutManager::EMRTextLayoutTextEditor ); |
147 } |
148 } |
148 |
149 |
149 TRect viewerRect( viewerLayoutText.TextRect() ); |
150 AknLayoutUtils::LayoutLabel( iLabel, rect, viewerLayoutText ); |
150 iLabel->SetRect( viewerRect ); |
151 TRect viewerRect( iLabel->Rect() ); |
151 |
152 |
152 // Move focus rect so that it's relative to field's position. |
153 // Move focus rect so that it's relative to field's position. |
153 viewerRect.Move( -Position() ); |
154 viewerRect.Move( -Position() ); |
154 SetFocusRect( viewerRect ); |
155 SetFocusRect( viewerRect ); |
155 |
|
156 // Setting font also for the label |
|
157 iLabel->SetFont( viewerLayoutText.Font() ); |
|
158 } |
156 } |
159 |
157 |
160 // --------------------------------------------------------------------------- |
158 // --------------------------------------------------------------------------- |
161 // CESMRViewerAlarmTimeField::CountComponentControls() |
159 // CESMRViewerAlarmTimeField::CountComponentControls() |
162 // --------------------------------------------------------------------------- |
160 // --------------------------------------------------------------------------- |
219 // --------------------------------------------------------------------------- |
217 // --------------------------------------------------------------------------- |
220 // |
218 // |
221 TBool CESMRViewerAlarmTimeField::ExecuteGenericCommandL( TInt aCommand ) |
219 TBool CESMRViewerAlarmTimeField::ExecuteGenericCommandL( TInt aCommand ) |
222 { |
220 { |
223 FUNC_LOG; |
221 FUNC_LOG; |
224 |
222 |
225 TBool retValue( EFalse ); |
223 TBool retValue( EFalse ); |
226 |
224 |
227 if( (aCommand == EAknCmdOpen) && IsLocked() ) |
225 if( (aCommand == EAknCmdOpen) && IsLocked() ) |
228 { |
226 { |
229 HandleTactileFeedbackL(); |
227 HandleTactileFeedbackL(); |
230 |
228 |
231 CESMRGlobalNote::ExecuteL( |
229 CESMRGlobalNote::ExecuteL( |
232 CESMRGlobalNote::EESMRUnableToEdit ); |
230 CESMRGlobalNote::EESMRUnableToEdit ); |
233 retValue = ETrue; |
231 retValue = ETrue; |
234 } |
232 } |
235 |
233 |
236 if ( EMRCmdDoEnvironmentChange == aCommand ) |
234 if ( EMRCmdDoEnvironmentChange == aCommand ) |
237 { |
235 { |
238 FormatAlarmTimeL(); |
236 FormatAlarmTimeL(); |
239 retValue = ETrue; |
237 retValue = ETrue; |
240 } |
238 } |
241 |
239 |
242 return retValue; |
240 return retValue; |
243 } |
241 } |
244 |
242 |
245 // --------------------------------------------------------------------------- |
243 // --------------------------------------------------------------------------- |
246 // CESMRViewerAlarmTimeField::LockL() |
244 // CESMRViewerAlarmTimeField::LockL() |
267 // --------------------------------------------------------------------------- |
265 // --------------------------------------------------------------------------- |
268 // |
266 // |
269 void CESMRViewerAlarmTimeField::FormatAlarmTimeL() |
267 void CESMRViewerAlarmTimeField::FormatAlarmTimeL() |
270 { |
268 { |
271 FUNC_LOG; |
269 FUNC_LOG; |
272 |
270 |
273 // Read format string from AVKON resource |
271 // Read format string from AVKON resource |
274 HBufC* dateFormatString = |
272 HBufC* dateFormatString = |
275 iEikonEnv->AllocReadResourceLC( R_QTN_TIME_USUAL_WITH_ZERO ); |
273 iEikonEnv->AllocReadResourceLC( R_QTN_TIME_USUAL_WITH_ZERO ); |
276 HBufC* buf = HBufC::NewLC( KBufferLength ); |
274 HBufC* buf = HBufC::NewLC( KBufferLength ); |
277 TPtr ptr( buf->Des() ); |
275 TPtr ptr( buf->Des() ); |
278 |
276 |
279 iAlarmTime.FormatL( ptr, *dateFormatString ); |
277 iAlarmTime.FormatL( ptr, *dateFormatString ); |
280 AknTextUtils::DisplayTextLanguageSpecificNumberConversion( ptr ); |
278 AknTextUtils::DisplayTextLanguageSpecificNumberConversion( ptr ); |
281 iLabel->SetTextL( ptr ); |
279 iLabel->SetTextL( ptr ); |
282 CleanupStack::PopAndDestroy( 2, dateFormatString ); |
280 CleanupStack::PopAndDestroy( 2, dateFormatString ); |
283 } |
281 } |
284 // EOF |
282 // EOF |
285 |
283 |