
Originally Posted by
kamalakshan
In 5th edition you should be handling scroll events in HandlePointerEventL right? The code you have posted is for OfferKeyEventL. Just check if at all it is getting executed. If its N97 then it might be ok as keyboard is there.
The scroll bar is working now but the problem is i am drawing some texts in the container line by line like following.
This is
Amit
Kumar
Gupta
i
am
a
engineer
.
.
.
.
.
these text writes in a the loop, in the container it draws only 11 lines, rest all lines does not visible.
Code:
// Clear the graphics context.
CWindowGc& gc = SystemGc();
//gc.Clear();
/*
gc.SetPenStyle( CGraphicsContext::ENullPen );
gc.SetBrushColor( KRgbWhite );
gc.SetBrushStyle( CGraphicsContext::ESolidBrush );
gc.DrawRect( aRect );
*/
//skin
TRgb textColor; // text color when not highlighted
MAknsSkinInstance* skin =AknsUtils::SkinInstance();
AknsUtils::GetCachedColor( skin, textColor, KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG9 );
TRgb highlightColor; // text color when highlighted
AknsUtils::GetCachedColor( skin, highlightColor, KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG11 );
MAknsControlContext* cc =AknsDrawUtils::ControlContext(this );
AknsDrawUtils::Background( skin, cc, this,gc,aRect);
TRealFormat y(6,2);
y.iType=KRealFormatFixed;
//gc.SetPenColor(KRgbWhite);
gc.SetPenColor(textColor);
TBuf<32> fontName=_L("LatinPlain12");
CFont* fontToUse;
CGraphicsDevice* iDeviceMap = iCoeEnv->ScreenDevice();
TInt iHeightTwips = 100;
#ifdef __SERIES60_30__
TInt iHeightPixels = iDeviceMap->VerticalTwipsToPixels(iHeightTwips);
if(iHeightPixels<12)
{
iHeightPixels=12;
iHeightTwips = iDeviceMap->VerticalPixelsToTwips(iHeightPixels);
}
#endif
TPoint textPoint(10, 5);
TInt l2 = 8;
TFontSpec fontSpec(fontName, iHeightTwips);
iDeviceMap->GetNearestFontInTwips(fontToUse, fontSpec);
gc.UseFont(fontToUse);
for (TInt i = iCurrentScrollNum+1; i < iCurrentScrollNum+12; i++)
{
if(i <= 14)
{
textPoint.iY += (fontToUse->HeightInPixels() + 5);
gc.DiscardFont();
iDeviceMap->ReleaseFont(fontToUse);
#ifdef __SERIES60_30__
fontName=_L("Latin");
TFontSpec fontSpec1(fontName, iHeightTwips);
fontSpec1.iFontStyle.SetStrokeWeight(EStrokeWeightBold);
#else
fontName=_L("LatinBold12");
TFontSpec fontSpec1(fontName, iHeightTwips);
#endif
iDeviceMap->GetNearestFontInTwips(fontToUse, fontSpec1);
gc.UseFont(fontToUse);
TInt k=i;
gc.DrawText(formattedLabel[k], textPoint);
} // end of if
}//for loop closed
gc.DiscardFont();
iDeviceMap->ReleaseFont(fontToUse);
In the formattedLabel[] array has the string value which draws.