meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrvieweralldayeventfield.cpp
branchRCL_3
changeset 18 6b8f3b30d0ec
parent 14 b13141f05c3d
child 22 d620048b4810
equal deleted inserted replaced
17:67369d1b217f 18:6b8f3b30d0ec
   133     AknLayoutUtils::LayoutImage( iIcon, rect, iconLayout );
   133     AknLayoutUtils::LayoutImage( iIcon, rect, iconLayout );
   134 
   134 
   135     // Layouting lock icon
   135     // Layouting lock icon
   136     if( iLockIcon )
   136     if( iLockIcon )
   137     	{
   137     	{
   138     	TAknWindowComponentLayout iconLayout( 
   138     	TAknWindowComponentLayout iconLayout(
   139     			NMRLayoutManager::GetWindowComponentLayout( 
   139     			NMRLayoutManager::GetWindowComponentLayout(
   140     					NMRLayoutManager::EMRLayoutSingleRowDColumnGraphic ) );
   140     					NMRLayoutManager::EMRLayoutSingleRowDColumnGraphic ) );
   141     	AknLayoutUtils::LayoutImage( iLockIcon, rect, iconLayout );
   141     	AknLayoutUtils::LayoutImage( iLockIcon, rect, iconLayout );
   142     	}
   142     	}
   143 
   143 
   144     // Layouting label
   144     // Layouting label
   145     TAknLayoutText viewerLayoutText;
   145     TAknTextComponentLayout viewerLayoutText;
       
   146 
   146     if( iLockIcon )
   147     if( iLockIcon )
   147     	{
   148         {
   148     	viewerLayoutText = NMRLayoutManager::GetLayoutText( rect, 
   149         viewerLayoutText = NMRLayoutManager::GetTextComponentLayout(
   149     			NMRLayoutManager::EMRTextLayoutSingleRowEditorText );
   150                 NMRLayoutManager::EMRTextLayoutSingleRowEditorText );
   150     	}
   151         }
   151     else
   152     else
   152     	{
   153         {
   153     	viewerLayoutText = NMRLayoutManager::GetLayoutText( rect, 
   154         viewerLayoutText = NMRLayoutManager::GetTextComponentLayout(
   154     			NMRLayoutManager::EMRTextLayoutTextEditor );
   155                 NMRLayoutManager::EMRTextLayoutTextEditor );
   155     	}
   156         }
   156 
   157 
   157     TRect viewerRect( viewerLayoutText.TextRect() );    
   158     AknLayoutUtils::LayoutLabel( iLabel, rect, viewerLayoutText );
   158     iLabel->SetRect( viewerRect );    
   159     TRect viewerRect( iLabel->Rect() );
   159     // Setting font for the label also
       
   160     iLabel->SetFont( viewerLayoutText.Font() );
       
   161 
       
   162 
   160 
   163     // Move focus rect so that it's relative to field's position.
   161     // Move focus rect so that it's relative to field's position.
   164     viewerRect.Move( -Position() );
   162     viewerRect.Move( -Position() );
   165     SetFocusRect( viewerRect );
   163     SetFocusRect( viewerRect );
   166     }
   164     }
   227 	FUNC_LOG;
   225 	FUNC_LOG;
   228 	if( IsLocked() )
   226 	if( IsLocked() )
   229 		{
   227 		{
   230 		return;
   228 		return;
   231 		}
   229 		}
   232 	
   230 
   233 	CESMRField::LockL();
   231 	CESMRField::LockL();
   234 	
   232 
   235 	delete iLockIcon;
   233 	delete iLockIcon;
   236 	iLockIcon = NULL;
   234 	iLockIcon = NULL;
   237 	iLockIcon = CMRImage::NewL( NMRBitmapManager::EMRBitmapLockField, ETrue );
   235 	iLockIcon = CMRImage::NewL( NMRBitmapManager::EMRBitmapLockField, ETrue );
   238 	iLockIcon->SetParent( this );
   236 	iLockIcon->SetParent( this );
   239 	}
   237 	}
   243 // ---------------------------------------------------------------------------
   241 // ---------------------------------------------------------------------------
   244 //
   242 //
   245 TBool CESMRViewerAllDayEventField::ExecuteGenericCommandL( TInt aCommand )
   243 TBool CESMRViewerAllDayEventField::ExecuteGenericCommandL( TInt aCommand )
   246 	{
   244 	{
   247     FUNC_LOG;
   245     FUNC_LOG;
   248     
   246 
   249     TBool retValue( EFalse );
   247     TBool retValue( EFalse );
   250     
   248 
   251     if( (aCommand == EAknCmdOpen) && IsLocked()  )
   249     if( (aCommand == EAknCmdOpen) && IsLocked()  )
   252     	{
   250     	{
   253 		HandleTactileFeedbackL();
   251 		HandleTactileFeedbackL();
   254 		
   252 
   255     	CESMRGlobalNote::ExecuteL(
   253     	CESMRGlobalNote::ExecuteL(
   256     	                    CESMRGlobalNote::EESMRUnableToEdit );
   254     	                    CESMRGlobalNote::EESMRUnableToEdit );
   257     	retValue = ETrue;
   255     	retValue = ETrue;
   258     	}
   256     	}
   259     
   257 
   260     return retValue;
   258     return retValue;
   261 	}
   259 	}
   262 
   260 
   263 // EOF
   261 // EOF