gssettingsuis/Gs/GSFramework/src/GSParentContainer.cpp
branchRCL_3
changeset 8 f62c3a3d66b8
parent 0 8c5d936e5675
child 13 23553eb4e470
equal deleted inserted replaced
4:3f8368f032cf 8:f62c3a3d66b8
   837 // CGSParentContainer::GetPositionL()
   837 // CGSParentContainer::GetPositionL()
   838 //
   838 //
   839 //Get the exact position of listbox.
   839 //Get the exact position of listbox.
   840 // -----------------------------------------------------------------------------
   840 // -----------------------------------------------------------------------------
   841 //
   841 //
   842 void CGSParentContainer::GetPositionL(RArray<TInt>& posArray)
   842 void CGSParentContainer::GetPositionL(RArray<TInt>& aPosition)
   843 	{
   843 	{
   844 	posArray.AppendL(iListBox->CurrentItemIndex());
   844 	aPosition.AppendL(iListBox->CurrentItemIndex());
   845 	posArray.AppendL(iListBox->View()->ItemOffsetInPixels());
   845 	aPosition.AppendL(iListBox->View()->ItemOffsetInPixels());
   846 	posArray.AppendL(iListBox->View()->TopItemIndex());
   846 	aPosition.AppendL(iListBox->View()->TopItemIndex());
   847 	return;
   847 	return;
   848 	}
   848 	}
   849 
   849 
   850 // -----------------------------------------------------------------------------
   850 // -----------------------------------------------------------------------------
   851 // CGSParentContainer::GetPositionL()
   851 // CGSParentContainer::GetPositionL()
   852 //
   852 //
   853 //Get the exact position of listbox.
   853 //Get the exact position of listbox.
   854 // -----------------------------------------------------------------------------
   854 // -----------------------------------------------------------------------------
   855 //
   855 //
   856 void CGSParentContainer::SetPosition(const RArray<TInt>& pos, TBool aChangeMode)
   856 void CGSParentContainer::SetPosition(const RArray<TInt>& aPosition, TBool aChangeMode)
   857 	{
   857 	{
   858 	iListBox->SetCurrentItemIndex(pos.operator[](0));
   858     if ( aPosition.operator[](0) >= 0 )
   859 	iListBox->View()->SetItemOffsetInPixels(pos.operator[](1));
   859         {
   860 	if (aChangeMode)
   860         iListBox->SetCurrentItemIndex( aPosition.operator[](0) );
   861 		{
   861         }
   862 		iListBox->View()->VerticalMoveToItemL(pos.operator[](0), CListBoxView::ESingleSelection);
   862     
   863 		}
   863     //iListBox->View()->SetItemOffsetInPixels( aPosition.operator[](1) );
   864 	else
   864     if (aChangeMode)
   865 		{
   865         {
   866 		iListBox->View()->SetTopItemIndex(pos.operator[](2));
   866         iListBox->View()->VerticalMoveToItemL( aPosition.operator[](0),
   867 		}
   867                 CListBoxView::ESingleSelection );
   868 	}
   868         }
       
   869     else
       
   870         {
       
   871         iListBox->View()->SetItemOffsetInPixels( aPosition.operator[](1) );
       
   872         iListBox->View()->SetTopItemIndex( aPosition.operator[](2) );
       
   873         }
       
   874     }
   869 //End of File
   875 //End of File