diff -r 51a74ef9ed63 -r ae94777fff8f Symbian3/SDK/Source/GUID-422F37DF-F93F-443F-86EA-6A696A53E1E6.dita --- a/Symbian3/SDK/Source/GUID-422F37DF-F93F-443F-86EA-6A696A53E1E6.dita Wed Mar 31 11:11:55 2010 +0100 +++ b/Symbian3/SDK/Source/GUID-422F37DF-F93F-443F-86EA-6A696A53E1E6.dita Fri Jun 11 12:39:03 2010 +0100 @@ -1,79 +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(); - } + + + + + +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