95 // |
95 // |
96 void CESMRResponseField::ConstructL() |
96 void CESMRResponseField::ConstructL() |
97 { |
97 { |
98 FUNC_LOG; |
98 FUNC_LOG; |
99 |
99 |
|
100 CESMRField::ConstructL( NULL ); |
|
101 |
100 // Add pls resopond item to this field. |
102 // Add pls resopond item to this field. |
101 CESMRResponseItem* responseItem = |
103 CESMRResponseItem* responseItem = |
102 CESMRResponseItem::NewLC( EESMRCmdUndefined, KNullDesC, EFalse ); |
104 CESMRResponseItem::NewLC( EESMRCmdUndefined, KNullDesC, EFalse ); |
|
105 responseItem->SetContainerWindowL( *this ); |
103 iResponseItemArray.AppendL( responseItem ); |
106 iResponseItemArray.AppendL( responseItem ); |
104 CleanupStack::Pop( responseItem ); |
107 CleanupStack::Pop( responseItem ); |
105 } |
108 } |
106 |
109 |
107 // ----------------------------------------------------------------------------- |
110 // ----------------------------------------------------------------------------- |
145 { |
148 { |
146 FUNC_LOG; |
149 FUNC_LOG; |
147 TInt count( iResponseItemArray.Count() ); |
150 TInt count( iResponseItemArray.Count() ); |
148 TRect parentRect( Rect() ); |
151 TRect parentRect( Rect() ); |
149 TRect rect; |
152 TRect rect; |
150 for( TInt i = 1; i <= count; ++i ) |
153 for( TInt i = 0; i < count; ++i ) |
151 { |
154 { |
152 TAknLayoutRect choiceLayoutRect = |
155 TAknLayoutRect choiceLayoutRect = |
153 NMRLayoutManager::GetFieldRowLayoutRect( parentRect, i ); |
156 NMRLayoutManager::GetFieldRowLayoutRect( parentRect, i + 1 ); |
154 rect = parentRect; |
157 rect = parentRect; |
155 // Move the row down then it will be drawn to correct position. |
158 // Move the row down then it will be drawn to correct position. |
156 // controlIndex+1 tells the fields index. |
159 // controlIndex+1 tells the fields index. |
157 TInt movement = choiceLayoutRect.Rect().Height(); |
160 TInt movement = choiceLayoutRect.Rect().Height(); |
158 rect.Move( 0, movement * ( i - 1 ) ); |
161 rect.Move( 0, movement * i ); |
159 |
162 |
160 TInt leftMargin = choiceLayoutRect.Rect().iTl.iX; |
163 TInt leftMargin = choiceLayoutRect.Rect().iTl.iX; |
161 TInt rightMargin = choiceLayoutRect.Rect().iBr.iX; |
164 TInt rightMargin = choiceLayoutRect.Rect().iBr.iX; |
162 if ( AknLayoutUtils::LayoutMirrored() ) |
165 leftMargin -= parentRect.iTl.iX; |
163 { |
166 rightMargin -= parentRect.iTl.iX; |
164 leftMargin -= parentRect.iTl.iX; |
|
165 rightMargin -= parentRect.iTl.iX; |
|
166 } |
|
167 |
167 |
168 AknLayoutUtils::LayoutControl( |
168 AknLayoutUtils::LayoutControl( |
169 ControlItem( i - 1 ), |
169 ComponentControl( i ), |
170 rect, |
170 rect, |
171 choiceLayoutRect.Color().Value(), |
171 choiceLayoutRect.Color().Value(), |
172 leftMargin, |
172 leftMargin, |
173 0, |
173 0, |
174 rightMargin, |
174 rightMargin, |
175 choiceLayoutRect.Rect().iBr.iY, |
175 choiceLayoutRect.Rect().iBr.iY, |
176 choiceLayoutRect.Rect().Width(), |
176 choiceLayoutRect.Rect().Width(), |
177 choiceLayoutRect.Rect().Height() ); |
177 choiceLayoutRect.Rect().Height() ); |
178 } |
178 } |
|
179 RecordField(); |
179 } |
180 } |
180 |
181 |
181 // ----------------------------------------------------------------------------- |
182 // ----------------------------------------------------------------------------- |
182 // CESMRResponseField::MinimumSize |
183 // CESMRResponseField::MinimumSize |
183 // ----------------------------------------------------------------------------- |
184 // ----------------------------------------------------------------------------- |
299 if ( iConflicted ) |
300 if ( iConflicted ) |
300 { |
301 { |
301 // Construct the item to show conflicts info, and insert it to the beginning of array |
302 // Construct the item to show conflicts info, and insert it to the beginning of array |
302 CESMRResponseItem* conflictItem = |
303 CESMRResponseItem* conflictItem = |
303 CESMRResponseItem::NewLC( EESMRCmdUndefined, KNullDesC, EFalse ); |
304 CESMRResponseItem::NewLC( EESMRCmdUndefined, KNullDesC, EFalse ); |
|
305 conflictItem->SetContainerWindowL( *this ); |
304 iResponseItemArray.Insert( conflictItem, 0 ); |
306 iResponseItemArray.Insert( conflictItem, 0 ); |
305 CleanupStack::Pop( conflictItem ); |
307 CleanupStack::Pop( conflictItem ); |
306 |
308 |
307 HBufC* conflictString; |
309 HBufC* conflictString; |
308 conflictString = StringLoader::LoadLC( |
310 conflictString = StringLoader::LoadLC( |