textinput/peninputcommonctrls/src/peninputdropdownlist/peninputlistonerowwithicon.cpp
changeset 27 694fa80c203c
parent 24 fc42a86c98e3
child 35 0f326f2e628e
equal deleted inserted replaced
24:fc42a86c98e3 27:694fa80c203c
     1 /*
       
     2 * Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0""
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  One rows list with icon for drop-down list objects
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // Include 
       
    20 #include <fbs.h>
       
    21 #include <AknsUtils.h>
       
    22 #include <AknLayoutDef.h>
       
    23 #include <AknsDrawUtils.h> 
       
    24 
       
    25 #include <peninputdropdownlistcontext.h>
       
    26 
       
    27 #include "peninputlistonerowwithicon.h"
       
    28 #include "peninputcandidate.h"
       
    29 #include "peninputdropdownlist.h"
       
    30 #include "peninputlayout.h"
       
    31 
       
    32 // ======== MEMBER FUNCTIONS ========
       
    33 
       
    34 // Implementation of Class CListOneRowWithIcon 
       
    35 
       
    36 // -----------------------------------------------------------------------------
       
    37 // CListOneRowWithIcon::CListOneRowWithIcon
       
    38 // C++ default constructor can NOT contain any code, that
       
    39 // might leave
       
    40 // (other items were commented in a header).
       
    41 // -----------------------------------------------------------------------------
       
    42 //
       
    43 CListOneRowWithIcon::CListOneRowWithIcon(CListManager* aManager, 
       
    44                                          MFepCtrlDropdownListContext *aOwner)
       
    45 : CList(aManager, aOwner)
       
    46     {
       
    47     iIsMultiRows = EFalse ;
       
    48     }
       
    49 
       
    50 // -----------------------------------------------------------------------------
       
    51 // CListOneRowWithIcon::NewL
       
    52 // factory function
       
    53 // (other items were commented in a header).
       
    54 // -----------------------------------------------------------------------------
       
    55 //
       
    56 CListOneRowWithIcon* CListOneRowWithIcon::NewL(CListManager* aManager, 
       
    57                                                MFepCtrlDropdownListContext *aOwner)
       
    58     {
       
    59     CListOneRowWithIcon* self = new (ELeave) CListOneRowWithIcon(aManager, aOwner);
       
    60     CleanupStack::PushL(self);
       
    61     self->ConstructL();
       
    62     CleanupStack::Pop();
       
    63     return self;
       
    64     }
       
    65 
       
    66 // -----------------------------------------------------------------------------
       
    67 // CListOneRowWithIcon::~CListOneRowWithIcon
       
    68 // desstrutor function
       
    69 // (other items were commented in a header).
       
    70 // -----------------------------------------------------------------------------
       
    71 //
       
    72 CListOneRowWithIcon::~CListOneRowWithIcon()
       
    73     {     
       
    74     }
       
    75 
       
    76 // -----------------------------------------------------------------------------
       
    77 // CListOneRowWithIcon::HandlePointerDownL
       
    78 // handle pointer down 
       
    79 // (other items were commented in a header).
       
    80 // -----------------------------------------------------------------------------
       
    81 //
       
    82 void CListOneRowWithIcon::HandlePointerDownL(const TPoint& aPoint)
       
    83     {
       
    84     // Pass the event first to the base     
       
    85     CList::HandlePointerDownL(aPoint);
       
    86 
       
    87     // If click in navigation rect and NextButton is not disable, then do 
       
    88     if ( iNavigationRect.Contains(aPoint) )
       
    89         {      
       
    90         if ( (iOwner->GetLastCandidateIndex() < iOwner->CandidateCount()) 
       
    91              || ( iOwner->GetPages()->PageCount() > 1 ) )
       
    92             {
       
    93 			#ifdef RD_TACTILE_FEEDBACK
       
    94             static_cast<CFepCtrlDropdownList*>(iOwner)->UiLayout()->
       
    95                 DoTactileFeedback(ETouchFeedbackBasic); 
       
    96 			#endif //RD_TACTILE_FEEDBACK 
       
    97             }        
       
    98         
       
    99         if ( iNavigationNextRect.Contains(aPoint) && !iNextButtonDisable )
       
   100             {
       
   101             // If click in down button and the down button is enabled 
       
   102             iClickedRect.SetRect(iNavigationNextRect.iTl, iNavigationNextRect.iBr);
       
   103             iIndicateButtonClicked = ETrue;
       
   104             DrawSelection(iClickedRect, ETrue);                
       
   105             } 
       
   106         else if ( iNavigationPreviousRect.Contains(aPoint) && !iPreviousButtonDisable )
       
   107             {
       
   108             // If click in up button and the up button is enabled                 
       
   109             iClickedRect.SetRect(iNavigationPreviousRect.iTl, iNavigationPreviousRect.iBr);
       
   110             iIndicateButtonClicked = ETrue;
       
   111             DrawSelection(iClickedRect, ETrue);                
       
   112             }
       
   113         }
       
   114     }
       
   115 
       
   116 
       
   117 // -----------------------------------------------------------------------------
       
   118 // CListOneRowWithIcon::HandlePointerDragL
       
   119 // handle pointer drag function
       
   120 // (other items were commented in a header).
       
   121 // -----------------------------------------------------------------------------
       
   122 //
       
   123 void CListOneRowWithIcon::HandlePointerDragL(const TPoint& aPoint)
       
   124     {
       
   125     // Pass the event first to the base
       
   126     CList::HandlePointerDragL(aPoint);
       
   127 
       
   128     if ( iIndicateButtonClicked )  // clicked rect is not outside the whole DDL
       
   129         {
       
   130         iMoveLatestRect = KEmptyRect;
       
   131         
       
   132         if ( iNavigationRect.Contains(aPoint) )
       
   133             {
       
   134             if ( iNavigationNextRect.Contains(aPoint) && !iNextButtonDisable )
       
   135                 {
       
   136                 // If click in down button and the down button is enabled                   
       
   137                 iMoveLatestRect.SetRect(iNavigationNextRect.iTl, iNavigationNextRect.iBr);
       
   138                 } 
       
   139             else if ( iNavigationPreviousRect.Contains(aPoint) && !iPreviousButtonDisable )
       
   140                 {
       
   141                 // If click in up button and the up button is enabled                     
       
   142                 iMoveLatestRect.SetRect(iNavigationPreviousRect.iTl, iNavigationPreviousRect.iBr);
       
   143                 }
       
   144             }
       
   145         else if ( iContentRect.Contains(aPoint) )
       
   146             {
       
   147             TInt index = -1;  
       
   148             CCandidate* candidate = FindCandidate(aPoint, index);        
       
   149                 
       
   150             if ( candidate )
       
   151                 {
       
   152                 // If click in candidates area  
       
   153                 iMoveLatestRect.SetRect(candidate->GetRect().iTl, candidate->GetRect().Size());
       
   154                 }
       
   155             else
       
   156                 {
       
   157                 iMoveLatestRect = KEmptyRect;
       
   158                 }           
       
   159             }
       
   160             
       
   161         CompareRect(iMoveLatestRect, iClickedRect);
       
   162         }
       
   163     }
       
   164 
       
   165 // -----------------------------------------------------------------------------
       
   166 // CListOneRowWithIcon::HandlePointerUpL
       
   167 // handle pointer up function
       
   168 // (other items were commented in a header).
       
   169 // -----------------------------------------------------------------------------
       
   170 //
       
   171 void CListOneRowWithIcon::HandlePointerUpL(const TPoint& aPoint)
       
   172     {
       
   173     // Reset the button clicked flag to EFalse
       
   174     iIndicateButtonClicked = EFalse;
       
   175 
       
   176     if ( !iClickedRect.IsEmpty() )
       
   177         {
       
   178         // Find out which rectangle was clicked and save it for 
       
   179         // later usage (HandlePointerUpL)
       
   180         if ( iContentRect.Contains(aPoint) )
       
   181             {
       
   182             // The point is inside the content rect
       
   183             // Check whether the point is inside the same last clicked
       
   184             // candidate rectangle
       
   185             if ( iClickedRect.Contains(aPoint) )
       
   186                 {
       
   187                 if ( iClickedCandidateIndex != KErrNotFound )
       
   188                     {
       
   189                     // Redraw the selected aread  
       
   190                     DrawSelection(iClickedRect, EFalse);
       
   191 
       
   192                     // We have selected a candidate and iClickedCandidateIndex is the selected Index.
       
   193                     // Then send message to plugin
       
   194                     CCandidate* candidate = iOwner->GetCandidate(iClickedCandidateIndex);
       
   195                     if ( candidate )
       
   196                         {
       
   197                         iOwner->ReportCandidateSelectEventL(candidate->GetCandidate(),
       
   198                                                            iClickedCandidateIndex);
       
   199                         }
       
   200                     }
       
   201                 }
       
   202             }
       
   203         else if ( iNavigationRect.Contains(aPoint) )
       
   204             {
       
   205             if ( iNavigationRect == iClickedRect ) 
       
   206                 {
       
   207                 iOwner->AutoChangeActiveList( iOwner->GetFirstCandidateIndex() );
       
   208                 iOwner->SetCapture(ETrue);
       
   209                 }
       
   210             }
       
   211 
       
   212         iClickedRect =  KEmptyRect;   
       
   213         }
       
   214     }
       
   215 
       
   216 // -----------------------------------------------------------------------------
       
   217 // CListOneRowWithIcon::Draw
       
   218 // draw the list
       
   219 // (other items were commented in a header).
       
   220 // -----------------------------------------------------------------------------
       
   221 //
       
   222 void CListOneRowWithIcon::Draw()
       
   223     {
       
   224     CList::Draw();
       
   225     
       
   226     DrawCandidates();
       
   227 	
       
   228 	DrawSelection(iClickedRect, ETrue);
       
   229 	
       
   230 	if (iDropdownListDrawInfo.iSupportSkin)
       
   231 		{
       
   232 	    //mask bitmaps
       
   233 	    TRect rect = iNavigationNextRect;        
       
   234 	    TRect innerRect = rect;
       
   235 	    innerRect.Shrink( 4, 4 );
       
   236 	    
       
   237 	    // ----- draw bitmaps -----
       
   238 		
       
   239 		
       
   240 		TAknsItemID expandBtnImgID;
       
   241 		CBitmapDb::TBitmapType bitmapType;
       
   242 		
       
   243 		if ( (iOwner->GetLastCandidateIndex() >= iOwner->CandidateCount()) 
       
   244         	 && ( iOwner->GetPages()->PageCount() < 1 ) )
       
   245 			{
       
   246 			expandBtnImgID = iDropdownListDrawInfo.iInactiveBtnImgID;
       
   247 			bitmapType = CBitmapDb::EBitmapNextDisableMask;
       
   248 			}
       
   249 		else
       
   250 			{
       
   251 			expandBtnImgID = iDropdownListDrawInfo.iNormalBtnImgID;
       
   252 			bitmapType = CBitmapDb::EBitmapNextMask;
       
   253 			}
       
   254 			
       
   255 		// Draw background    
       
   256 		AknsDrawUtils::DrawFrame( AknsUtils::SkinInstance(), 
       
   257 	                     *iOwner->Gc(), 
       
   258 	                     rect, 
       
   259 	                     innerRect,
       
   260 	                     expandBtnImgID,
       
   261 	                     KAknsIIDDefault );
       
   262 	                     
       
   263 	    iBButtonMaskDown = iOwner->GetBitmapDb()->GetBitMap(bitmapType);   
       
   264 		TRect srcRect( TPoint( 0, 0 ), iBButtonDown->SizeInPixels() );
       
   265 		iOwner->Gc()->BitBltMasked( iNavigationNextRect.iTl, 
       
   266 								  iBButtonDown, 
       
   267 								  srcRect,
       
   268 								  iBButtonMaskDown,
       
   269 								  EFalse);
       
   270 
       
   271 		}
       
   272 	else
       
   273 		{
       
   274 	    //Clear bg for iNavigationNextRect
       
   275 	    iOwner->Gc()->SetPenSize(iOwner->GetPenSize());
       
   276 	    iOwner->Gc()->SetPenStyle(CGraphicsContext::ESolidPen);
       
   277 
       
   278 	    iOwner->Gc()->SetPenColor(iOwner->GetBorderColor());
       
   279 	    iOwner->Gc()->SetBrushColor(iOwner->GetBgColor());
       
   280 	    iOwner->Gc()->SetBrushStyle( CGraphicsContext::ESolidBrush );                
       
   281 	    iOwner->Gc()->DrawRect( iNavigationNextRect );
       
   282 	            
       
   283 	    //Draw navigation bitmap
       
   284 	    TRect rect = iNavigationNextRect;
       
   285 	    rect.Shrink(1, 1);
       
   286 	    iOwner->Gc()->DrawBitmapMasked(rect, iBButtonDown, 
       
   287 	                                   iBButtonDown->SizeInPixels(), iBButtonMaskDown, ETrue);
       
   288 		}
       
   289 
       
   290     }
       
   291 
       
   292 // -----------------------------------------------------------------------------
       
   293 // CListOneRowWithIcon::UpdateList
       
   294 // update the liset
       
   295 // (other items were commented in a header).
       
   296 // -----------------------------------------------------------------------------
       
   297 //
       
   298 void CListOneRowWithIcon::UpdateListL(TBool aDrawFlag, TBool aRecalculate)
       
   299     {
       
   300     if (aRecalculate)
       
   301         {
       
   302         iOwner->SetLastCandidateIndex(CalculatePositionsL());
       
   303         }
       
   304     
       
   305     if ( (iOwner->GetLastCandidateIndex() >= iOwner->CandidateCount()) 
       
   306         && ( iOwner->GetPages()->PageCount() < 1 ) )
       
   307         {
       
   308         iNextButtonDisable = ETrue;
       
   309         
       
   310         //Set disable bitmap for button down and buttondown mask
       
   311         iBButtonDown = iOwner->GetBitmapDb()->GetBitMap(CBitmapDb::EBitmapNextDisable);
       
   312         iBButtonMaskDown = iOwner->GetBitmapDb()->GetBitMap(CBitmapDb::EBitmapNextDisableMask);
       
   313         }
       
   314     else
       
   315         {
       
   316         iNextButtonDisable = EFalse;  
       
   317         
       
   318         //Set enable bitmap for button down and buttondown mask
       
   319         iBButtonDown = iOwner->GetBitmapDb()->GetBitMap(CBitmapDb::EBitmapExpand);
       
   320         iBButtonMaskDown = iOwner->GetBitmapDb()->GetBitMap(CBitmapDb::EBitmapExpandMask);
       
   321         
       
   322         if (!iBButtonDown)
       
   323             {
       
   324             iBButtonDown = iOwner->GetBitmapDb()->GetBitMap(CBitmapDb::EBitmapNext);
       
   325             iBButtonMaskDown = iOwner->GetBitmapDb()->GetBitMap(CBitmapDb::EBitmapNextMask);
       
   326             }
       
   327         }
       
   328     if(aDrawFlag)    
       
   329         {
       
   330         Draw();
       
   331         iOwner->Invalidate(iRect);
       
   332         }
       
   333     }
       
   334 
       
   335 // -----------------------------------------------------------------------------
       
   336 // CListOneRowWithIcon::CalculateAreas
       
   337 // Calculate all kinds of rectangles
       
   338 // (other items were commented in a header).
       
   339 // -----------------------------------------------------------------------------
       
   340 //
       
   341 void CListOneRowWithIcon::CalculateAreas()
       
   342     {
       
   343     // Calculate the rect of the list     
       
   344     iRect.iTl = iOwner->GetTopLeftPoint();
       
   345     TInt width = iOwner->GetCellWidth() * iOwner->GetColNum() + iOwner->GetNaviWidth() + 
       
   346                  (iOwner->GetColNum() + 2) * iOwner->GetCellHorizontalMargin();
       
   347     
       
   348     TInt height = iOwner->GetCellHeight() + 2 * iOwner->GetCellVerticalMargin();
       
   349     
       
   350     iRect.SetSize(TSize(width, height));
       
   351 
       
   352     TBool candHLToR = (iOwner->CandHDirection() == CFepCtrlDropdownList::ECandFromLToR);
       
   353     TInt posX = iRect.iTl.iX + iOwner->GetCellHorizontalMargin();
       
   354     TInt posY = iRect.iTl.iY + iOwner->GetCellVerticalMargin();
       
   355     // width of content rect
       
   356     TInt widthC = iOwner->GetCellWidth() * iOwner->GetColNum() + (iOwner->GetColNum() - 1) * iOwner->GetCellHorizontalMargin();
       
   357     height = iOwner->GetCellHeight();
       
   358     // width of navi rect
       
   359     TInt widthN = iOwner->GetNaviWidth();
       
   360 
       
   361     if (candHLToR)
       
   362         {
       
   363         iContentRect.iTl.SetXY(posX, posY);
       
   364         iNavigationRect.iTl.SetXY(posX + widthC + iOwner->GetCellHorizontalMargin(),
       
   365                                   posY);
       
   366         }
       
   367     else
       
   368         {
       
   369         iNavigationRect.iTl.SetXY(posX, posY);
       
   370         iContentRect.iTl.SetXY(posX + widthN + iOwner->GetCellHorizontalMargin(), 
       
   371                                posY);
       
   372         }
       
   373 
       
   374     // Calculate the rect of the content
       
   375     iContentRect.SetSize(TSize(widthC, height));
       
   376 
       
   377     // Calculate the rect of the navigation area
       
   378     iNavigationRect.SetSize(TSize(widthN, height));
       
   379     // Calculate the rect of the down button    
       
   380     iNavigationNextRect = iNavigationRect; 
       
   381     // Calculate the rect of the up button       
       
   382     iNavigationPreviousRect = TRect(0,0,0,0);
       
   383     }
       
   384 
       
   385 // -----------------------------------------------------------------------------
       
   386 // CListOneRowWithIcon::CalculatePositionsL
       
   387 // calculate the position of all visible cells in the list
       
   388 // (other items were commented in a header).
       
   389 // -----------------------------------------------------------------------------
       
   390 // 
       
   391 TInt CListOneRowWithIcon::CalculatePositionsL()
       
   392     {
       
   393     TInt t = 0;
       
   394     TPoint setpoints;
       
   395 
       
   396     //RArray<CCandidate>& candidates = iOwner->GetCandidatelist;
       
   397     TInt count = iOwner->CandidateCount();
       
   398     
       
   399     iOwner->SetFirstCandidateIndex(iOwner->GetLastCandidateIndex());    
       
   400         
       
   401     if ( count > 0 )
       
   402         {
       
   403         TBool candHLToR = (iOwner->CandHDirection() == CFepCtrlDropdownList::ECandFromLToR);
       
   404         candHLToR ? setpoints.SetXY(iContentRect.iTl.iX, iContentRect.iTl.iY) : 
       
   405                     setpoints.SetXY(iContentRect.iBr.iX, iContentRect.iTl.iY);  
       
   406 
       
   407         TInt lastUsedCellCount = 0;
       
   408         TInt currentCellIndex = 0;
       
   409         count = Min(count,iOwner->GetLastCandidateIndex() + iOwner->GetColNum());    
       
   410               
       
   411         for(t = iOwner->GetLastCandidateIndex(); t < count ; t++)
       
   412             {
       
   413             // setting a position for this candidate 
       
   414             CCandidate* candidate = iOwner->GetCandidate(t);
       
   415 
       
   416             if ( !candidate )
       
   417                 {
       
   418                 continue;
       
   419                 }
       
   420                             
       
   421             lastUsedCellCount = candidate->SetPositionL(setpoints,
       
   422                                                         iOwner->GetCellWidth(),
       
   423                                                         iOwner->GetCellHeight(),
       
   424                                                         iOwner->GetFont(),
       
   425                                                         iOwner->GetCellHorizontalMargin()); 
       
   426             currentCellIndex += lastUsedCellCount;
       
   427         
       
   428             if (currentCellIndex > iOwner->GetColNum())
       
   429                 {
       
   430                 break;
       
   431                 }
       
   432 
       
   433             candHLToR ? (setpoints.iX += lastUsedCellCount * (iOwner->GetCellWidth() + iOwner->GetCellHorizontalMargin())) : 
       
   434                         (setpoints.iX -= lastUsedCellCount * (iOwner->GetCellWidth() + iOwner->GetCellHorizontalMargin())) ;
       
   435             } // for-loop
       
   436         } // if candidate exist 
       
   437      
       
   438     return t; // as lastCandidateIndex
       
   439     }
       
   440 
       
   441 // -----------------------------------------------------------------------------
       
   442 // CListOneRowWithIcon::DrawNavigationPress
       
   443 // draw navigation button when pressed or un-pressed
       
   444 // (other items were commented in a header).
       
   445 // -----------------------------------------------------------------------------
       
   446 //
       
   447 TBool CListOneRowWithIcon::DrawNavigationPress(const TRect& aRect,TBool aIndicate)
       
   448     {
       
   449     TBool retval = EFalse;
       
   450     
       
   451     if ( aRect == iNavigationNextRect )
       
   452         {
       
   453         retval = ETrue;
       
   454         if (iDropdownListDrawInfo.iSupportSkin)
       
   455         	{
       
   456 		    TRect rect = iNavigationNextRect;        
       
   457 		    TRect innerRect = rect;
       
   458 		    innerRect.Shrink( 4, 4 );
       
   459 		    	
       
   460 			
       
   461 			TAknsItemID expandBtnImgID;
       
   462 	        if ( aIndicate )
       
   463 	            {
       
   464 	            expandBtnImgID = iDropdownListDrawInfo.iPressedBtnImgID;
       
   465 	            }
       
   466 	        else
       
   467 	            {
       
   468 	            expandBtnImgID = iDropdownListDrawInfo.iNormalBtnImgID;
       
   469 	            }
       
   470 			AknsDrawUtils::DrawFrame( AknsUtils::SkinInstance(), 
       
   471                  *iOwner->Gc(), 
       
   472                  rect, 
       
   473                  innerRect,
       
   474                  expandBtnImgID,
       
   475                  KAknsIIDDefault ); 
       
   476 	            
       
   477 	            
       
   478 			iBButtonDown = iOwner->GetBitmapDb()->GetBitMap(CBitmapDb::EBitmapExpand);
       
   479 			iBButtonMaskDown = iOwner->GetBitmapDb()->GetBitMap(CBitmapDb::EBitmapExpandMask);
       
   480 
       
   481 			if (!iBButtonDown)
       
   482 			    {
       
   483 			    iBButtonDown = iOwner->GetBitmapDb()->GetBitMap(CBitmapDb::EBitmapNext);
       
   484 			    iBButtonMaskDown = iOwner->GetBitmapDb()->GetBitMap(CBitmapDb::EBitmapNextMask);
       
   485 			    }
       
   486 	            
       
   487 			TRect srcRect( TPoint( 0, 0 ), iBButtonDown->SizeInPixels() );
       
   488 			       
       
   489 			iOwner->Gc()->BitBltMasked( iNavigationNextRect.iTl, 
       
   490 							  iBButtonDown, 
       
   491 							  srcRect,
       
   492 							  iBButtonMaskDown,
       
   493 							  EFalse);	
       
   494         	}
       
   495         else
       
   496         	{
       
   497 	        if ( aIndicate )
       
   498 	            {
       
   499 	            // NEXT PRESSED DOWN
       
   500 	            iBButtonDown = iOwner->GetBitmapDb()->GetBitMap(CBitmapDb::EBitmapExpandPress);
       
   501 	            iBButtonMaskDown = iOwner->GetBitmapDb()->GetBitMap(
       
   502                                                                 CBitmapDb::EBitmapExpandPressMask);
       
   503 	            
       
   504 	            if (!iBButtonDown)
       
   505 	                {
       
   506 	                iBButtonDown = iOwner->GetBitmapDb()->GetBitMap(CBitmapDb::EBitmapNextPress);
       
   507 	                iBButtonMaskDown = iOwner->GetBitmapDb()->GetBitMap(
       
   508                                                                 CBitmapDb::EBitmapNextPressMask);
       
   509 	                }
       
   510 	            }
       
   511 	        else
       
   512 	            {
       
   513 	            // NEXT ORIGINAL
       
   514 	            iBButtonDown = iOwner->GetBitmapDb()->GetBitMap(CBitmapDb::EBitmapExpand);
       
   515 	            iBButtonMaskDown = iOwner->GetBitmapDb()->GetBitMap(CBitmapDb::EBitmapExpandMask);
       
   516 	            
       
   517 	            if (!iBButtonDown)
       
   518 	                {
       
   519 	                iBButtonDown = iOwner->GetBitmapDb()->GetBitMap(CBitmapDb::EBitmapNext);
       
   520 	                iBButtonMaskDown = iOwner->GetBitmapDb()->GetBitMap(CBitmapDb::EBitmapNextMask);
       
   521 	                }
       
   522 	            }
       
   523 	        
       
   524 	        // Begin draw navigation next button
       
   525 	        iOwner->DrawMask(iNavigationNextRect);
       
   526 	        
       
   527 	        // Activeate bitmap context
       
   528 	        iOwner->ActivateBitmapContext();
       
   529 	        
       
   530 	        // Clear rect
       
   531 	        iOwner->Gc()->SetPenSize(iOwner->GetPenSize());
       
   532 	        iOwner->Gc()->SetPenStyle(CGraphicsContext::ESolidPen);
       
   533 	        iOwner->Gc()->SetPenColor(iOwner->GetBorderColor());
       
   534 	        iOwner->Gc()->SetBrushColor(iOwner->GetBgColor());
       
   535 	        iOwner->Gc()->SetBrushStyle( CGraphicsContext::ESolidBrush );                
       
   536 	        iOwner->Gc()->DrawRect( iNavigationNextRect );
       
   537 	        
       
   538 	        // Draw bitmap
       
   539 	        TRect rect = iNavigationNextRect;        
       
   540 	        rect.Shrink(TSize(1,1));
       
   541 	        
       
   542 	        if (iOwner->GetCellHorizontalMargin() != 0)
       
   543 	            {
       
   544 	            rect.iBr.iX = rect.iBr.iX + 1;
       
   545 	            }
       
   546 	            
       
   547 	        if (iOwner->GetCellVerticalMargin() != 0)
       
   548 	            {
       
   549 	            rect.iBr.iY = rect.iBr.iY + 1;
       
   550 	            }
       
   551 	        
       
   552 	        iOwner->Gc()->DrawBitmapMasked(rect, iBButtonDown, 
       
   553 	                                       iBButtonDown->SizeInPixels(), iBButtonMaskDown, ETrue);
       
   554         	}
       
   555 							         
       
   556         iOwner->Invalidate(aRect);
       
   557         }
       
   558 
       
   559         
       
   560     return retval;
       
   561     }
       
   562 
       
   563 // End Of File