gssettingsuis/Gs/GSFramework/src/GSParentContainer.cpp
branchRCL_3
changeset 13 23553eb4e470
parent 8 f62c3a3d66b8
child 20 9941bcf99348
equal deleted inserted replaced
12:c8b9b0986973 13:23553eb4e470
   832         iListBox->View()->SetListEmptyTextL( aEmpty );
   832         iListBox->View()->SetListEmptyTextL( aEmpty );
   833         }
   833         }
   834     }
   834     }
   835 
   835 
   836 // -----------------------------------------------------------------------------
   836 // -----------------------------------------------------------------------------
   837 // CGSParentContainer::GetPositionL()
   837 // CGSParentContainer::StoreListBoxPositionL
   838 //
   838 //
   839 //Get the exact position of listbox.
   839 //Store the exact position of listbox.
   840 // -----------------------------------------------------------------------------
   840 // -----------------------------------------------------------------------------
   841 //
   841 //
   842 void CGSParentContainer::GetPositionL(RArray<TInt>& aPosition)
   842 void CGSParentContainer::StoreListBoxPositionL( CGSParentPlugin::TListBoxPosition& aPosition )
   843 	{
   843 	{
   844 	aPosition.AppendL(iListBox->CurrentItemIndex());
   844     aPosition.iCurrentItemIndex = iListBox->CurrentItemIndex();
   845 	aPosition.AppendL(iListBox->View()->ItemOffsetInPixels());
   845     aPosition.iItemOffsetInPixels = iListBox->View()->ItemOffsetInPixels();
   846 	aPosition.AppendL(iListBox->View()->TopItemIndex());
   846     aPosition.iTopItemIndex = iListBox->View()->TopItemIndex();
   847 	return;
       
   848 	}
   847 	}
   849 
   848 
   850 // -----------------------------------------------------------------------------
   849 // -----------------------------------------------------------------------------
   851 // CGSParentContainer::GetPositionL()
   850 // CGSParentContainer::RestoreListBoxPositionL
   852 //
   851 //
   853 //Get the exact position of listbox.
   852 //Restore the exact position of listbox.
   854 // -----------------------------------------------------------------------------
   853 // -----------------------------------------------------------------------------
   855 //
   854 //
   856 void CGSParentContainer::SetPosition(const RArray<TInt>& aPosition, TBool aChangeMode)
   855 void CGSParentContainer::RestoreListBoxPositionL( const CGSParentPlugin::TListBoxPosition& aPosition, TBool aScreenModeChanged )
   857 	{
   856 	{
   858     if ( aPosition.operator[](0) >= 0 )
   857     if ( aPosition.iCurrentItemIndex >= 0 )
   859         {
   858         {
   860         iListBox->SetCurrentItemIndex( aPosition.operator[](0) );
   859         iListBox->SetCurrentItemIndex( aPosition.iCurrentItemIndex );
   861         }
   860         }
   862     
   861     
   863     //iListBox->View()->SetItemOffsetInPixels( aPosition.operator[](1) );
   862     if ( aScreenModeChanged )
   864     if (aChangeMode)
   863         {
   865         {
   864         iListBox->View()->VerticalMoveToItemL( aPosition.iCurrentItemIndex,
   866         iListBox->View()->VerticalMoveToItemL( aPosition.operator[](0),
       
   867                 CListBoxView::ESingleSelection );
   865                 CListBoxView::ESingleSelection );
   868         }
   866         }
   869     else
   867     else
   870         {
   868         {
   871         iListBox->View()->SetItemOffsetInPixels( aPosition.operator[](1) );
   869         iListBox->View()->SetItemOffsetInPixels( aPosition.iItemOffsetInPixels );
   872         iListBox->View()->SetTopItemIndex( aPosition.operator[](2) );
   870         iListBox->View()->SetTopItemIndex( aPosition.iTopItemIndex );
   873         }
   871         }
   874     }
   872     }
   875 //End of File
   873 //End of File