Symbian S60 3rd 滚动条控件模块
2010-04-20 15:54:00 来源:WEB开发网NeedUpdate = EFalse;
}
if (0 > aRangeVScroll)
{
aRangeVScroll = 0;
}
iPosVScroll = aPosVScroll;
iRangeVScroll = aRangeVScroll;
UpdateScroolBarPosition(iPosVScroll,iRangeVScroll);
return NeedUpdate;
}
TAny CMyEikVScrollBarFrame::GetPosAndRange(TInt* aPosVScroll,TInt* aRangeVScroll)
{
if (aPosVScroll)
{
*aPosVScroll = iPosVScroll;
}
if (aRangeVScroll)
{
*aRangeVScroll = iRangeVScroll;
}
}
TKeyResponse CMyEikVScrollBarFrame::OfferKeyEventL(
const TKeyEvent& aKeyEvent, TEventCode aType)
{
TInt pos,range;
if (aType == EEventKey)
{
switch (aKeyEvent.iCode)
{
case EKeyUpArrow:
{
GetPosAndRange(&pos,&range);
if (SetPosAndRange(pos-1,range))
{
iObserver.HandleVScrollBarEvent(pos-1,range);
}
}break;
case EKeyDownArrow:
{
GetPosAndRange(&pos,&range);
if (SetPosAndRange(pos+1,range))
{
iObserver.HandleVScrollBarEvent(pos+1,range);
}
}break;
}
}
return EKeyWasConsumed;
}
更多精彩
赞助商链接