489 // CGSParentContainer::GetPositionL() |
489 // CGSParentContainer::GetPositionL() |
490 // |
490 // |
491 //Get the exact position of listbox. |
491 //Get the exact position of listbox. |
492 // ----------------------------------------------------------------------------- |
492 // ----------------------------------------------------------------------------- |
493 // |
493 // |
494 void CGSMainContainer::GetPositionL(RArray<TInt>& posArray) |
494 void CGSMainContainer::GetPositionL(RArray<TInt>& aPosition) |
495 { |
495 { |
496 posArray.AppendL(iListBox->CurrentItemIndex()); |
496 aPosition.AppendL(iListBox->CurrentItemIndex()); |
497 posArray.AppendL(iListBox->View()->ItemOffsetInPixels()); |
497 aPosition.AppendL(iListBox->View()->ItemOffsetInPixels()); |
498 posArray.AppendL(iListBox->View()->TopItemIndex()); |
498 aPosition.AppendL(iListBox->View()->TopItemIndex()); |
499 return; |
499 return; |
500 } |
500 } |
501 |
501 |
502 // ----------------------------------------------------------------------------- |
502 // ----------------------------------------------------------------------------- |
503 // CGSParentContainer::GetPositionL() |
503 // CGSParentContainer::GetPositionL() |
504 // |
504 // |
505 //Get the exact position of listbox. |
505 //Get the exact position of listbox. |
506 // ----------------------------------------------------------------------------- |
506 // ----------------------------------------------------------------------------- |
507 // |
507 // |
508 void CGSMainContainer::SetPosition(const RArray<TInt>& pos, TBool aChangeMode) |
508 void CGSMainContainer::SetPosition(const RArray<TInt>& aPosition, TBool aChangeMode) |
509 { |
509 { |
510 iListBox->SetCurrentItemIndex(pos.operator[](0)); |
510 if ( aPosition.operator[](0) >= 0 ) |
511 |
511 { |
512 if (aChangeMode) |
512 iListBox->SetCurrentItemIndex( aPosition.operator[](0) ); |
513 { |
513 } |
514 iListBox->View()->VerticalMoveToItemL(pos.operator[](0), |
514 |
515 CListBoxView::ESingleSelection); |
515 if (aChangeMode) |
516 } |
516 { |
517 else |
517 iListBox->View()->VerticalMoveToItemL( aPosition.operator[](0 ), |
518 { |
518 CListBoxView::ESingleSelection); |
519 iListBox->View()->SetItemOffsetInPixels(pos.operator[](1)); |
519 } |
520 iListBox->View()->SetTopItemIndex(pos.operator[](2)); |
520 else |
521 } |
521 { |
522 } |
522 iListBox->View()->SetItemOffsetInPixels( aPosition.operator[](1) ); |
|
523 iListBox->View()->SetTopItemIndex( aPosition.operator[](2) ); |
|
524 } |
|
525 } |
523 // End of File |
526 // End of File |