meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrvieweralarmfield.cpp
branchRCL_3
changeset 18 6b8f3b30d0ec
parent 16 b5fbb9b25d57
child 22 d620048b4810
equal deleted inserted replaced
17:67369d1b217f 18:6b8f3b30d0ec
   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 // ---------------------------------------------------------------------------
   246 
   244 
   247     if ( iLabel )
   245     if ( iLabel )
   248         {
   246         {
   249         ++count;
   247         ++count;
   250         }
   248         }
   251     
   249 
   252     if ( iLockIcon )
   250     if ( iLockIcon )
   253     	{
   251     	{
   254     	++count;
   252     	++count;
   255     	}
   253     	}
   256     return count;
   254     return count;
   297 	FUNC_LOG;
   295 	FUNC_LOG;
   298 	if( IsLocked() )
   296 	if( IsLocked() )
   299 		{
   297 		{
   300 		return;
   298 		return;
   301 		}
   299 		}
   302 	
   300 
   303 	CESMRField::LockL();
   301 	CESMRField::LockL();
   304 	
   302 
   305 	delete iLockIcon;
   303 	delete iLockIcon;
   306 	iLockIcon = NULL;
   304 	iLockIcon = NULL;
   307 	iLockIcon = CMRImage::NewL( NMRBitmapManager::EMRBitmapLockField, ETrue );
   305 	iLockIcon = CMRImage::NewL( NMRBitmapManager::EMRBitmapLockField, ETrue );
   308 	iLockIcon->SetParent( this );
   306 	iLockIcon->SetParent( this );
   309 	}
   307 	}
   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