WEB开发网
开发学院手机开发Symbian 开发 symbian 滚动条 阅读

symbian 滚动条

 2010-07-04 15:57:00 来源:WEB开发网   
核心提示:symbian 滚动条1、声明CEikScrollBarFrame *iScrollBarFrame;TAknDoubleSpanScrollBarModel iHDsSbarModel;TAknDoubleSpanScrollBarModel iVDsSbarModel;2、实例化// Creating Scroll

symbian 滚动条

1、声明

CEikScrollBarFrame *iScrollBarFrame;

TAknDoubleSpanScrollBarModel iHDsSbarModel;

TAknDoubleSpanScrollBarModel iVDsSbarModel;

2、实例化

// Creating Scroll Bars

iScrollBarFrame = new ( ELeave ) CEikScrollBarFrame( this, NULL );

iScrollBarFrame->CreateDoubleSpanScrollBarsL( ETrue, EFalse );

iScrollBarFrame->SetTypeOfVScrollBar( CEikScrollBarFrame::EDoubleSpan );

iScrollBarFrame->SetScrollBarVisibilityL( CEikScrollBarFrame::EOff, CEikScrollBarFrame::EOn );

//set

TEikScrollBarFrameLayout layout;

layout.iTilingMode = TEikScrollBarFrameLayout::EInclusiveRectConstant;

TRect rect = Rect();

iScrollBarFrame->TileL( &iHDsSbarModel, &iVDsSbarModel, rect, rect, layout );

iScrollWidth = iScrollBarFrame->ScrollBarBreadth( CEikScrollBar::EVertical );

3、更新

void UpdateScrollBarFrameL()

{

iScrollBarFrame->SetScrollBarVisibilityL( CEikScrollBarFrame::EOff, CEikScrollBarFrame::EOn );

//Update scroll bar position

iVDsSbarModel.SetScrollSpan( iCount );

iVDsSbarModel.SetWindowSize( 1 );

iVDsSbarModel.SetFocusPosition( iFocusIndex );

TEikScrollBarFrameLayout layout;

layout.iTilingMode = TEikScrollBarFrameLayout::EInclusiveRectConstant;

TRect rect = Rect();

iScrollBarFrame->TileL( &iHDsSbarModel, &iVDsSbarModel, rect, rect, layout );

iScrollBarFrame->SetVFocusPosToThumbPos( iVDsSbarModel.FocusPosition() );

}

Tags:symbian 滚动

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