Moving scrollbar thumb on CEikScrollBarFrame
tanjaluodes
(Talk | contribs) m |
hamishwillee
(Talk | contribs) m (Hamishwillee - Bot change of template (Template:CodeSnippet) - now using Template:ArticleMetaData) |
||
| Line 2: | Line 2: | ||
__NOEDITSECTION__ | __NOEDITSECTION__ | ||
{{KBCS}} | {{KBCS}} | ||
| − | {{ | + | {{ArticleMetaData |
|id=CS000885 | |id=CS000885 | ||
|platform=S60 3rd Edition, FP1 | |platform=S60 3rd Edition, FP1 | ||
| Line 10: | Line 10: | ||
|creationdate=April 7, 2008 | |creationdate=April 7, 2008 | ||
|keywords=CEikScrollBarFrame, TAknDoubleSpanScrollBarModel, TAknDoubleSpanScrollBarModel::SetFocusPosition(), CEikScrollBarFrame::SetVFocusPosToThumbPos() | |keywords=CEikScrollBarFrame, TAknDoubleSpanScrollBarModel, TAknDoubleSpanScrollBarModel::SetFocusPosition(), CEikScrollBarFrame::SetVFocusPosToThumbPos() | ||
| + | |||
| + | |sourcecode= <!-- Link to example source code (e.g. [[Media:The Code Example ZIP.zip]]) --> | ||
| + | |installfile= <!-- Link to installation file (e.g. [[Media:The Installation File.sis]]) --> | ||
| + | |sdk=<!-- SDK(s) built and tested against (e.g. [http://linktosdkdownload/ Nokia Qt SDK 1.1]) --> | ||
| + | |devicecompatability=<!-- Compatible devices (e.g.: All* (must have GPS) ) --> | ||
| + | |signing=<!-- Empty or one of Self-Signed, DevCert, Manufacturer --> | ||
| + | |capabilities=<!-- Capabilities required (e.g. Location, NetworkServices. -->) | ||
| + | |author=[[User:Tapiolaitinen]] | ||
}} | }} | ||
Revision as of 11:21, 24 June 2011
Article Metadata
Tested with
Devices(s): Nokia N95 8GB
Compatibility
Platform(s): S60 3rd Edition, FP1
Platform Security
Capabilities: )
Article
Keywords: CEikScrollBarFrame, TAknDoubleSpanScrollBarModel, TAknDoubleSpanScrollBarModel::SetFocusPosition(), CEikScrollBarFrame::SetVFocusPosToThumbPos()
Created: tapiolaitinen
(07 Apr 2008)
Last edited: hamishwillee
(24 Jun 2011)
Overview
This snippet demonstrates how to move the scrollbar thumb to a certain position. This is useful, for example, after an external scroll (such as a scroll caused by program code).
This snippet can be self-signed.
MMP file
The following libraries are required:
LIBRARY eikcoctl.lib
Header file
#include <eiksbfrm.h> // CEikScrollBarFrame
#include <eikscrlb.h> // TAknDoubleSpanScrollBarModel
CEikScrollBarFrame* iScrollBarFrame;
TAknDoubleSpanScrollBarModel iVModel;
Source file
The following code updates the scrollbar model and moves the vertical scrollbar thumb to a position specified by the model. The code could be written in CMyContainer::OfferKeyEventL(), for example.
// Update the model. Naturally, number 10 would be calculated, not specified
// as a magic number constant.
iVModel.SetFocusPosition(10);
// Move the scrollbar thumb to model position
iScrollBarFrame->SetVFocusPosToThumbPos(iVModel.FocusPosition());
Postconditions
The thumb of the vertical scrollbar moves to the position specified by the scrollbar model.

