Namespaces

Variants
Actions

Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.

Listening for scrollbar events using Symbian C++

From Wiki
Jump to: navigation, search
Article Metadata
Code ExampleCompatibilityPlatform Security
Signing Required: Self-Signed
Capabilities: None
Article
Keywords: MEikScrollBarObserver, MEikScrollBarObserver::HandleScrollEventL()
Created: tapiolaitinen (01 Apr 2008)
Last edited: hamishwillee (06 Aug 2012)

Contents

Overview

This snippet demonstrates how to listen for scrollbar events.

Note.pngNote: MEikScrollBarObserver::HandleScrollEventL() used in this snippet requires Touch UI support.

MMP file

The following libraries are required:

LIBRARY eikcoctl.lib

Header file

#include <coecntrl.h>  // CCoeControl
#include <eiksbobs.h> // MEikScrollBarObserver
 
class CMyContainer : public CCoeControl, public MEikScrollBarObserver
{
// ...
 
private: // Functions from base classes
/**
* From MEikScrollBarObserver.
*/

void HandleScrollEventL(CEikScrollBar* aScrollBar,
TEikScrollEvent aEventType);
};

Source file

#include <eiksbfrm.h>  // CEikScrollBarFrame
/**
* From MEikScrollBarObserver.
*/

void CMyContainer::HandleScrollEventL(CEikScrollBar* aScrollBar,
TEikScrollEvent aEventType)
{
if (!aScrollBar)
{
return;
}
 
switch (aEventType)
{
case EEikScrollLeft:
{
// Moving left one step
break;
}
case EEikScrollRight:
{
// Moving right one step
break;
}
 
case EEikScrollUp:
{
// Moving up one step
break;
}
case EEikScrollDown:
{
// Moving down one step
break;
}
 
case EEikScrollPageLeft:
{
// Moving left one page
break;
}
case EEikScrollPageRight:
{
// Moving right one page
break;
}
 
case EEikScrollPageUp:
{
// Moving up one page
break;
}
case EEikScrollPageDown:
{
// Moving down one page
break;
}
 
case EEikScrollThumbDragHoriz:
{
// Horizontal drag started
break;
}
case EEikScrollThumbReleaseHoriz:
{
// Horizontal drag released
break;
}
 
case EEikScrollThumbDragVert:
{
// Vertical drag started
break;
}
case EEikScrollThumbReleaseVert:
{
// Vertical drag released
break;
}
 
case EEikScrollHome:
{
// Scrolled to the beginning (horiz.)
break;
}
case EEikScrollEnd:
{
// Scrolled to the end (horiz.)
break;
}
 
case EEikScrollTop:
{
// Scrolled to the top (vert.)
break;
}
case EEikScrollBottom:
{
// Scrolled to the bottom (vert.)
break;
}
 
default:
{
break;
}
}
}

Postconditions

The application listens for scrollbar events.

See also

For information about implementing scrollbars, see File:CustomControl.zip.

This page was last modified on 6 August 2012, at 05:40.
79 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×