meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrviewerrecurrencefield.cpp
branchRCL_3
changeset 18 6b8f3b30d0ec
parent 16 b5fbb9b25d57
child 22 d620048b4810
equal deleted inserted replaced
17:67369d1b217f 18:6b8f3b30d0ec
   200     AknLayoutUtils::LayoutImage( iIcon, rect, iconLayout );
   200     AknLayoutUtils::LayoutImage( iIcon, rect, iconLayout );
   201 
   201 
   202     // Layouting lock icon
   202     // Layouting lock icon
   203     if( iLockIcon )
   203     if( iLockIcon )
   204     	{
   204     	{
   205     	TAknWindowComponentLayout iconLayout( 
   205     	TAknWindowComponentLayout iconLayout(
   206     			NMRLayoutManager::GetWindowComponentLayout( 
   206     			NMRLayoutManager::GetWindowComponentLayout(
   207     					NMRLayoutManager::EMRLayoutSingleRowDColumnGraphic ) );
   207     					NMRLayoutManager::EMRLayoutSingleRowDColumnGraphic ) );
   208     	AknLayoutUtils::LayoutImage( iLockIcon, rect, iconLayout );
   208     	AknLayoutUtils::LayoutImage( iLockIcon, rect, iconLayout );
   209     	}
   209     	}
   210         
   210 
   211     // Layouting label
   211     // Layouting label
   212     TAknLayoutText viewerLayoutText;
   212     TAknTextComponentLayout viewerLayoutText;
   213     if( iLockIcon )
   213     if( iLockIcon )
   214     	{
   214     	{
   215     	viewerLayoutText = NMRLayoutManager::GetLayoutText( rect, 
   215     	viewerLayoutText = NMRLayoutManager::GetTextComponentLayout(
   216     			NMRLayoutManager::EMRTextLayoutSingleRowEditorText );
   216     	        NMRLayoutManager::EMRTextLayoutSingleRowEditorText );
   217     	}
   217     	}
   218     else
   218     else
   219     	{
   219     	{
   220     	viewerLayoutText = NMRLayoutManager::GetLayoutText( rect, 
   220     	viewerLayoutText = NMRLayoutManager::GetTextComponentLayout(
   221     			NMRLayoutManager::EMRTextLayoutTextEditor );
   221     	        NMRLayoutManager::EMRTextLayoutTextEditor );
   222     	}
   222     	}
   223 
   223 
   224     TRect viewerRect( viewerLayoutText.TextRect() );    
   224     AknLayoutUtils::LayoutLabel( iLabel, rect, viewerLayoutText );
   225     iLabel->SetRect( viewerRect );
   225     TRect viewerRect( iLabel->Rect() );
   226 
   226 
   227     // 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.
   228     viewerRect.Move( -Position() );
   228     viewerRect.Move( -Position() );
   229     SetFocusRect( viewerRect );
   229     SetFocusRect( viewerRect );
   230 
       
   231     // Setting font also for the label
       
   232     iLabel->SetFont( viewerLayoutText.Font() );
       
   233     }
   230     }
   234 
   231 
   235 // -----------------------------------------------------------------------------
   232 // -----------------------------------------------------------------------------
   236 // CESMRViewerRecurrenceField::CountComponentControls()
   233 // CESMRViewerRecurrenceField::CountComponentControls()
   237 // -----------------------------------------------------------------------------
   234 // -----------------------------------------------------------------------------
   241     TInt count( KComponentCount );
   238     TInt count( KComponentCount );
   242     if( iLockIcon )
   239     if( iLockIcon )
   243     	{
   240     	{
   244     	++count;
   241     	++count;
   245     	}
   242     	}
   246     
   243 
   247     return count;
   244     return count;
   248     }
   245     }
   249 
   246 
   250 // -----------------------------------------------------------------------------
   247 // -----------------------------------------------------------------------------
   251 // CESMRViewerRecurrenceField::ComponentControl()
   248 // CESMRViewerRecurrenceField::ComponentControl()
   287 	FUNC_LOG;
   284 	FUNC_LOG;
   288 	if( IsLocked() )
   285 	if( IsLocked() )
   289 		{
   286 		{
   290 		return;
   287 		return;
   291 		}
   288 		}
   292 	
   289 
   293 	CESMRField::LockL();
   290 	CESMRField::LockL();
   294 	
   291 
   295 	delete iLockIcon;
   292 	delete iLockIcon;
   296 	iLockIcon = NULL;
   293 	iLockIcon = NULL;
   297 	iLockIcon = CMRImage::NewL( NMRBitmapManager::EMRBitmapLockField, ETrue );
   294 	iLockIcon = CMRImage::NewL( NMRBitmapManager::EMRBitmapLockField, ETrue );
   298 	iLockIcon->SetParent( this );
   295 	iLockIcon->SetParent( this );
   299 	}
   296 	}
   309 	TBool retValue( EFalse );
   306 	TBool retValue( EFalse );
   310 
   307 
   311 	if( (aCommand == EAknCmdOpen) && IsLocked()  )
   308 	if( (aCommand == EAknCmdOpen) && IsLocked()  )
   312 		{
   309 		{
   313 		HandleTactileFeedbackL();
   310 		HandleTactileFeedbackL();
   314 		
   311 
   315 		CESMRGlobalNote::ExecuteL(
   312 		CESMRGlobalNote::ExecuteL(
   316 				CESMRGlobalNote::EESMRUnableToEdit );
   313 				CESMRGlobalNote::EESMRUnableToEdit );
   317 		retValue = ETrue;
   314 		retValue = ETrue;
   318 		}
   315 		}
   319 
   316