×
Namespaces

Variants
Actions
(Difference between revisions)

Moving scrollbar thumb on CEikScrollBarFrame

From Nokia Developer Wiki
Jump to: navigation, search
tapiolaitinen (Talk | contribs)
(New page: __NOTOC__ __NOEDITSECTION__ {|style="background:#eceff2" width="660px" border="1" cellpadding="5" cellspacing="0" |- |'''ID''' ||   |'''Creation date''' || April 1, 2008 |- |'''Plat...)
 
Forum Nokia KB (Talk | contribs)
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
 
__NOEDITSECTION__
 
__NOEDITSECTION__
 
+
{{KBCS}}
 
{|style="background:#eceff2" width="660px" border="1" cellpadding="5" cellspacing="0"  
 
{|style="background:#eceff2" width="660px" border="1" cellpadding="5" cellspacing="0"  
 
|-
 
|-
|'''ID''' ||  
+
|'''ID''' || CS000885
|'''Creation date''' || April 1, 2008
+
|'''Creation date''' || April 7, 2008
 
|-
 
|-
 
|'''Platform''' || S60 3rd Edition, FP1
 
|'''Platform''' || S60 3rd Edition, FP1
Line 22: Line 22:
 
==Overview==
 
==Overview==
  
This snippet demonstrates how to move the scrollbar thumb to a specific position. This is useful for example after an external scroll (e.g. a scroll caused by program code).
+
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 48: Line 48:
 
==Source file==
 
==Source file==
  
The following code updates the scrollbar model and moves the vertical scrollbar thumb to position specified by the model. The code could be written in <tt>CMyContainer::OfferKeyEventL()</tt>, for example.
+
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 <tt>CMyContainer::OfferKeyEventL()</tt>, for example.
  
 
<code cpp>
 
<code cpp>
Line 60: Line 60:
 
==Postconditions==
 
==Postconditions==
  
The thumb of the vertical scrollbar moves to position specified by the scrollbar model.
+
The thumb of the vertical scrollbar moves to the position specified by the scrollbar model.
  
 
==See also==
 
==See also==
  
* [[CS000869_-_Custom_control:_Scrollbars]]
+
* [[CS000869 - Custom control: Scrollbars]]
  
 
[[Category:Symbian C++]][[Category:Code Examples]][[Category:UI]]
 
[[Category:Symbian C++]][[Category:Code Examples]][[Category:UI]]

Revision as of 10:50, 7 April 2008


Template:KBCS

ID CS000885 Creation date April 7, 2008
Platform S60 3rd Edition, FP1 Tested on devices Nokia N95 8GB
Category Symbian C++ Subcategory UI


Keywords (APIs, classes, methods, functions): CEikScrollBarFrame, TAknDoubleSpanScrollBarModel, TAknDoubleSpanScrollBarModel::SetFocusPosition(), CEikScrollBarFrame::SetVFocusPosToThumbPos()

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.

See also

45 page views in the last 30 days.
×