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