meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrresponsefield.cpp
branchRCL_3
changeset 60 d620048b4810
parent 29 6b8f3b30d0ec
--- a/meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrresponsefield.cpp	Mon Jun 21 15:20:54 2010 +0300
+++ b/meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrresponsefield.cpp	Thu Jul 15 18:19:25 2010 +0300
@@ -97,9 +97,12 @@
     {
     FUNC_LOG;
 
+    CESMRField::ConstructL( NULL );
+
     // Add pls resopond item to this field.
     CESMRResponseItem* responseItem =
         CESMRResponseItem::NewLC( EESMRCmdUndefined, KNullDesC, EFalse );
+    responseItem->SetContainerWindowL( *this );
     iResponseItemArray.AppendL( responseItem );
     CleanupStack::Pop( responseItem );
     }
@@ -147,26 +150,23 @@
     TInt count( iResponseItemArray.Count() );
     TRect parentRect( Rect() );
     TRect rect;
-    for( TInt i = 1; i <= count; ++i )
+    for( TInt i = 0; i < count; ++i )
         {
         TAknLayoutRect choiceLayoutRect =
-            NMRLayoutManager::GetFieldRowLayoutRect( parentRect, i );
+            NMRLayoutManager::GetFieldRowLayoutRect( parentRect, i + 1 );
         rect = parentRect;
         // Move the row down then it will be drawn to correct position.
         // controlIndex+1 tells the fields index.
         TInt movement = choiceLayoutRect.Rect().Height();
-        rect.Move( 0, movement * ( i - 1 ) );
+        rect.Move( 0, movement * i );
 
         TInt leftMargin = choiceLayoutRect.Rect().iTl.iX;
         TInt rightMargin = choiceLayoutRect.Rect().iBr.iX;
-        if ( AknLayoutUtils::LayoutMirrored() )
-            {
-            leftMargin -= parentRect.iTl.iX;
-            rightMargin -= parentRect.iTl.iX;
-            }
+        leftMargin -= parentRect.iTl.iX;
+        rightMargin -= parentRect.iTl.iX;
 
         AknLayoutUtils::LayoutControl(
-                ControlItem( i - 1 ),
+                ComponentControl( i ),
                 rect,
                 choiceLayoutRect.Color().Value(),
                 leftMargin,
@@ -176,6 +176,7 @@
                 choiceLayoutRect.Rect().Width(),
                 choiceLayoutRect.Rect().Height() );
         }
+    RecordField();
     }
 
 // -----------------------------------------------------------------------------
@@ -301,6 +302,7 @@
         // Construct the item to show conflicts info, and insert it to the beginning of array
         CESMRResponseItem* conflictItem =
             CESMRResponseItem::NewLC( EESMRCmdUndefined, KNullDesC, EFalse );
+        conflictItem->SetContainerWindowL( *this );
         iResponseItemArray.Insert( conflictItem, 0 );
         CleanupStack::Pop( conflictItem );
 
@@ -689,20 +691,5 @@
     return handled;
     }
 
-// -----------------------------------------------------------------------------
-// CESMRResponseField::ControlItem
-// -----------------------------------------------------------------------------
-//
-CCoeControl* CESMRResponseField::ControlItem( TInt aIndex )
-    {
-    CCoeControl* control = NULL;
-    if( aIndex < iResponseItemArray.Count() )
-        {
-        control = static_cast<CCoeControl*>( iResponseItemArray[aIndex] );
-        }
-
-    return control;
-    }
-
 // EOF