uifw/ganes/src/HgScroller.cpp
branchRCL_3
changeset 10 9f56a4e1b8ab
parent 9 aabf2c525e0f
child 15 08e69e956a8c
equal deleted inserted replaced
9:aabf2c525e0f 10:9f56a4e1b8ab
   205 //
   205 //
   206 EXPORT_C void CHgScroller::SetSelectedIndex( TInt aIndex )
   206 EXPORT_C void CHgScroller::SetSelectedIndex( TInt aIndex )
   207     {
   207     {
   208     if( aIndex >= 0 && aIndex < iItems.Count() )
   208     if( aIndex >= 0 && aIndex < iItems.Count() )
   209         {
   209         {
       
   210         iSelectedIndex = iItems.Count() - 1;
       
   211         FitSelectionToView();
       
   212         
   210         iSelectedIndex = aIndex;
   213         iSelectedIndex = aIndex;
   211         // Move view position so that it is fully visible.
   214         // Move view position so that it is fully visible.
   212         FitSelectionToView();
   215         FitSelectionToView();
   213         SelectionChanged();
   216         SelectionChanged();
   214         }
   217         }
   538 //
   541 //
   539 void CHgScroller::InitScrollbarL()
   542 void CHgScroller::InitScrollbarL()
   540     {
   543     {
   541     if( iScrollbar && iItemCount )
   544     if( iScrollbar && iItemCount )
   542         {
   545         {
       
   546         TBool prevStatic = iScrollbar->IsStatic();
   543         iScrollbar->InitScrollBarL( Rect(), 
   547         iScrollbar->InitScrollBarL( Rect(), 
   544                                     TotalSize(), 
   548                                     TotalSize(), 
   545                                     TSize(iWidth, iHeight), 
   549                                     TSize(iWidth, iHeight), 
   546                                     iLandscapeScrolling); 
   550                                     iLandscapeScrolling); 
   547 
   551 
   548         iScrollbar->SetViewPosition( iViewPosition - TPoint(iWidth/2, iHeight/2));
   552         iScrollbar->SetViewPosition( iViewPosition - TPoint(iWidth/2, iHeight/2));
       
   553         
       
   554         if(prevStatic != iScrollbar->IsStatic())
       
   555             HandleScrollbarVisibilityChange(iScrollbar->IsStatic());
   549         }
   556         }
   550     }
   557     }
   551 // -----------------------------------------------------------------------------
   558 // -----------------------------------------------------------------------------
   552 // CHgScroller::HandlePointerEventL()
   559 // CHgScroller::HandlePointerEventL()
   553 // -----------------------------------------------------------------------------
   560 // -----------------------------------------------------------------------------
  1753         iCoeEnv->ScreenDevice()->ReleaseFont(iPopupFont);
  1760         iCoeEnv->ScreenDevice()->ReleaseFont(iPopupFont);
  1754         iPopupFont = NULL;
  1761         iPopupFont = NULL;
  1755         }
  1762         }
  1756     }
  1763     }
  1757 
  1764 
  1758 
       
  1759 // End of File
  1765 // End of File