WEB开发网
开发学院手机开发Symbian 开发 Symbian 5th系统滚动条使用 阅读

Symbian 5th系统滚动条使用

 2010-04-21 01:20:00 来源:WEB开发网   
核心提示:scrollbar}void CMyControl::SizeChanged(){// Here you are required to define the size of your scrollbar//TInt listStatusPaneHeight=60;TEikScrollBarFrameLayout la
scrollbar

}

void CMyControl::SizeChanged()

{

// Here you are required to define the size of your scrollbar//

TInt listStatusPaneHeight=60;

TEikScrollBarFrameLayout layout;

TEikScrollBarModel myModel;

TEikScrollBarModel myModel2;

myModel.iThumbSpan=1;

myModel.iScrollSpan =iScrollSpan;

layout.iTilingMode=TEikScrollBarFrameLayout::EInclusiveRectConstant;

TRect fullRect =TRect(TPoint(Rect().iTl.iX,Rect().iTl.iY+listStatusPaneHeight),TSize(Rect().Size().iWidth,Rect ().Size().iHeight-listStatusPaneHeight));

TRect inclRect = fullRect;

if(iSBFrame)

{

TBool stat = iSBFrame->TileL(&myModel2, &myModel, fullRect, inclRect, layout);

iSBFrame->DrawScrollBarsNow();

}

}

void CMyControl::HandleScrollEventL(CEikScrollBar* aScrollBar,TEikScrollEvent aEventType )

{

switch(aEventType)

{

case EEikScrollThumbDragVert:

{

CEikScrollBar* sb= iSBFrame->VerticalScrollBar();// get an object of your scroll bar

TInt pos=sb->ThumbPosition();/// it will provide new position of scrollbar

if(iScrollPos< p>

{

iScrollPos=pos;/// moving down number of scroll span

iIsScrollDown=ETrue;

}

else

{

iScrollPos=pos;/// moving down number of scroll span

iIsScrollDown=EFalse;

}

DrawNow();

break;

}

case EEikScrollThumbReleaseVert:

break;

default:

break;

}

}

让大家见笑了。争取抽点时间写写我自己的东西。

上一页  1 2 

Tags:Symbian th

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