diff -r 43e37759235e -r 51a74ef9ed63 Symbian3/SDK/Source/GUID-422F37DF-F93F-443F-86EA-6A696A53E1E6.dita --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Symbian3/SDK/Source/GUID-422F37DF-F93F-443F-86EA-6A696A53E1E6.dita Wed Mar 31 11:11:55 2010 +0100 @@ -0,0 +1,79 @@ + + + + + +Listening +for scrollbar touch eventsIf your custom control contains a scrollbar, you need to listen +for touch events in the scrollbar. +

For custom controls that override CCoeControl::HandleScrollEventL(), +you must also call the base class implementation of the function.

+ +Scrollbar + + +

For an implementation example, see below.

+void CMyContainerControl::HandleScrollEventL( CEikScrollBar* aScrollBar, TEikScrollEvent aEventType ) + { + if( !aScrollBar ) + { + return; + } + + TInt newPosition = aScrollBar->ThumbPosition(); + + switch( aEventType ) + { + case EEikScrollUp: // Moving up one step + { + MoveFocusUpL(); + break; + } + case EEikScrollDown: // Moving down one step + { + MoveFocusDownL(); + break; + } + case EEikScrollThumbDragVert: // Drag started + case EEikScrollThumbReleaseVert: // Drag released + { + if( newPosition < iFocusedIndex ) + { + MoveFocusUpL(); + } + else if( newPosition > iFocusedIndex ) + { + MoveFocusDownL(); + } + break; + } + case EEikScrollPageUp: + { + while( newPosition < iFocusedIndex ) + { + MoveFocusUpL(); + } + break; + } + case EEikScrollPageDown: + { + while( newPosition > iFocusedIndex ) + { + MoveFocusDownL(); + } + break; + } + default: + { + break; + } + } + DrawNow(); + } +
\ No newline at end of file