WEB开发网
开发学院手机开发Symbian 开发 Symbian S60 3rd 滚动条控件模块 阅读

Symbian S60 3rd 滚动条控件模块

 2010-04-20 15:54:00 来源:WEB开发网   
核心提示:aRange){// Update scroll bar positioniVDsSbarModel.SetScrollSpan(aRange);iVDsSbarModel.SetWindowSize(1);iVDsSbarModel.SetFocusPosition(aPos);TEikScrollBarFrameL
aRange)

{

// 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;

上一页  1 2 3 4  下一页

Tags:Symbian rd 滚动

编辑录入:coldstar [复制链接] [打 印]
赞助商链接