meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrviewerpriorityfield.cpp
branchRCL_3
changeset 29 6b8f3b30d0ec
parent 24 b5fbb9b25d57
child 60 d620048b4810
equal deleted inserted replaced
26:67369d1b217f 29:6b8f3b30d0ec
    79     {
    79     {
    80     FUNC_LOG;
    80     FUNC_LOG;
    81     iLabel = CMRLabel::NewL();
    81     iLabel = CMRLabel::NewL();
    82     iLabel->SetParent( this );
    82     iLabel->SetParent( this );
    83     CESMRField::ConstructL( iLabel ); // ownership transfered
    83     CESMRField::ConstructL( iLabel ); // ownership transfered
    84     
    84 
    85     iIcon = CMRImage::NewL( NMRBitmapManager::EMRBitmapPriorityNormal );
    85     iIcon = CMRImage::NewL( NMRBitmapManager::EMRBitmapPriorityNormal );
    86     iIcon->SetParent( this );
    86     iIcon->SetParent( this );
    87     
    87 
    88     HBufC* priorityText = StringLoader::LoadLC(
    88     HBufC* priorityText = StringLoader::LoadLC(
    89                         R_QTN_CALENDAR_MEETING_OPT_PRIORITY_NORMAL,
    89                         R_QTN_CALENDAR_MEETING_OPT_PRIORITY_NORMAL,
    90                         iEikonEnv );
    90                         iEikonEnv );
    91     iLabel->SetTextL( *priorityText );
    91     iLabel->SetTextL( *priorityText );
    92     CleanupStack::PopAndDestroy( priorityText );
    92     CleanupStack::PopAndDestroy( priorityText );
   180     FUNC_LOG;
   180     FUNC_LOG;
   181     TRect rect = Rect();
   181     TRect rect = Rect();
   182     TAknLayoutRect rowLayoutRect =
   182     TAknLayoutRect rowLayoutRect =
   183         NMRLayoutManager::GetFieldRowLayoutRect( rect, 1 );
   183         NMRLayoutManager::GetFieldRowLayoutRect( rect, 1 );
   184     rect = rowLayoutRect.Rect();
   184     rect = rowLayoutRect.Rect();
   185     
   185 
   186     TAknWindowComponentLayout iconLayout =
   186     TAknWindowComponentLayout iconLayout =
   187         NMRLayoutManager::GetWindowComponentLayout( 
   187         NMRLayoutManager::GetWindowComponentLayout(
   188                 NMRLayoutManager::EMRLayoutTextEditorIcon );
   188                 NMRLayoutManager::EMRLayoutTextEditorIcon );
   189     AknLayoutUtils::LayoutImage( iIcon, rect, iconLayout );
   189     AknLayoutUtils::LayoutImage( iIcon, rect, iconLayout );
   190     
   190 
   191     // Layouting lock icon
   191     // Layouting lock icon
   192     if( iLockIcon )
   192     if( iLockIcon )
   193     	{
   193     	{
   194     	TAknWindowComponentLayout iconLayout( 
   194     	TAknWindowComponentLayout iconLayout(
   195     			NMRLayoutManager::GetWindowComponentLayout( 
   195     			NMRLayoutManager::GetWindowComponentLayout(
   196     					NMRLayoutManager::EMRLayoutSingleRowDColumnGraphic ) );
   196     					NMRLayoutManager::EMRLayoutSingleRowDColumnGraphic ) );
   197     	AknLayoutUtils::LayoutImage( iLockIcon, rect, iconLayout );
   197     	AknLayoutUtils::LayoutImage( iLockIcon, rect, iconLayout );
   198     	}
   198     	}
   199     
   199 
   200     // Layouting label
   200     // Layouting label
   201     TAknLayoutText viewerLayoutText;
   201     TAknTextComponentLayout viewerLayoutText;
       
   202 
   202     if( iLockIcon )
   203     if( iLockIcon )
   203     	{
   204         {
   204     	viewerLayoutText = NMRLayoutManager::GetLayoutText( rect, 
   205         viewerLayoutText = NMRLayoutManager::GetTextComponentLayout(
   205     			NMRLayoutManager::EMRTextLayoutSingleRowEditorText );
   206                 NMRLayoutManager::EMRTextLayoutSingleRowEditorText );
   206     	}
   207         }
   207     else
   208     else
   208     	{
   209         {
   209     	viewerLayoutText = NMRLayoutManager::GetLayoutText( rect, 
   210         viewerLayoutText = NMRLayoutManager::GetTextComponentLayout(
   210     			NMRLayoutManager::EMRTextLayoutTextEditor );
   211                 NMRLayoutManager::EMRTextLayoutTextEditor );
   211     	}
   212         }
   212 
   213 
   213     TRect viewerRect( viewerLayoutText.TextRect() );    
   214     AknLayoutUtils::LayoutLabel( iLabel, rect, viewerLayoutText );
   214     iLabel->SetRect( viewerRect );
   215     TRect viewerRect( iLabel->Rect() );
   215 
   216 
   216     // Move focus rect so that it's relative to field's position.
   217     // Move focus rect so that it's relative to field's position.
   217     viewerRect.Move( -Position() );
   218     viewerRect.Move( -Position() );
   218     SetFocusRect( viewerRect );
   219     SetFocusRect( viewerRect );
   219 
       
   220     // Setting font also for the label
       
   221     iLabel->SetFont( viewerLayoutText.Font() );
       
   222     }
   220     }
   223 
   221 
   224 // ---------------------------------------------------------------------------
   222 // ---------------------------------------------------------------------------
   225 // CESMRViewerPriorityField::CountComponentControls()
   223 // CESMRViewerPriorityField::CountComponentControls()
   226 // ---------------------------------------------------------------------------
   224 // ---------------------------------------------------------------------------
   271 //
   269 //
   272 void CESMRViewerPriorityField::SetOutlineFocusL( TBool aFocus )
   270 void CESMRViewerPriorityField::SetOutlineFocusL( TBool aFocus )
   273     {
   271     {
   274     FUNC_LOG;
   272     FUNC_LOG;
   275     CESMRField::SetOutlineFocusL ( aFocus );
   273     CESMRField::SetOutlineFocusL ( aFocus );
   276     
   274 
   277     iLabel->SetFocus( aFocus );    
   275     iLabel->SetFocus( aFocus );
   278     }
   276     }
   279 
   277 
   280 // ---------------------------------------------------------------------------
   278 // ---------------------------------------------------------------------------
   281 // CESMRViewerPriorityField::LockL()
   279 // CESMRViewerPriorityField::LockL()
   282 // ---------------------------------------------------------------------------
   280 // ---------------------------------------------------------------------------
   286 	FUNC_LOG;
   284 	FUNC_LOG;
   287 	if( IsLocked() )
   285 	if( IsLocked() )
   288 		{
   286 		{
   289 		return;
   287 		return;
   290 		}
   288 		}
   291 	
   289 
   292 	CESMRField::LockL();
   290 	CESMRField::LockL();
   293 	
   291 
   294 	delete iLockIcon;
   292 	delete iLockIcon;
   295 	iLockIcon = NULL;
   293 	iLockIcon = NULL;
   296 	iLockIcon = CMRImage::NewL( NMRBitmapManager::EMRBitmapLockField, ETrue );
   294 	iLockIcon = CMRImage::NewL( NMRBitmapManager::EMRBitmapLockField, ETrue );
   297 	iLockIcon->SetParent( this );
   295 	iLockIcon->SetParent( this );
   298 	}
   296 	}
   308 	TBool retValue( EFalse );
   306 	TBool retValue( EFalse );
   309 
   307 
   310 	if( (aCommand == EAknCmdOpen) && IsLocked()  )
   308 	if( (aCommand == EAknCmdOpen) && IsLocked()  )
   311 		{
   309 		{
   312 		HandleTactileFeedbackL();
   310 		HandleTactileFeedbackL();
   313 		
   311 
   314 		CESMRGlobalNote::ExecuteL(
   312 		CESMRGlobalNote::ExecuteL(
   315 				CESMRGlobalNote::EESMRUnableToEdit );
   313 				CESMRGlobalNote::EESMRUnableToEdit );
   316 		retValue = ETrue;
   314 		retValue = ETrue;
   317 		}
   315 		}
   318 
   316