Moving scrollbar thumb on CEikScrollBarFrame
hamishwillee
(Talk | contribs) m (Hamishwillee - Bot change of template (Template:CodeSnippet) - now using Template:ArticleMetaData) |
hamishwillee
(Talk | contribs) m (Hamishwillee - Bot update - Fix metadata etc) |
||
| Line 1: | Line 1: | ||
| − | + | {{ArticleMetaData <!-- v1.2 --> | |
| − | + | ||
| − | + | ||
| − | {{ArticleMetaData | + | |
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
|sourcecode= <!-- Link to example source code (e.g. [[Media:The Code Example ZIP.zip]]) --> | |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]]) --> | |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]) --> | + | |devices= Nokia N95 8GB |
| − | |devicecompatability=<!-- Compatible devices (e.g.: All* (must have GPS) ) --> | + | |sdk= <!-- SDK(s) built and tested against (e.g. [http://linktosdkdownload/ Nokia Qt SDK 1.1]) --> |
| − | |signing=<!-- Empty or one of Self-Signed, DevCert, Manufacturer --> | + | |platform= S60 3rd Edition, FP1 |
| − | |capabilities=<!-- Capabilities required (e.g. Location, NetworkServices. -->) | + | |devicecompatability= <!-- Compatible devices (e.g.: All* (must have GPS) ) --> |
| − | |author=[[User:Tapiolaitinen]] | + | |dependencies= <!-- Any other/external dependencies e.g.: Google Maps Api v1.0 --> |
| + | |signing= <!-- Empty or one of Self-Signed, DevCert, Manufacturer --> | ||
| + | |capabilities= <!-- Capabilities required by the article/code example (e.g. Location, NetworkServices. --> | ||
| + | |keywords= CEikScrollBarFrame, TAknDoubleSpanScrollBarModel, TAknDoubleSpanScrollBarModel::SetFocusPosition(), CEikScrollBarFrame::SetVFocusPosToThumbPos() | ||
| + | |language= <!-- Language category code for non-English topics - e.g. Lang-Chinese --> | ||
| + | |translated-by= <!-- [[User:XXXX]] --> | ||
| + | |translated-from-title= <!-- Title only --> | ||
| + | |translated-from-id= <!-- Id of translated revision --> | ||
| + | |review-by= <!-- After re-review: [[User:username]] --> | ||
| + | |review-timestamp= <!-- After re-review: YYYYMMDD --> | ||
| + | |update-by= <!-- After significant update: [[User:username]]--> | ||
| + | |update-timestamp= <!-- After significant update: YYYYMMDD --> | ||
| + | |creationdate= 20080401 | ||
| + | |author= [[User:Tapiolaitinen]] | ||
| + | <!-- The following are not in current metadata --> | ||
| + | |subcategory= UI | ||
| + | |id= CS000885 | ||
}} | }} | ||
==Overview== | ==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 | + | 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. | This snippet can be self-signed. | ||
| Line 31: | Line 36: | ||
<code> | <code> | ||
| − | LIBRARY | + | LIBRARY eikcoctl.lib |
</code> | </code> | ||
| Line 48: | Line 53: | ||
==Source file== | ==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 | + | 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 {{Icode|CMyContainer::OfferKeyEventL()}}, for example. |
<code cpp> | <code cpp> | ||
| Line 66: | Line 71: | ||
* [[CS000869 - Custom control: Scrollbars]] | * [[CS000869 - Custom control: Scrollbars]] | ||
| − | [[Category:Symbian C++]][[Category:Code | + | [[Category:Symbian C++]][[Category:Code Snippet]][[Category:UI]][[Category:Code Snippet]] |
Revision as of 08:37, 17 April 2012
Article Metadata
Tested with
Devices(s): Nokia N95 8GB
Compatibility
Platform(s): S60 3rd Edition, FP1
Article
Keywords: CEikScrollBarFrame, TAknDoubleSpanScrollBarModel, TAknDoubleSpanScrollBarModel::SetFocusPosition(), CEikScrollBarFrame::SetVFocusPosToThumbPos()
Created: tapiolaitinen
(01 Apr 2008)
Last edited: hamishwillee
(17 Apr 2012)
Contents |
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.

