extras/calcsoft/src/CalcOutSheet.cpp
branchRCL_3
changeset 19 99b535de1dda
parent 16 82ca176301de
equal deleted inserted replaced
17:a616540b95d9 19:99b535de1dda
    22 
    22 
    23 // INCLUDE FILES
    23 // INCLUDE FILES
    24 #include    <AknUtils.h>
    24 #include    <AknUtils.h>
    25 #include    <Calcsoft.rsg>
    25 #include    <Calcsoft.rsg>
    26 #include    <applayout.cdl.h>
    26 #include    <applayout.cdl.h>
    27 #include 	<AknsDrawUtils.h>
    27 #include     <AknsDrawUtils.h>
    28 #include	<layoutmetadata.cdl.h>
    28 #include    <layoutmetadata.cdl.h>
    29 #include	"CalcEnv.h"
    29 #include    "CalcEnv.h"
    30 #include    "CalcCont.h"    
    30 #include    "CalcCont.h"    
    31 #include    "CalcOutSheet.h"
    31 #include    "CalcOutSheet.h"
    32 #include    "CalcDoc.h"
    32 #include    "CalcDoc.h"
    33 #include    "CalcEditline.h"
    33 #include    "CalcEditline.h"
    34 #include    "CalcAppUi.h"
    34 #include    "CalcAppUi.h"
    62 // Destructor
    62 // Destructor
    63 CCalcOutputSheet::~CCalcOutputSheet()
    63 CCalcOutputSheet::~CCalcOutputSheet()
    64     {
    64     {
    65     delete iOpSheetContext;
    65     delete iOpSheetContext;
    66     if(iOperatorLayout)
    66     if(iOperatorLayout)
    67 	    {
    67         {
    68 	    iOperatorLayout->Reset();
    68         iOperatorLayout->Reset();
    69 	    delete iOperatorLayout;	
    69         delete iOperatorLayout;    
    70 	    }
    70         }
    71 	if(iOperandLayout)
    71     if(iOperandLayout)
    72 	    {
    72         {
    73 	    iOperandLayout->Reset();
    73         iOperandLayout->Reset();
    74 	    delete iOperandLayout;	
    74         delete iOperandLayout;    
    75 	    }
    75         }
    76 	if(iEqualLineLayout)
    76     if(iEqualLineLayout)
    77 	    {
    77         {
    78 	    iEqualLineLayout->Reset();
    78         iEqualLineLayout->Reset();
    79 	    delete iEqualLineLayout;	
    79         delete iEqualLineLayout;    
    80 	    }
    80         }
    81 	if(iResultsLineLayout)
    81     if(iResultsLineLayout)
    82 	    {
    82         {
    83 	    iResultsLineLayout->Reset();
    83         iResultsLineLayout->Reset();
    84 	    delete iResultsLineLayout;	
    84         delete iResultsLineLayout;    
    85 	    }
    85         }
    86 	if (iCRKey)
    86     if (iCRKey)
    87 		{
    87         {
    88 		delete iCRKey;
    88         delete iCRKey;
    89 		iCRKey = NULL;
    89         iCRKey = NULL;
    90 		}
    90         }
    91 		
    91         
    92 	//Delete the scrollbar frame
    92     //Delete the scrollbar frame
    93 	if(iSBFrame)
    93     if(iSBFrame)
    94 	    {
    94         {
    95 	    delete iSBFrame;
    95         delete iSBFrame;
    96 	    iSBFrame = NULL;
    96         iSBFrame = NULL;
    97 	    }
    97         }
    98     }
    98     }
    99 
    99 
   100 // ---------------------------------------------------------
   100 // ---------------------------------------------------------
   101 // CCalcOutputSheet::ScrollToBottomL
   101 // CCalcOutputSheet::ScrollToBottomL
   102 // Scroll to bottom line.
   102 // Scroll to bottom line.
   124 void CCalcOutputSheet::NotifyClearHistoryL()
   124 void CCalcOutputSheet::NotifyClearHistoryL()
   125     {
   125     {
   126     iScrollOffset = 0;
   126     iScrollOffset = 0;
   127     if( AknLayoutUtils::PenEnabled()  )
   127     if( AknLayoutUtils::PenEnabled()  )
   128     {
   128     {
   129     	UpdateScrollIndicatorL();	
   129         UpdateScrollIndicatorL();    
   130     }
   130     }
   131     DrawNow();
   131     DrawNow();
   132     }
   132     }
   133         
   133         
   134 
   134 
   210 
   210 
   211     iCalcContainer = aContainer;
   211     iCalcContainer = aContainer;
   212     
   212     
   213     iCalcAppEnv = CCalcAppEnv::Static();
   213     iCalcAppEnv = CCalcAppEnv::Static();
   214     iCalcPaper = iCalcAppEnv->PaperBitmap();
   214     iCalcPaper = iCalcAppEnv->PaperBitmap();
   215 	iCalcAppEnv->ScalablePaperBitmaps(iCalcScalablePaper);
   215     iCalcAppEnv->ScalablePaperBitmaps(iCalcScalablePaper);
   216 #ifdef __SCALABLE_ICONS
   216 #ifdef __SCALABLE_ICONS
   217 	iCalcResultsLine = iCalcAppEnv->ResultsLineBitmap();
   217     iCalcResultsLine = iCalcAppEnv->ResultsLineBitmap();
   218 #endif
   218 #endif
   219 
   219 
   220     CCalcAppUi* appui = iCalcAppEnv->AppUi();
   220     CCalcAppUi* appui = iCalcAppEnv->AppUi();
   221     CCalcDocument* calcDocument = 
   221     CCalcDocument* calcDocument = 
   222                    STATIC_CAST(CCalcDocument*, appui->Document());
   222                    STATIC_CAST(CCalcDocument*, appui->Document());
   262     {
   262     {
   263         listLimits = AknLayoutScalable_Apps::list_calc_item_pane_ParamLimits(enTouch_disabled);    
   263         listLimits = AknLayoutScalable_Apps::list_calc_item_pane_ParamLimits(enTouch_disabled);    
   264     }
   264     }
   265     iCalcOutputSheetLines   = (listLimits.LastRow()-listLimits.FirstRow()) + 1;
   265     iCalcOutputSheetLines   = (listLimits.LastRow()-listLimits.FirstRow()) + 1;
   266     iOperatorLayout->ResizeL(iCalcOutputSheetLines);
   266     iOperatorLayout->ResizeL(iCalcOutputSheetLines);
   267 	iOperandLayout->ResizeL(iCalcOutputSheetLines);
   267     iOperandLayout->ResizeL(iCalcOutputSheetLines);
   268 	iResultsLineLayout->ResizeL(iCalcOutputSheetLines-1);
   268     iResultsLineLayout->ResizeL(iCalcOutputSheetLines-1);
   269 	iEqualLineLayout->ResizeL(iCalcOutputSheetLines-1);
   269     iEqualLineLayout->ResizeL(iCalcOutputSheetLines-1);
   270 	
   270     
   271     iOperatorLayout->Reset();
   271     iOperatorLayout->Reset();
   272 	iOperandLayout->Reset();
   272     iOperandLayout->Reset();
   273 	iResultsLineLayout->Reset();
   273     iResultsLineLayout->Reset();
   274 	iEqualLineLayout->Reset();
   274     iEqualLineLayout->Reset();
   275     
   275     
   276     TAknLayoutRect rectParent;
   276     TAknLayoutRect rectParent;
   277 	TAknWindowLineLayout layoutOfParentResultsLine;
   277     TAknWindowLineLayout layoutOfParentResultsLine;
   278 	TAknLayoutRect rectListCalcPane;
   278     TAknLayoutRect rectListCalcPane;
   279 	
   279     
   280  
   280  
   281     
   281     
   282     if( AknLayoutUtils::ScalableLayoutInterfaceAvailable() )
   282     if( AknLayoutUtils::ScalableLayoutInterfaceAvailable() )
   283 		{
   283         {
   284 			TAknWindowLineLayout  calcPaperPane;
   284             TAknWindowLineLayout  calcPaperPane;
   285 			
   285             
   286 			//For Touch UI Layouts, different configuration
   286             //For Touch UI Layouts, different configuration
   287 			if( AknLayoutUtils::PenEnabled() )
   287             if( AknLayoutUtils::PenEnabled() )
   288 	        {
   288             {
   289 	            if (Layout_Meta_Data::IsLandscapeOrientation())
   289                 if (Layout_Meta_Data::IsLandscapeOrientation())
   290 	            {
   290                 {
   291 	                calcPaperPane = AknLayoutScalable_Apps::calc_paper_pane(enTouch_with_lsc).LayoutLine();
   291                     calcPaperPane = AknLayoutScalable_Apps::calc_paper_pane(enTouch_with_lsc).LayoutLine();
   292 	            }
   292                 }
   293 	            else
   293                 else
   294 	            {
   294                 {
   295 	                calcPaperPane = AknLayoutScalable_Apps::calc_paper_pane(enTouch_with_prt).LayoutLine();
   295                     calcPaperPane = AknLayoutScalable_Apps::calc_paper_pane(enTouch_with_prt).LayoutLine();
   296 	            }
   296                 }
   297 	        }
   297             }
   298 	        else
   298             else
   299 	        {
   299             {
   300 		        calcPaperPane = AknLayoutScalable_Apps::calc_paper_pane(enTouch_disabled).LayoutLine();
   300                 calcPaperPane = AknLayoutScalable_Apps::calc_paper_pane(enTouch_disabled).LayoutLine();
   301 	        }
   301             }
   302 			TAknLayoutRect rectcalcPaperPane;	
   302             TAknLayoutRect rectcalcPaperPane;    
   303 			rectcalcPaperPane.LayoutRect(parentRect,calcPaperPane);
   303             rectcalcPaperPane.LayoutRect(parentRect,calcPaperPane);
   304 			TAknWindowLineLayout layoutListCalcPane;
   304             iSBBrPoint = rectcalcPaperPane.Rect().iBr;
   305 			if( AknLayoutUtils::PenEnabled() )
   305             TAknWindowLineLayout layoutListCalcPane;
   306 	        {
   306             if( AknLayoutUtils::PenEnabled() )
   307 	            layoutListCalcPane = AknLayoutScalable_Apps::list_calc_pane(enTouch_enabled).LayoutLine();
   307             {
   308 	        }
   308                 layoutListCalcPane = AknLayoutScalable_Apps::list_calc_pane(enTouch_enabled).LayoutLine();
   309 	        else
   309             }
   310 	        {
   310             else
   311 	            layoutListCalcPane = AknLayoutScalable_Apps::list_calc_pane(enTouch_disabled).LayoutLine();
   311             {
   312 	        }
   312                 layoutListCalcPane = AknLayoutScalable_Apps::list_calc_pane(enTouch_disabled).LayoutLine();
   313 			
   313             }
   314 			rectListCalcPane.LayoutRect(rectcalcPaperPane.Rect(),layoutListCalcPane);
   314             
   315 		}
   315             rectListCalcPane.LayoutRect(rectcalcPaperPane.Rect(),layoutListCalcPane);
   316     
   316         }
   317 	TInt nTimes=(iCalcOutputSheetLines-1);
   317     
       
   318     TInt nTimes=(iCalcOutputSheetLines-1);
   318     for (TInt cnt(0); cnt < iCalcOutputSheetLines; cnt++)
   319     for (TInt cnt(0); cnt < iCalcOutputSheetLines; cnt++)
   319         {
   320         {
   320         if (AknLayoutUtils::ScalableLayoutInterfaceAvailable())
   321         if (AknLayoutUtils::ScalableLayoutInterfaceAvailable())
   321 		{
   322         {
   322 		if(AknLayoutUtils::PenEnabled())
   323         if(AknLayoutUtils::PenEnabled())
   323 		{
   324         {
   324 			if (Layout_Meta_Data::IsLandscapeOrientation())
   325             if (Layout_Meta_Data::IsLandscapeOrientation())
   325 			{
   326             {
   326 				layoutOfParentResultsLine =  AknLayoutScalable_Apps::list_calc_item_pane(nTimes,enTouch_enabled).LayoutLine();	
   327                 layoutOfParentResultsLine =  AknLayoutScalable_Apps::list_calc_item_pane(nTimes,enTouch_enabled).LayoutLine();    
   327 			}
   328             }
   328 			else
   329             else
   329 			{
   330             {
   330 				layoutOfParentResultsLine =  AknLayoutScalable_Apps::list_calc_item_pane(nTimes,enTouch_enabled).LayoutLine();
   331                 layoutOfParentResultsLine =  AknLayoutScalable_Apps::list_calc_item_pane(nTimes,enTouch_enabled).LayoutLine();
   331 			}
   332             }
   332 	
   333     
   333 		}
   334         }
   334 		else
   335         else
   335 		{
   336         {
   336 		    layoutOfParentResultsLine =  AknLayoutScalable_Apps::list_calc_item_pane(nTimes,enTouch_disabled).LayoutLine();    
   337             layoutOfParentResultsLine =  AknLayoutScalable_Apps::list_calc_item_pane(nTimes,enTouch_disabled).LayoutLine();    
   337 		}
   338         }
   338 		
   339         
   339 		
   340         
   340 		rectParent.LayoutRect(rectListCalcPane.Rect(),layoutOfParentResultsLine) ;
   341         rectParent.LayoutRect(rectListCalcPane.Rect(),layoutOfParentResultsLine) ;
   341 			
   342             
   342 		TAknLayoutText operatorLayout;
   343         TAknLayoutText operatorLayout;
   343 		TAknLayoutText operendLayout;
   344         TAknLayoutText operendLayout;
   344 		if(AknLayoutUtils::PenEnabled())
   345         if(AknLayoutUtils::PenEnabled())
   345 		{
   346         {
   346 		    operatorLayout.LayoutText(rectParent.Rect(),AknLayoutScalable_Apps::list_calc_item_pane_t2(enTouch_with_prt).LayoutLine(),iCalcAppEnv->OutSheetOperatorFont()); 
   347             operatorLayout.LayoutText(rectParent.Rect(),AknLayoutScalable_Apps::list_calc_item_pane_t2(enTouch_with_prt).LayoutLine(),iCalcAppEnv->OutSheetOperatorFont()); 
   347 		    iOperatorLayout->AppendL(operatorLayout);
   348             iOperatorLayout->AppendL(operatorLayout);
   348 		
   349         
   349 		    operendLayout.LayoutText(rectParent.Rect(),AknLayoutScalable_Apps::list_calc_item_pane_t1(enTouch_with_lsc).LayoutLine(),iCalcAppEnv->OutSheetOperatorFont()); 
   350             operendLayout.LayoutText(rectParent.Rect(),AknLayoutScalable_Apps::list_calc_item_pane_t1(enTouch_with_lsc).LayoutLine(),iCalcAppEnv->OutSheetOperatorFont()); 
   350 		    iOperandLayout->AppendL(operendLayout);
   351             iOperandLayout->AppendL(operendLayout);
   351 		}
   352         }
   352 		else
   353         else
   353 		{
   354         {
   354 		    operatorLayout.LayoutText(rectParent.Rect(),AknLayoutScalable_Apps::list_calc_item_pane_t2(enTouch_disabled).LayoutLine(),iCalcAppEnv->OutSheetOperatorFont()); 
   355             operatorLayout.LayoutText(rectParent.Rect(),AknLayoutScalable_Apps::list_calc_item_pane_t2(enTouch_disabled).LayoutLine(),iCalcAppEnv->OutSheetOperatorFont()); 
   355 		    iOperatorLayout->AppendL(operatorLayout);
   356             iOperatorLayout->AppendL(operatorLayout);
   356 		
   357         
   357 		    operendLayout.LayoutText(rectParent.Rect(),AknLayoutScalable_Apps::list_calc_item_pane_t1(enTouch_disabled).LayoutLine(),iCalcAppEnv->OutSheetOperatorFont()); 
   358             operendLayout.LayoutText(rectParent.Rect(),AknLayoutScalable_Apps::list_calc_item_pane_t1(enTouch_disabled).LayoutLine(),iCalcAppEnv->OutSheetOperatorFont()); 
   358 		    iOperandLayout->AppendL(operendLayout);    
   359             iOperandLayout->AppendL(operendLayout);    
   359 		}
   360         }
   360 		
   361         
   361 	  // aCustomFont
   362       // aCustomFont
   362      --nTimes;
   363      --nTimes;
   363 		
   364         
   364 		}
   365         }
   365 	  
   366       
   366 	  else
   367       else
   367 	  {
   368       {
   368 	  	  
   369             
   369 	    
   370         
   370 	  //Scalable UI.
   371       //Scalable UI.
   371 
   372 
   372 	  	TAknLayoutText operatorLayout;
   373           TAknLayoutText operatorLayout;
   373 		TAknLayoutText operendLayout;
   374         TAknLayoutText operendLayout;
   374 	  	operatorLayout.LayoutText(parentRect,AppLayout::Calculator_texts_Line_8(nTimes),iCalcAppEnv->OutSheetOperatorFont()); // aCustomFont
   375           operatorLayout.LayoutText(parentRect,AppLayout::Calculator_texts_Line_8(nTimes),iCalcAppEnv->OutSheetOperatorFont()); // aCustomFont
   375 	    iOperatorLayout->AppendL(operatorLayout);        
   376         iOperatorLayout->AppendL(operatorLayout);        
   376 
   377 
   377 		operendLayout.LayoutText(parentRect,AppLayout::Calculator_texts_Line_7(nTimes), NULL);
   378         operendLayout.LayoutText(parentRect,AppLayout::Calculator_texts_Line_7(nTimes), NULL);
   378 		iOperandLayout->AppendL(operendLayout);            
   379         iOperandLayout->AppendL(operendLayout);            
   379      --nTimes;
   380      --nTimes;
   380 	  }
   381       }
   381     }
   382     }
   382     
   383     
   383     //Scalable UI.
   384     //Scalable UI.
   384 	nTimes = iCalcOutputSheetLines - 2;	  
   385     nTimes = iCalcOutputSheetLines - 2;      
   385     for (TInt ii(0); ii < (iCalcOutputSheetLines - 1); ii++)
   386     for (TInt ii(0); ii < (iCalcOutputSheetLines - 1); ii++)
   386         {
   387         {
   387 
   388 
   388 
   389 
   389 		if( AknLayoutUtils::ScalableLayoutInterfaceAvailable() )
   390         if( AknLayoutUtils::ScalableLayoutInterfaceAvailable() )
   390 			{
   391             {
   391 #ifdef __SCALABLE_ICONS		
   392 #ifdef __SCALABLE_ICONS        
   392 			layoutOfParentResultsLine =  AknLayoutScalable_Apps::list_calc_item_pane(nTimes).LayoutLine();
   393             layoutOfParentResultsLine =  AknLayoutScalable_Apps::list_calc_item_pane(nTimes).LayoutLine();
   393 
   394 
   394 			rectParent.LayoutRect(rectListCalcPane.Rect(),layoutOfParentResultsLine) ;
   395             rectParent.LayoutRect(rectListCalcPane.Rect(),layoutOfParentResultsLine) ;
   395 			TAknWindowLineLayout   layoutOfResultsLine = AknLayoutScalable_Apps::list_calc_item_pane_g1().LayoutLine(); 
   396             TAknWindowLineLayout   layoutOfResultsLine = AknLayoutScalable_Apps::list_calc_item_pane_g1().LayoutLine(); 
   396 			TAknLayoutRect lineLayout;
   397             TAknLayoutRect lineLayout;
   397 			lineLayout.LayoutRect(rectParent.Rect(),layoutOfResultsLine);
   398             lineLayout.LayoutRect(rectParent.Rect(),layoutOfResultsLine);
   398 			iResultsLineLayout->AppendL(lineLayout);
   399             iResultsLineLayout->AppendL(lineLayout);
   399 #else
   400 #else
   400 			TAknLayoutRect lineLayout;
   401             TAknLayoutRect lineLayout;
   401 			lineLayout.LayoutRect(parentRect,AppLayout::Calculator_elements_Line_3(nTimes)); 
   402             lineLayout.LayoutRect(parentRect,AppLayout::Calculator_elements_Line_3(nTimes)); 
   402 			iEqualLineLayout->AppendL(lineLayout);
   403             iEqualLineLayout->AppendL(lineLayout);
   403 #endif
   404 #endif
   404 			}
   405             }
   405 			else
   406             else
   406 			{
   407             {
   407 			TAknLayoutRect lineLayout;
   408             TAknLayoutRect lineLayout;
   408 			lineLayout.LayoutRect(parentRect,AppLayout::Calculator_elements_Line_3(nTimes)); 
   409             lineLayout.LayoutRect(parentRect,AppLayout::Calculator_elements_Line_3(nTimes)); 
   409 			iEqualLineLayout->AppendL(lineLayout);
   410             iEqualLineLayout->AppendL(lineLayout);
   410 			}
   411             }
   411 			
   412             
   412 		--nTimes;
   413         --nTimes;
   413         }
   414         }
   414 
   415 
   415     TAknLayoutRect  paperRect;
   416     TAknLayoutRect  paperRect;
   416 	if( AknLayoutUtils::ScalableLayoutInterfaceAvailable() )
   417     if( AknLayoutUtils::ScalableLayoutInterfaceAvailable() )
   417 			{
   418             {
   418 			TAknLayoutRect rectCalcPaperPane;	
   419             TAknLayoutRect rectCalcPaperPane;    
   419 			TAknLayoutRect rectbgCalcPaperPane;
   420             TAknLayoutRect rectbgCalcPaperPane;
   420 			//Different configuration for Touch Layouts
   421             //Different configuration for Touch Layouts
   421 			if( AknLayoutUtils::PenEnabled() )
   422             if( AknLayoutUtils::PenEnabled() )
   422 			{
   423             {
   423 					//In landscape mode different configuration is needed
   424                     //In landscape mode different configuration is needed
   424 			     if (Layout_Meta_Data::IsLandscapeOrientation())
   425                  if (Layout_Meta_Data::IsLandscapeOrientation())
   425 			     {
   426                  {
   426 			        rectCalcPaperPane.LayoutRect(parentRect,AknLayoutScalable_Apps::calc_paper_pane(enTouch_with_lsc).LayoutLine());  
   427                     rectCalcPaperPane.LayoutRect(parentRect,AknLayoutScalable_Apps::calc_paper_pane(enTouch_with_lsc).LayoutLine());  
   427 			     }
   428                  }
   428 			     else
   429                  else
   429 			     {
   430                  {
   430 			        rectCalcPaperPane.LayoutRect(parentRect,AknLayoutScalable_Apps::calc_paper_pane(enTouch_with_prt).LayoutLine());      
   431                     rectCalcPaperPane.LayoutRect(parentRect,AknLayoutScalable_Apps::calc_paper_pane(enTouch_with_prt).LayoutLine());      
   431 			     }
   432                  }
   432 			     rectbgCalcPaperPane.LayoutRect(rectCalcPaperPane.Rect(),AknLayoutScalable_Apps::bg_calc_paper_pane(enTouch_enabled).LayoutLine());
   433                  rectbgCalcPaperPane.LayoutRect(rectCalcPaperPane.Rect(),AknLayoutScalable_Apps::bg_calc_paper_pane(enTouch_enabled).LayoutLine());
   433 			}
   434             }
   434 			else
   435             else
   435 			{
   436             {
   436 			    rectCalcPaperPane.LayoutRect(parentRect,AknLayoutScalable_Apps::calc_paper_pane(enTouch_disabled).LayoutLine());    
   437                 rectCalcPaperPane.LayoutRect(parentRect,AknLayoutScalable_Apps::calc_paper_pane(enTouch_disabled).LayoutLine());    
   437 			    rectbgCalcPaperPane.LayoutRect(rectCalcPaperPane.Rect(),AknLayoutScalable_Apps::bg_calc_paper_pane().LayoutLine());
   438                 rectbgCalcPaperPane.LayoutRect(rectCalcPaperPane.Rect(),AknLayoutScalable_Apps::bg_calc_paper_pane().LayoutLine());
   438 			}
   439             }
   439 			
   440             
   440 			iPaperPaneRect  = rectCalcPaperPane;
   441             iPaperPaneRect  = rectCalcPaperPane;
   441 			
   442             
   442 			
   443             
   443 			iCalcPaperLayout[0].LayoutRect(rectbgCalcPaperPane.Rect(),AknLayoutScalable_Apps::bg_calc_paper_pane_g1().LayoutLine());
   444             iCalcPaperLayout[0].LayoutRect(rectbgCalcPaperPane.Rect(),AknLayoutScalable_Apps::bg_calc_paper_pane_g1().LayoutLine());
   444 			iCalcPaperLayout[1].LayoutRect(rectbgCalcPaperPane.Rect(),AknLayoutScalable_Apps::bg_calc_paper_pane_g2().LayoutLine());
   445             iCalcPaperLayout[1].LayoutRect(rectbgCalcPaperPane.Rect(),AknLayoutScalable_Apps::bg_calc_paper_pane_g2().LayoutLine());
   445 			iCalcPaperLayout[2].LayoutRect(rectbgCalcPaperPane.Rect(),AknLayoutScalable_Apps::bg_calc_paper_pane_g3().LayoutLine());
   446             iCalcPaperLayout[2].LayoutRect(rectbgCalcPaperPane.Rect(),AknLayoutScalable_Apps::bg_calc_paper_pane_g3().LayoutLine());
   446 			iCalcPaperLayout[3].LayoutRect(rectbgCalcPaperPane.Rect(),AknLayoutScalable_Apps::bg_calc_paper_pane_g4().LayoutLine());
   447             iCalcPaperLayout[3].LayoutRect(rectbgCalcPaperPane.Rect(),AknLayoutScalable_Apps::bg_calc_paper_pane_g4().LayoutLine());
   447 		    iCalcPaperLayout[4].LayoutRect(rectbgCalcPaperPane.Rect(),AknLayoutScalable_Apps::bg_calc_paper_pane_g5().LayoutLine());
   448             iCalcPaperLayout[4].LayoutRect(rectbgCalcPaperPane.Rect(),AknLayoutScalable_Apps::bg_calc_paper_pane_g5().LayoutLine());
   448 			iCalcPaperLayout[5].LayoutRect(rectbgCalcPaperPane.Rect(),AknLayoutScalable_Apps::bg_calc_paper_pane_g6().LayoutLine());
   449             iCalcPaperLayout[5].LayoutRect(rectbgCalcPaperPane.Rect(),AknLayoutScalable_Apps::bg_calc_paper_pane_g6().LayoutLine());
   449 			iCalcPaperLayout[6].LayoutRect(rectbgCalcPaperPane.Rect(),AknLayoutScalable_Apps::bg_calc_paper_pane_g7().LayoutLine());
   450             iCalcPaperLayout[6].LayoutRect(rectbgCalcPaperPane.Rect(),AknLayoutScalable_Apps::bg_calc_paper_pane_g7().LayoutLine());
   450     		iCalcPaperLayout[7].LayoutRect(rectbgCalcPaperPane.Rect(),AknLayoutScalable_Apps::bg_calc_paper_pane_g8().LayoutLine());
   451             iCalcPaperLayout[7].LayoutRect(rectbgCalcPaperPane.Rect(),AknLayoutScalable_Apps::bg_calc_paper_pane_g8().LayoutLine());
   451 			iCalcPaperLayout[8].LayoutRect(rectbgCalcPaperPane.Rect(),AknLayoutScalable_Apps::calc_bg_paper_pane_g9().LayoutLine());
   452             iCalcPaperLayout[8].LayoutRect(rectbgCalcPaperPane.Rect(),AknLayoutScalable_Apps::calc_bg_paper_pane_g9().LayoutLine());
   452 			}
   453             }
   453 			
   454             
   454 	   iOpSheetContext->SetRect(Rect());
   455        iOpSheetContext->SetRect(Rect());
   455 		
   456         
   456 		//Only for touch UI, scrollbars are present
   457         //Only for touch UI, scrollbars are present
   457 	   if( AknLayoutUtils::PenEnabled()  )
   458        if( AknLayoutUtils::PenEnabled()  )
   458         {
   459         {
   459           UpdateScrollIndicatorL();
   460           UpdateScrollIndicatorL();
   460         }
   461         }
   461         else
   462         else
   462         {
   463         {
   465             delete(iSBFrame);
   466             delete(iSBFrame);
   466             iSBFrame = NULL;
   467             iSBFrame = NULL;
   467         }
   468         }
   468         
   469         
   469         }
   470         }
   470 		
   471         
   471 		}
   472         }
   472 
   473 
   473 
   474 
   474 // ---------------------------------------------------------
   475 // ---------------------------------------------------------
   475 // CCalcOutputSheet::UpdateScrollIndicatorL
   476 // CCalcOutputSheet::UpdateScrollIndicatorL
   476 // Creates and updates the scrollbar
   477 // Creates and updates the scrollbar
   477 // (other items were commented in a header).
   478 // (other items were commented in a header).
   478 // ---------------------------------------------------------
   479 // ---------------------------------------------------------
   479 void CCalcOutputSheet::UpdateScrollIndicatorL()
   480 void CCalcOutputSheet::UpdateScrollIndicatorL()
   480     {
   481     {
   481     	
   482         
   482     	if( !AknLayoutUtils::PenEnabled()  )
   483         if( !AknLayoutUtils::PenEnabled()  )
   483     	{
   484         {
   484     		return;
   485             return;
   485     	}
   486         }
   486     	
   487         
   487         TAknLayoutRect rectCalcScrollPane;	
   488         TAknLayoutRect rectCalcScrollPane;    
   488 
   489 
   489         //Get the layout information for the scrollbar
   490         //Get the layout information for the scrollbar
   490         if( AknLayoutUtils::PenEnabled() )
   491         if( AknLayoutUtils::PenEnabled() )
   491         {
   492         {
   492          if (Layout_Meta_Data::IsLandscapeOrientation())
   493          if (Layout_Meta_Data::IsLandscapeOrientation())
   497          {
   498          {
   498             rectCalcScrollPane.LayoutRect(iPaperPaneRect.Rect(),AknLayoutScalable_Apps::scroll_pane_cp024().LayoutLine());      
   499             rectCalcScrollPane.LayoutRect(iPaperPaneRect.Rect(),AknLayoutScalable_Apps::scroll_pane_cp024().LayoutLine());      
   499          }
   500          }
   500 
   501 
   501         }
   502         }
   502 				//Create scrollbar if not created already
   503                 //Create scrollbar if not created already
   503         if ( !iSBFrame )
   504         if ( !iSBFrame )
   504         {
   505         {
   505         //Make this class as the observer class as well
   506         //Make this class as the observer class as well
   506         iSBFrame = new( ELeave ) CEikScrollBarFrame( this,this, ETrue );
   507         iSBFrame = new( ELeave ) CEikScrollBarFrame( this,this, ETrue );
   507 
   508 
   508         // Decide which type of scrollbar is to be shown
   509         // Decide which type of scrollbar is to be shown
   509         CAknAppUi* appUi = iAvkonAppUi;
   510         CAknAppUi* appUi = iAvkonAppUi;
   510         if (AknLayoutUtils::DefaultScrollBarType(appUi) == CEikScrollBarFrame::EDoubleSpan)
   511         if (AknLayoutUtils::DefaultScrollBarType(appUi) == CEikScrollBarFrame::EDoubleSpan)
   511         {
   512         {
   512         	// For EDoubleSpan type scrollbar
   513             // For EDoubleSpan type scrollbar
   513         	iSBFrame->CreateDoubleSpanScrollBarsL(ETrue, EFalse); // non-window owning scrollbar            
   514             iSBFrame->CreateDoubleSpanScrollBarsL(ETrue, EFalse); // non-window owning scrollbar            
   514         	iSBFrame->SetTypeOfVScrollBar(CEikScrollBarFrame::EDoubleSpan);
   515             iSBFrame->SetTypeOfVScrollBar(CEikScrollBarFrame::EDoubleSpan);
   515         }
   516         }
   516         else
   517         else
   517         {
   518         {
   518         	// For EArrowHead type scrollbar
   519             // For EArrowHead type scrollbar
   519         	iSBFrame->SetTypeOfVScrollBar(CEikScrollBarFrame::EArrowHead);
   520             iSBFrame->SetTypeOfVScrollBar(CEikScrollBarFrame::EArrowHead);
   520         }  
   521         }  
   521         iSBFrame->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff,CEikScrollBarFrame::EAuto);
   522         iSBFrame->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff,CEikScrollBarFrame::EOff);
   522         }
   523         }
   523 
   524 
   524         TEikScrollBarModel hSbarModel;
   525         TEikScrollBarModel hSbarModel;
   525         TEikScrollBarModel vSbarModel;
   526         TEikScrollBarModel vSbarModel;
   526         
   527         
   531             vSbarModel.iThumbPosition = 0;    
   532             vSbarModel.iThumbPosition = 0;    
   532             
   533             
   533         }
   534         }
   534         else
   535         else
   535         {
   536         {
   536         		//span calculator if no of lines exceeds one page
   537                 //span calculator if no of lines exceeds one page
   537             vSbarModel.iScrollSpan = 1 + iCalcHistory->Count() - iCalcOutputSheetLines;  
   538             vSbarModel.iScrollSpan = 1 + iCalcHistory->Count() - iCalcOutputSheetLines;  
   538         }
   539         }
   539 
   540 
   540         iPrevThumbPosition = vSbarModel.iThumbPosition = vSbarModel.iScrollSpan - 1;
   541         iPrevThumbPosition = vSbarModel.iThumbPosition = vSbarModel.iScrollSpan - 1;
   541         vSbarModel.iThumbSpan = 1;
   542         vSbarModel.iThumbSpan = 1;
   542 
   543 
   543         TRect clientRect( iAvkonAppUi->ClientRect() );
   544         TRect clientRect( iAvkonAppUi->ClientRect() );
   544         TRect rec(rectCalcScrollPane.Rect()); 
   545         TRect rec(rectCalcScrollPane.Rect()); 
       
   546         TPoint point = rectCalcScrollPane.Rect().iBr;
       
   547         TInt width = rectCalcScrollPane.Rect().Width();
       
   548         TInt rightPointRectX = iSBBrPoint.iX;
       
   549         TInt pointRectX = point.iX;
       
   550         TInt pointRectY = point.iY;
       
   551         pointRectX = rightPointRectX;
       
   552         TPoint newPoint;
       
   553         newPoint.SetXY( pointRectX, pointRectY );
       
   554         TRect rect;
       
   555         rect.SetRect( rec.iTl, newPoint );
   545 
   556 
   546         TEikScrollBarFrameLayout layout;
   557         TEikScrollBarFrameLayout layout;
   547         layout.iTilingMode = TEikScrollBarFrameLayout::EInclusiveRectConstant;
   558         layout.iTilingMode = TEikScrollBarFrameLayout::EInclusiveRectConstant;
   548 
   559 
   549         if (iSBFrame->TypeOfVScrollBar() == CEikScrollBarFrame::EDoubleSpan)
   560         if (iSBFrame->TypeOfVScrollBar() == CEikScrollBarFrame::EDoubleSpan)
   555             vSbarModel.iThumbPosition = vSbarModel.iScrollSpan - vSbarModel.iThumbSpan;
   566             vSbarModel.iThumbPosition = vSbarModel.iScrollSpan - vSbarModel.iThumbSpan;
   556         }
   567         }
   557 
   568 
   558         TAknDoubleSpanScrollBarModel hDsSbarModel(hSbarModel);
   569         TAknDoubleSpanScrollBarModel hDsSbarModel(hSbarModel);
   559         TAknDoubleSpanScrollBarModel vDsSbarModel(vSbarModel);
   570         TAknDoubleSpanScrollBarModel vDsSbarModel(vSbarModel);
   560 
   571         
   561         iSBFrame->TileL(&hDsSbarModel, &vDsSbarModel, clientRect, rec, layout);               
   572         if (iCalcHistory->Count() <= iCalcOutputSheetLines )
       
   573         {
       
   574         iSBFrame->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff,
       
   575                 CEikScrollBarFrame::EOff);
       
   576         }
       
   577         else
       
   578         {
       
   579         iSBFrame->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff,
       
   580                 CEikScrollBarFrame::EOn);
       
   581         }
       
   582 
       
   583         iSBFrame->TileL(&hDsSbarModel, &vDsSbarModel, clientRect, rect, layout);               
   562         iSBFrame->SetVFocusPosToThumbPos(vDsSbarModel.FocusPosition());
   584         iSBFrame->SetVFocusPosToThumbPos(vDsSbarModel.FocusPosition());
   563         }  
   585         }  
   564         else
   586         else
   565         {
   587         {
   566         iSBFrame->TileL( &hSbarModel, &vSbarModel, clientRect, rec, layout );
   588         iSBFrame->TileL( &hSbarModel, &vSbarModel, clientRect, rect, layout );
   567         iSBFrame->SetVFocusPosToThumbPos( vSbarModel.iThumbPosition );
   589         iSBFrame->SetVFocusPosToThumbPos( vSbarModel.iThumbPosition );
   568         }
   590         }
   569         }
   591         }
   570         
   592         
   571 
   593 
   578 void CCalcOutputSheet::Draw
   600 void CCalcOutputSheet::Draw
   579         (const TRect& aRect) const
   601         (const TRect& aRect) const
   580     {
   602     {
   581     
   603     
   582     CWindowGc& gc = SystemGc();
   604     CWindowGc& gc = SystemGc();
   583 	gc.Clear(aRect);
   605     gc.Clear(aRect);
   584     gc.SetClippingRect(aRect);
   606     gc.SetClippingRect(aRect);
   585     TRect rect(Rect());
   607     TRect rect(Rect());
   586     
   608     
   587 
   609 
   588     
   610     
   591     AknsDrawUtils::Background( AknsUtils:: SkinInstance(), AknsDrawUtils::ControlContext(this), this, gc, rect );
   613     AknsDrawUtils::Background( AknsUtils:: SkinInstance(), AknsDrawUtils::ControlContext(this), this, gc, rect );
   592         
   614         
   593            
   615            
   594     gc.SetBrushStyle(CGraphicsContext::ENullBrush);
   616     gc.SetBrushStyle(CGraphicsContext::ENullBrush);
   595     gc.SetPenStyle(CGraphicsContext::ENullPen);
   617     gc.SetPenStyle(CGraphicsContext::ENullPen);
   596 	//set the size of the bitmap. SVG-T upgrade.
   618     //set the size of the bitmap. SVG-T upgrade.
   597 	CAknsItemData* idata = NULL;    				
   619     CAknsItemData* idata = NULL;                    
   598     if (skin)
   620     if (skin)
   599     	{
   621         {
   600         idata = skin->GetCachedItemData( KAknsIIDQsnFrCalcPaper);
   622         idata = skin->GetCachedItemData( KAknsIIDQsnFrCalcPaper);
   601     	}
   623         }
   602     	
   624         
   603     if ( idata && idata->Type() == EAknsITImageTable )
   625     if ( idata && idata->Type() == EAknsITImageTable )
   604     	{
   626         {
   605             if ( AknLayoutUtils::PenEnabled() ) 
   627             if ( AknLayoutUtils::PenEnabled() ) 
   606             {//when touch input,the paper become bigger,so it needs only one paper 
   628             {//when touch input,the paper become bigger,so it needs only one paper 
   607                 AknIconUtils::SetSize(iCalcScalablePaper[0]->Bitmap(),iCalcPaperLayout[0].Rect().Size(),EAspectRatioNotPreserved); 
   629                 AknIconUtils::SetSize(iCalcScalablePaper[0]->Bitmap(),iCalcPaperLayout[0].Rect().Size(),EAspectRatioNotPreserved); 
   608                 AknIconUtils::SetSize(iCalcScalablePaper[0]->Mask(),iCalcPaperLayout[0].Rect().Size(),EAspectRatioNotPreserved);
   630                 AknIconUtils::SetSize(iCalcScalablePaper[0]->Mask(),iCalcPaperLayout[0].Rect().Size(),EAspectRatioNotPreserved);
   609                 iCalcPaperLayout[0].DrawImage(gc, iCalcScalablePaper[0]->Bitmap(),iCalcScalablePaper[0]->Mask());	
   631                 iCalcPaperLayout[0].DrawImage(gc, iCalcScalablePaper[0]->Bitmap(),iCalcScalablePaper[0]->Mask());    
   610             }
   632             }
   611             else
   633             else
   612             {
   634             {
   613                 for(TInt Cnt=0;Cnt < 9; Cnt++)
   635                 for(TInt Cnt=0;Cnt < 9; Cnt++)
   614             	{
   636                 {
   615                 AknIconUtils::SetSize(iCalcScalablePaper[Cnt]->Bitmap(),iCalcPaperLayout[Cnt].Rect().Size(),EAspectRatioNotPreserved); 
   637                 AknIconUtils::SetSize(iCalcScalablePaper[Cnt]->Bitmap(),iCalcPaperLayout[Cnt].Rect().Size(),EAspectRatioNotPreserved); 
   616             	AknIconUtils::SetSize(iCalcScalablePaper[Cnt]->Mask(),iCalcPaperLayout[Cnt].Rect().Size(),EAspectRatioNotPreserved);
   638                 AknIconUtils::SetSize(iCalcScalablePaper[Cnt]->Mask(),iCalcPaperLayout[Cnt].Rect().Size(),EAspectRatioNotPreserved);
   617             	iCalcPaperLayout[Cnt].DrawImage(gc, iCalcScalablePaper[Cnt]->Bitmap(),iCalcScalablePaper[Cnt]->Mask());
   639                 iCalcPaperLayout[Cnt].DrawImage(gc, iCalcScalablePaper[Cnt]->Bitmap(),iCalcScalablePaper[Cnt]->Mask());
   618                 }
   640                 }
   619             }
   641             }
   620   		}
   642           }
   621     else
   643     else
   622         {
   644         {
   623             // Make outsheet displayed in Jingmask is the same size as in other themes
   645             // Make outsheet displayed in Jingmask is the same size as in other themes
   624             // when there is a scrollbar on outsheet.
   646             // when there is a scrollbar on outsheet.
   625             if ( AknLayoutUtils::PenEnabled() )
   647             if ( AknLayoutUtils::PenEnabled() )
   627                 AknsDrawUtils::Background( AknsUtils:: SkinInstance(), iOpSheetContext, this, gc, iCalcPaperLayout[0].Rect() );
   649                 AknsDrawUtils::Background( AknsUtils:: SkinInstance(), iOpSheetContext, this, gc, iCalcPaperLayout[0].Rect() );
   628                 }
   650                 }
   629             else
   651             else
   630                 {
   652                 {
   631                 AknsDrawUtils::Background( AknsUtils:: SkinInstance(), iOpSheetContext, this, gc, rect );
   653                 AknsDrawUtils::Background( AknsUtils:: SkinInstance(), iOpSheetContext, this, gc, rect );
   632                 }	
   654                 }    
   633         }
   655         }
   634   		
   656           
   635 	
   657     
   636     for (TInt loop(iCalcOutputSheetLines - 1); loop >= 0; loop--)
   658     for (TInt loop(iCalcOutputSheetLines - 1); loop >= 0; loop--)
   637         {
   659         {
   638         const TCalcEditLine& history = (*iCalcHistory)[loop + iScrollOffset];
   660         const TCalcEditLine& history = (*iCalcHistory)[loop + iScrollOffset];
   639         TCalcEditLine::TCalcOperatorType operatorType(
   661         TCalcEditLine::TCalcOperatorType operatorType(
   640             history.Operator());
   662             history.Operator());
   641         
   663         
   642         if (loop < iCalcOutputSheetLines - 1)
   664         if (loop < iCalcOutputSheetLines - 1)
   643             {
   665             {
   644 			// When an operator is Equal, a line is drawn at an upper end.
   666             // When an operator is Equal, a line is drawn at an upper end.
   645 			if (TCalcEditLine::ECalcEqual == operatorType)
   667             if (TCalcEditLine::ECalcEqual == operatorType)
   646 				{
   668                 {
   647 					TRgb ResultsLineolor;
   669                     TRgb ResultsLineolor;
   648                     TInt error1 = AknsUtils::GetCachedColor( skin, ResultsLineolor, KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG29);
   670                     TInt error1 = AknsUtils::GetCachedColor( skin, ResultsLineolor, KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG29);
   649                     if(error1 == KErrNone)
   671                     if(error1 == KErrNone)
   650                     {
   672                     {
   651                         AknIconUtils::SetIconColor(iCalcResultsLine->Bitmap(),ResultsLineolor);
   673                         AknIconUtils::SetIconColor(iCalcResultsLine->Bitmap(),ResultsLineolor);
   652                     }
   674                     }
   653 				if( AknLayoutUtils::ScalableLayoutInterfaceAvailable() )
   675                 if( AknLayoutUtils::ScalableLayoutInterfaceAvailable() )
   654 					{
   676                     {
   655 #ifdef __SCALABLE_ICONS
   677 #ifdef __SCALABLE_ICONS
   656 					TAknLayoutRect& lineLayout = iResultsLineLayout->At(loop);
   678                     TAknLayoutRect& lineLayout = iResultsLineLayout->At(loop);
   657 					AknIconUtils::SetSize(iCalcResultsLine->Bitmap(),lineLayout.Rect().Size(),EAspectRatioNotPreserved);
   679                     AknIconUtils::SetSize(iCalcResultsLine->Bitmap(),lineLayout.Rect().Size(),EAspectRatioNotPreserved);
   658 					AknIconUtils::SetSize(iCalcResultsLine->Mask(),lineLayout.Rect().Size(),EAspectRatioNotPreserved);
   680                     AknIconUtils::SetSize(iCalcResultsLine->Mask(),lineLayout.Rect().Size(),EAspectRatioNotPreserved);
   659 					lineLayout.DrawImage(gc, iCalcResultsLine->Bitmap(),iCalcResultsLine->Mask()); 
   681                     lineLayout.DrawImage(gc, iCalcResultsLine->Bitmap(),iCalcResultsLine->Mask()); 
   660 #else
   682 #else
   661 					TAknLayoutRect& equalLineLayout= iEqualLineLayout->At(loop);
   683                     TAknLayoutRect& equalLineLayout= iEqualLineLayout->At(loop);
   662 					TRect rectLine = equalLineLayout.Rect();
   684                     TRect rectLine = equalLineLayout.Rect();
   663 					equalLineLayout.DrawRect(gc);
   685                     equalLineLayout.DrawRect(gc);
   664 #endif
   686 #endif
   665 					}
   687                     }
   666 				else 
   688                 else 
   667 					{ 
   689                     { 
   668 					TAknLayoutRect& equalLineLayout= iEqualLineLayout->At(loop);
   690                     TAknLayoutRect& equalLineLayout= iEqualLineLayout->At(loop);
   669 					TRect rectLine = equalLineLayout.Rect();
   691                     TRect rectLine = equalLineLayout.Rect();
   670 					equalLineLayout.DrawRect(gc);
   692                     equalLineLayout.DrawRect(gc);
   671 					}
   693                     }
   672 				}
   694                 }
   673             }
   695             }
   674             TRgb color;
   696             TRgb color;
   675             TInt error = AknsUtils::GetCachedColor( skin, color, KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG29);
   697             TInt error = AknsUtils::GetCachedColor( skin, color, KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG29);
   676 			if(error == KErrNone)
   698             if(error == KErrNone)
   677 			{
   699             {
   678 				gc.SetPenColor(color);
   700                 gc.SetPenColor(color);
   679 			}
   701             }
   680 			
   702             
   681 		//change TBuf<10> to TBuf<KCalcMaxNumberWidth>
   703         //change TBuf<10> to TBuf<KCalcMaxNumberWidth>
   682        TBuf<KCalcMaxNumberWidth> keyvalue;
   704        TBuf<KCalcMaxNumberWidth> keyvalue;
   683        
   705        
   684        keyvalue.Append(history.NumberString());
   706        keyvalue.Append(history.NumberString());
   685        AknTextUtils::LanguageSpecificNumberConversion  (keyvalue);
   707        AknTextUtils::LanguageSpecificNumberConversion  (keyvalue);
   686         // An operand's drawing
   708         // An operand's drawing
   687 		TAknLayoutText& operendLayout = iOperandLayout->At(loop);
   709         TAknLayoutText& operendLayout = iOperandLayout->At(loop);
   688 
   710 
   689                     if ( iUiLanguage == ELangFarsi || iUiLanguage == ELangHindi || 
   711                     if ( iUiLanguage == ELangFarsi || iUiLanguage == ELangHindi || 
   690                         iUiLanguage == ELangUrdu || iUiLanguage == ELangArabic )
   712                         iUiLanguage == ELangUrdu || iUiLanguage == ELangArabic )
   691                         {
   713                         {
   692                          if( iUiLanguage == ELangUrdu || iUiLanguage == ELangArabic )
   714                          if( iUiLanguage == ELangUrdu || iUiLanguage == ELangArabic )
   693 		         {
   715                  {
   694 			    	TInt len = keyvalue.Length();
   716                     TInt len = keyvalue.Length();
   695 				    TInt pos = KErrNotFound;
   717                     TInt pos = KErrNotFound;
   696 				    TBuf<1> ch;
   718                     TBuf<1> ch;
   697 				    ch.Append(iCalcAppEnv->MinusIndicator());
   719                     ch.Append(iCalcAppEnv->MinusIndicator());
   698 				    if( (pos = keyvalue.Locate(iCalcAppEnv->MinusIndicator())) != KErrNotFound &&
   720                     if( (pos = keyvalue.Locate(iCalcAppEnv->MinusIndicator())) != KErrNotFound &&
   699 				         pos == keyvalue.LocateReverse(iCalcAppEnv->MinusIndicator()))
   721                          pos == keyvalue.LocateReverse(iCalcAppEnv->MinusIndicator()))
   700 				    {
   722                     {
   701 				     keyvalue.Delete( pos, 1 );
   723                      keyvalue.Delete( pos, 1 );
   702 				     keyvalue.Insert( 0, ch );	 
   724                      keyvalue.Insert( 0, ch );     
   703 				    }
   725                     }
   704 		         }
   726                  }
   705 			operendLayout.DrawText(gc,keyvalue,EFalse,color);
   727             operendLayout.DrawText(gc,keyvalue,EFalse,color);
   706 		    }
   728             }
   707 		else
   729         else
   708 			{
   730             {
   709 			operendLayout.DrawText(gc,history.NumberString(),EFalse,color);	
   731             operendLayout.DrawText(gc,history.NumberString(),EFalse,color);    
   710 			}
   732             }
   711         // An operator's drawing
   733         // An operator's drawing
   712         TPtrC operatorString(
   734         TPtrC operatorString(
   713             iCalcAppEnv->OutSheetOperator(operatorType));
   735             iCalcAppEnv->OutSheetOperator(operatorType));
   714 		TAknLayoutText& operatorLayout = iOperatorLayout->At(loop);
   736         TAknLayoutText& operatorLayout = iOperatorLayout->At(loop);
   715 		operatorLayout.DrawText(gc, operatorString , EFalse, color);
   737         operatorLayout.DrawText(gc, operatorString , EFalse, color);
   716         }
   738         }
   717         
   739         
   718         
   740         
   719     }
   741     }
   720 
   742 
   734         {
   756         {
   735            //Get the current position from the scroll bar
   757            //Get the current position from the scroll bar
   736            
   758            
   737            if(iPrevThumbPosition >aScrollBar->ThumbPosition() )
   759            if(iPrevThumbPosition >aScrollBar->ThumbPosition() )
   738            {
   760            {
   739            		  //Move the scroll bar n times up
   761                      //Move the scroll bar n times up
   740                 while(iPrevThumbPosition != aScrollBar->ThumbPosition())
   762                 while(iPrevThumbPosition != aScrollBar->ThumbPosition())
   741                 {
   763                 {
   742                     ScrollUp();
   764                     ScrollUp();
   743                     iPrevThumbPosition--;
   765                     iPrevThumbPosition--;
   744                 }
   766                 }
   779 {
   801 {
   780   
   802   
   781     if ( aType == KEikDynamicLayoutVariantSwitch )
   803     if ( aType == KEikDynamicLayoutVariantSwitch )
   782         {
   804         {
   783         if (AknLayoutUtils::PenEnabled())
   805         if (AknLayoutUtils::PenEnabled())
   784 			{
   806             {
   785 			ScrollToBottomL();
   807             ScrollToBottomL();
   786 			}
   808             }
   787 		}
   809         }
   788 	if ( aType == KAknsMessageSkinChange )
   810     if ( aType == KAknsMessageSkinChange )
   789 		{
   811         {
   790 		if (AknLayoutUtils::PenEnabled())
   812         if (AknLayoutUtils::PenEnabled())
   791 			{
   813             {
   792 			delete (iSBFrame);
   814             delete (iSBFrame);
   793 			iSBFrame = NULL;
   815             iSBFrame = NULL;
   794 
   816 
   795 			UpdateScrollIndicatorL();
   817             UpdateScrollIndicatorL();
   796 			}
   818             }
   797 		}
   819         }
   798 }
   820 }
   799 //  End of File  
   821 //  End of File