meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrviewersyncfield.cpp
branchRCL_3
changeset 29 6b8f3b30d0ec
parent 24 b5fbb9b25d57
child 60 d620048b4810
equal deleted inserted replaced
26:67369d1b217f 29:6b8f3b30d0ec
   166     AknLayoutUtils::LayoutImage( iIcon, rect, iconLayout );
   166     AknLayoutUtils::LayoutImage( iIcon, rect, iconLayout );
   167 
   167 
   168     // Layouting lock icon
   168     // Layouting lock icon
   169     if( iLockIcon )
   169     if( iLockIcon )
   170     	{
   170     	{
   171     	TAknWindowComponentLayout iconLayout( 
   171     	TAknWindowComponentLayout iconLayout(
   172     			NMRLayoutManager::GetWindowComponentLayout( 
   172     			NMRLayoutManager::GetWindowComponentLayout(
   173     					NMRLayoutManager::EMRLayoutSingleRowDColumnGraphic ) );
   173     					NMRLayoutManager::EMRLayoutSingleRowDColumnGraphic ) );
   174     	AknLayoutUtils::LayoutImage( iLockIcon, rect, iconLayout );
   174     	AknLayoutUtils::LayoutImage( iLockIcon, rect, iconLayout );
   175     	}
   175     	}
   176         
   176 
   177     // Layouting label
   177     // Layouting label
   178     TAknLayoutText viewerLayoutText;
   178     TAknTextComponentLayout viewerLayoutText;
   179     if( iLockIcon )
   179     if( iLockIcon )
   180     	{
   180         {
   181     	viewerLayoutText = NMRLayoutManager::GetLayoutText( rect, 
   181         viewerLayoutText = NMRLayoutManager::GetTextComponentLayout(
   182     			NMRLayoutManager::EMRTextLayoutSingleRowEditorText );
   182                 NMRLayoutManager::EMRTextLayoutSingleRowEditorText );
   183     	}
   183         }
   184     else
   184     else
   185     	{
   185         {
   186     	viewerLayoutText = NMRLayoutManager::GetLayoutText( rect, 
   186         viewerLayoutText = NMRLayoutManager::GetTextComponentLayout(
   187     			NMRLayoutManager::EMRTextLayoutTextEditor );
   187                 NMRLayoutManager::EMRTextLayoutTextEditor );
   188     	}
   188         }
   189 
   189 
   190     TRect viewerRect( viewerLayoutText.TextRect() );    
   190     AknLayoutUtils::LayoutLabel( iLabel, rect, viewerLayoutText );
   191     iLabel->SetRect( viewerRect );
   191     TRect viewerRect( iLabel->Rect() );
   192 
   192 
   193     // Move focus rect so that it's relative to field's position.
   193     // Move focus rect so that it's relative to field's position.
   194     viewerRect.Move( -Position() );
   194     viewerRect.Move( -Position() );
   195     SetFocusRect( viewerRect );
   195     SetFocusRect( viewerRect );
   196 
       
   197     // Setting font also for the label
       
   198     iLabel->SetFont( viewerLayoutText.Font() );
       
   199     }
   196     }
   200 
   197 
   201 // ---------------------------------------------------------------------------
   198 // ---------------------------------------------------------------------------
   202 // CESMRViewerSyncField::CountComponentControls()
   199 // CESMRViewerSyncField::CountComponentControls()
   203 // ---------------------------------------------------------------------------
   200 // ---------------------------------------------------------------------------
   260 	FUNC_LOG;
   257 	FUNC_LOG;
   261 	if( IsLocked() )
   258 	if( IsLocked() )
   262 		{
   259 		{
   263 		return;
   260 		return;
   264 		}
   261 		}
   265 	
   262 
   266 	CESMRField::LockL();
   263 	CESMRField::LockL();
   267 	
   264 
   268 	delete iLockIcon;
   265 	delete iLockIcon;
   269 	iLockIcon = NULL;
   266 	iLockIcon = NULL;
   270 	iLockIcon = CMRImage::NewL( NMRBitmapManager::EMRBitmapLockField, ETrue );
   267 	iLockIcon = CMRImage::NewL( NMRBitmapManager::EMRBitmapLockField, ETrue );
   271 	iLockIcon->SetParent( this );
   268 	iLockIcon->SetParent( this );
   272 	}
   269 	}
   282 	TBool retValue( EFalse );
   279 	TBool retValue( EFalse );
   283 
   280 
   284 	if( (aCommand == EAknCmdOpen) && IsLocked()  )
   281 	if( (aCommand == EAknCmdOpen) && IsLocked()  )
   285 		{
   282 		{
   286 		HandleTactileFeedbackL();
   283 		HandleTactileFeedbackL();
   287 		
   284 
   288 		CESMRGlobalNote::ExecuteL(
   285 		CESMRGlobalNote::ExecuteL(
   289 				CESMRGlobalNote::EESMRUnableToEdit );
   286 				CESMRGlobalNote::EESMRUnableToEdit );
   290 		retValue = ETrue;
   287 		retValue = ETrue;
   291 		}
   288 		}
   292 
   289