我使用下面的代码在触摸屏设备上上下拖动(滚动) CEikRichTextEditor内容,但问题是,当我拖动滚动条本身(向上或向下),然后再次开始拖动(在控件内)时,滚动条仍然在其位置上,没有更新:
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();
}
}
}那么,如何刷新(重画)控件及其滚动条以反映其内容呢?
我使用的是塞班C++,S60第5版软件开发工具包,Carbide.C++ 2.7,在诺基亚E7 (塞班安娜)上测试
我使用Carbide.C++ 2.7UI控件创建了CEikRichTextEditor控件。
诚挚的问候。
发布于 2011-09-14 00:05:59
尝试使用滚动条框架:
iRichText1->ScrollBarFrame()->DrawScrollBarsNow()
CEikScrollBarFrame, Nokia SDK
https://stackoverflow.com/questions/7226374
复制相似问题