Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]


How to implement scrolling

The code in this section demonstrates horizontal and vertical scrolling using CTextView::ScrollDisplayL(). This function can be used to scroll text horizontally (left or right and to the start or end of a line), and vertically (page or line up, page or line down). Note that scrolling down means that the text appears to move upwards, scrolling left means it appears to move rightwards.

[Top]


Scroll left

The following code scrolls the display left by 40 pixels, causing the text to move right. If no horizontal scroll jump value is set, the scroll jump will be the default value of 20 pixels.

iTextView->SetHorizontalScrollJump(40); // scroll jump is 40 pixels
iTextView->ScrollDisplayL(TCursorPosition::EFLeft); // scroll left

[Top]


Scroll down

The following example scrolls the display downwards.

TInt pixelsScrolled;
do pixelsScrolled=iTextView->ScrollDisplayL
    (TCursorPosition::EFLineDown,CTextView::EFAllowScrollingBlankSpace);
while (pixelsScrolled);

Note