I’m using code below to drag CEikRichTextEditor contents up and down (Scroll) on touch screen devices but the problem is that when I drag the scroll-bar itself (up or down), and then start dragging again (inside the control), the scroll-bar still in its place with no update:
void CAIBookDescribtion::HandlePointerEventL(const TPointerEvent& aPointerEvent)
{
static TInt firstpoint;
if(aPointerEvent.iType == TPointerEvent::EButton1Down)
{
firstpoint = aPointerEvent.iPosition.iY;
}
if(aPointerEvent.iType == TPointerEvent::EDrag)
{
if(aPointerEvent.iPosition.iY > firstpoint)
{
iRichText1->TextView()->ScrollDisplayL(TCursorPosition::EFLineUp);
iRichText1->UpdateScrollBarsL();
DrawNow();
iRichText1->DrawNow();
}
else
{
iRichText1->TextView()->ScrollDisplayL(TCursorPosition::EFLineDown);
iRichText1->UpdateScrollBarsL();
DrawNow();
iRichText1->DrawNow();
}
}
}
So how can I refresh (Redraw) the control and its scroll-bar to reflect its contents?
I’m using Symbian C++, S60 5th Ed SDK, Carbide.C++ 2.7, Testing on Nokia E7 (Symbian Anna)
I created the CEikRichTextEditor control using Carbide.C++ 2.7 UI controls.
Best Regards.
Try using the scrollbar frame:
iRichText1->ScrollBarFrame()->DrawScrollBarsNow()
CEikScrollBarFrame, Nokia SDK