Symbian S60 3rd 滚动条控件模块
2010-04-20 15:54:00 来源:WEB开发网{
// Update scroll bar position
iVDsSbarModel.SetScrollSpan(aRange);
iVDsSbarModel.SetWindowSize(1);
iVDsSbarModel.SetFocusPosition(aPos);
TEikScrollBarFrameLayout layout;
layout.iTilingMode = TEikScrollBarFrameLayout::EInclusiveRectConstant;
TRect rect(iParentControl->Rect());
iScrollBarFrame->TileL(NULL,&iVDsSbarModel,rect,rect,layout);
iScrollBarFrame->SetVFocusPosToThumbPos(iVDsSbarModel.FocusPosition());
}
TAny CMyEikVScrollBarFrame::CreateVScrollBar(CCoeControl* aParentWindow)
{
// Create scroll bar
iScrollBarFrame = new ( ELeave ) CEikScrollBarFrame( aParentWindow, NULL );
iScrollBarFrame->CreateDoubleSpanScrollBarsL( ETrue, EFalse );
iScrollBarFrame->SetTypeOfVScrollBar( CEikScrollBarFrame::EDoubleSpan );
iScrollBarFrame->SetScrollBarVisibilityL( CEikScrollBarFrame::EOff, CEikScrollBarFrame::EOff);
}
TAny CMyEikVScrollBarFrame::Show(TBool aShow)
{
if (aShow)
{
iScrollBarFrame->SetScrollBarVisibilityL( CEikScrollBarFrame::EOff, CEikScrollBarFrame::EOn);
}
else
{
iScrollBarFrame->SetScrollBarVisibilityL( CEikScrollBarFrame::EOff, CEikScrollBarFrame::EOff);
}
}
TAny CMyEikVScrollBarFrame::SizeChanged()
{
UpdateScroolBarPosition(iPosVScroll,iRangeVScroll);
}
TBool CMyEikVScrollBarFrame::SetPosAndRange(TInt aPosVScroll,TInt aRangeVScroll)
{
TBool NeedUpdate = ETrue;
if (0 > aPosVScroll)
{
aPosVScroll = 0;
NeedUpdate = EFalse;
}
if (aPosVScroll >= aRangeVScroll)
{
aPosVScroll = aRangeVScroll-1;
更多精彩
赞助商链接