idlehomescreen/widgetmanager/src/wmdetailsdlg.cpp
branchRCL_3
changeset 18 d05a55b217df
parent 5 c743ef5928ba
child 19 79311d856354
equal deleted inserted replaced
17:b8fae6b8a148 18:d05a55b217df
   178     iRtEditor->SetAknEditorFlags( 
   178     iRtEditor->SetAknEditorFlags( 
   179                     EAknEditorFlagEnableScrollBars | 
   179                     EAknEditorFlagEnableScrollBars | 
   180                     EEikEdwinAvkonDisableCursor |
   180                     EEikEdwinAvkonDisableCursor |
   181                     EEikEdwinDisplayOnly |
   181                     EEikEdwinDisplayOnly |
   182                     EEikEdwinReadOnly );
   182                     EEikEdwinReadOnly );
       
   183     iRtEditor->EnableKineticScrollingL( ETrue );
   183 
   184 
   184     CEikScrollBarFrame* scrollBarFrame = iRtEditor->CreateScrollBarFrameL();
   185     CEikScrollBarFrame* scrollBarFrame = iRtEditor->CreateScrollBarFrameL();
   185     scrollBarFrame->SetScrollBarVisibilityL( CEikScrollBarFrame::EOff,
   186     scrollBarFrame->SetScrollBarVisibilityL( CEikScrollBarFrame::EOff,
   186                                              CEikScrollBarFrame::EOff ); // set to EAuto 
   187                                              CEikScrollBarFrame::EAuto );
   187                                              // when layout fixed. ~wk04_2010
       
   188                                              // currently scrollbar overlaps cba.
       
   189     
   188     
   190     iMarquee = CAknMarqueeControl::NewL();
   189     iMarquee = CAknMarqueeControl::NewL();
   191     TCallBack callback( RedrawCallback, this );
   190     TCallBack callback( RedrawCallback, this );
   192     iMarquee->SetRedrawCallBack( callback );
   191     iMarquee->SetRedrawCallBack( callback );
   193     iMarquee->SetLoops( 1 );
   192     iMarquee->SetLoops( 1 );
   223     TFontSpec fontspec = logicalFont->FontSpecInTwips();
   222     TFontSpec fontspec = logicalFont->FontSpecInTwips();
   224     TCharFormat charFormat(fontspec.iTypeface.iName, fontspec.iHeight);
   223     TCharFormat charFormat(fontspec.iTypeface.iName, fontspec.iHeight);
   225     TCharFormatMask charFormatMask;
   224     TCharFormatMask charFormatMask;
   226     CParaFormat paraFormat;
   225     CParaFormat paraFormat;
   227     TParaFormatMask paraFormatMask;
   226     TParaFormatMask paraFormatMask;
   228     if ( Layout_Meta_Data::IsMirrored() )
   227     paraFormat.iHorizontalAlignment = CParaFormat::ELeftAlign;
   229         {
       
   230         paraFormat.iHorizontalAlignment = CParaFormat::ERightAlign;
       
   231         }
       
   232     else
       
   233         {
       
   234         paraFormat.iHorizontalAlignment = CParaFormat::ELeftAlign;
       
   235         }
       
   236     charFormat.iFontPresentation.iTextColor = color;
   228     charFormat.iFontPresentation.iTextColor = color;
   237     paraFormatMask.SetAttrib(EAttAlignment);
   229     paraFormatMask.SetAttrib(EAttAlignment);
   238     charFormatMask.SetAttrib(EAttFontTypeface);
   230     charFormatMask.SetAttrib(EAttFontTypeface);
   239     charFormatMask.SetAttrib(EAttFontHeight);
   231     charFormatMask.SetAttrib(EAttFontHeight);
       
   232     paraFormatMask.SetAttrib(EAttLineSpacing);
   240     charFormatMask.SetAttrib(EAttColor);
   233     charFormatMask.SetAttrib(EAttColor);
   241     iRtEditor->ApplyParaFormatL(&paraFormat, paraFormatMask);
   234     iRtEditor->ApplyParaFormatL(&paraFormat, paraFormatMask);
   242     iRtEditor->ApplyCharFormatL(charFormat, charFormatMask);
   235     iRtEditor->ApplyCharFormatL(charFormat, charFormatMask);
   243     iRtEditor->ClearSelectionL();
   236     iRtEditor->ClearSelectionL();
   244     }
   237     }
   399     {
   392     {
   400     CWindowGc& gc = SystemGc();
   393     CWindowGc& gc = SystemGc();
   401     TRect rect = Rect();
   394     TRect rect = Rect();
   402     TRect innerRect( rect );
   395     TRect innerRect( rect );
   403     TRgb color = KRgbBlack;
   396     TRgb color = KRgbBlack;
   404     const TInt offSet = 5;
       
   405 
   397 
   406     MAknsSkinInstance* skin = AknsUtils::SkinInstance();
   398     MAknsSkinInstance* skin = AknsUtils::SkinInstance();
   407     MAknsControlContext* cc = AknsDrawUtils::ControlContext( this );
   399     MAknsControlContext* cc = AknsDrawUtils::ControlContext( this );
   408 
   400 
   409     // draw background
   401     // draw background
   476     // draw the rounded rectangle as border
   468     // draw the rounded rectangle as border
   477     const TInt KFrameRoundRadius = 3;
   469     const TInt KFrameRoundRadius = 3;
   478     const TInt KBorderWidth = 2;
   470     const TInt KBorderWidth = 2;
   479     gc.SetPenSize( TSize( KBorderWidth, KBorderWidth ) );    
   471     gc.SetPenSize( TSize( KBorderWidth, KBorderWidth ) );    
   480     gc.DrawRoundRect( innerRect, TSize( KFrameRoundRadius, KFrameRoundRadius ) );
   472     gc.DrawRoundRect( innerRect, TSize( KFrameRoundRadius, KFrameRoundRadius ) );
   481     
       
   482     // draw shadow
       
   483     gc.SetBrushStyle(CGraphicsContext::ESolidBrush);
       
   484     gc.SetPenStyle( CGraphicsContext::ESolidPen );
       
   485     gc.SetBrushColor( color );
       
   486     gc.SetPenColor( color );
       
   487     TRect rightShadowArea = Rect();
       
   488     rightShadowArea.iTl.iX = rightShadowArea.iBr.iX - offSet;
       
   489     rightShadowArea.iTl.iY += offSet/2;
       
   490     gc.DrawRect(rightShadowArea);
       
   491     TRect bottomShadowArea = Rect();
       
   492     bottomShadowArea.iTl.iX += offSet/2;
       
   493     bottomShadowArea.iTl.iY += bottomShadowArea.iBr.iY - offSet;
       
   494     gc.DrawRect( bottomShadowArea );
       
   495     gc.SetBrushStyle( CGraphicsContext::ENullBrush );
       
   496     gc.SetPenStyle( CGraphicsContext::ENullPen );
       
   497     }
   473     }
   498 
   474 
   499 // ---------------------------------------------------------
   475 // ---------------------------------------------------------
   500 // CWmDetailsDlg::RedrawCallback
   476 // CWmDetailsDlg::RedrawCallback
   501 // ---------------------------------------------------------
   477 // ---------------------------------------------------------